Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose InlineSourceMap property #9566

Merged
8 commits merged into from
Feb 23, 2022
Merged

Expose InlineSourceMap property #9566

8 commits merged into from
Feb 23, 2022

Conversation

tudorms
Copy link
Member

@tudorms tudorms commented Feb 17, 2022

Description

Give applications the ability to control the InlineSourceMap property value.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Why

We are currently hardcoding this to false for Hermes, because back in 2020 Hermes was choking with any inline source map larger than a few kilobytes. Things appear to work much better now, so the property will default to true, and -with this change- can be overridden by individual apps if needed.

Addresses the source map concern in #9407.

Microsoft Reviewers: Open in CodeFlow

@@ -215,6 +215,10 @@ namespace Microsoft.ReactNative
DOC_DEFAULT("8081")
UInt16 SourceBundlePort { get; set; };

DOC_STRING("Flag controlling whether the bundle URL requests inline source maps.")
Copy link
Contributor

@acoates-ms acoates-ms Feb 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the other options that only affect when using the bundler server, we start the description with When using a @.UseFastRefresh, @.UseLiveReload, or @.UseWebDebugger, which makes it clear that it wouldn't affect the generated bundle file. #Resolved

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also like the more info in the snapshot property description about when you might want to turn this off. -- And this property is arguably the more important one to describe, since this is where the user will set the option.

@NickGerleman
Copy link
Collaborator

FYI @tudorms I removed the backport labels in general because we don't restrict backports to anything 0.66+. Nothing to do with this change.

if (auto instance = m_reactInstance.GetStrongPtr()) {
return instance->InlineSourceMap();
}
return 0;
Copy link
Collaborator

@NickGerleman NickGerleman Feb 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return 0;
return false;
``` #Resolved

@@ -75,6 +75,7 @@ void MainPage::OnLoadClick(
host.InstanceSettings().DebuggerBreakOnNextLine(x_BreakOnFirstLineCheckBox().IsChecked().GetBoolean());
host.InstanceSettings().UseFastRefresh(x_UseFastRefreshCheckBox().IsChecked().GetBoolean());
host.InstanceSettings().DebuggerPort(static_cast<uint16_t>(std::stoi(std::wstring(x_DebuggerPort().Text()))));
host.InstanceSettings().InlineSourceMap(true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InlineSourceMap

Why is it needed? The 'true' is the default, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, true is default. I used this for testing and can revert. Initially planned to add a checkbox in Playground but the top bar is already too wide and wouldn't accommodate it.

Copy link
Member

@vmoroz vmoroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link
Member

@asklar asklar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we rename the API / update the docs to clarify?

@ghost ghost added the Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) label Feb 22, 2022
@ghost ghost removed the Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) label Feb 22, 2022
@tudorms tudorms requested a review from asklar February 22, 2022 23:25
@tudorms tudorms added the AutoMerge Causes a PR to be automatically merged once all requirements are passed (label drives bot activity) label Feb 23, 2022
@ghost
Copy link

ghost commented Feb 23, 2022

Hello @tudorms!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 4503219 into microsoft:main Feb 23, 2022
tudorms added a commit to tudorms/react-native-windows that referenced this pull request Feb 23, 2022
* Expose InlineSourceMap property

* Change files

* Clarify comment in IDL

* Address comment

* Remove unneeded line

* Rename public property to RequestInlineSourceMap

* Fix bad merge
tudorms added a commit to tudorms/react-native-windows that referenced this pull request Feb 23, 2022
* Expose InlineSourceMap property

* Change files

* Clarify comment in IDL

* Address comment

* Remove unneeded line

* Rename public property to RequestInlineSourceMap

* Fix bad merge
ghost pushed a commit that referenced this pull request Feb 23, 2022
* Expose InlineSourceMap property

* Change files

* Clarify comment in IDL

* Address comment

* Remove unneeded line

* Rename public property to RequestInlineSourceMap

* Fix bad merge
ghost pushed a commit that referenced this pull request Feb 23, 2022
* Expose InlineSourceMap property (#9566)

* Expose InlineSourceMap property

* Change files

* Clarify comment in IDL

* Address comment

* Remove unneeded line

* Rename public property to RequestInlineSourceMap

* Fix bad merge

* Fix changefile
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoMerge Causes a PR to be automatically merged once all requirements are passed (label drives bot activity)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants