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

Teach react native to consume source maps #116

Closed
caridy opened this issue Mar 2, 2015 · 6 comments
Closed

Teach react native to consume source maps #116

caridy opened this issue Mar 2, 2015 · 6 comments
Assignees
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@caridy
Copy link

caridy commented Mar 2, 2015

As today, the Packager not only produce the source maps, it also defines RAW_SOURCE_MAP variable, which is a representation of the source maps for the runtime so the errors can be mapped correctly.

Ideally, react native should be able to extract the source map information from the bundle file before executing it in JSC just like browsers do this, including the possibility of using an external source map.

This will open the door for the use of other tools that can take care of the bundling process without having to implement the logic for RAW_SOURCE_MAP, which is proprietary and very weird ;)

/cc @amasad, @ericf, this is what we were trying to explain in the meeting last week.

@amasad
Copy link
Contributor

amasad commented Mar 3, 2015

Thanks @caridy! Will get rid of the weirdness soon :)

@amasad
Copy link
Contributor

amasad commented Mar 3, 2015

@frantic Can the JS read it's own source? So we can parse out source maps from the comments as opposed to exposing the global variables?

@caridy
Copy link
Author

caridy commented Mar 3, 2015

@amasad from the spec, no, you don't have access to the source from the runtime. this process has to happen in the native layer. There are many npm packages to deal with source map, like https://github.com/lydell/source-map-url, hope that help to get the idea of how to pick up the source map from the blob after reading it from disk. Of course, we will have to implement it in native :)

@frantic frantic self-assigned this Mar 6, 2015
@frantic
Copy link
Contributor

frantic commented Mar 6, 2015

On my radar, will take a closer look soon

@frantic
Copy link
Contributor

frantic commented Mar 13, 2015

As of #148 RN will fallback to //@ sourceMappingURL if global RAW_SOURCE_MAP is not available. We will get rid of RAW_SOURCE_MAP soon in favor of base64-encoded sourcemaps.

@vjeux vjeux closed this as completed Mar 16, 2015
@caridy
Copy link
Author

caridy commented Mar 16, 2015

awesome, thanks @frantic

harrykiselev pushed a commit to harrykiselev/react-native that referenced this issue Aug 5, 2015
Update video.md with HTML5DevConf 2014 talk
@facebook facebook locked as resolved and limited conversation to collaborators May 29, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 23, 2018
react-one pushed a commit to react-one/react-native that referenced this issue Sep 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants