Skip to content

Allow Windows to use assets unbundle - #12423

Closed
rozele wants to merge 2 commits into
react:masterfrom
rozele:patch-2
Closed

rozele wants to merge 2 commits into
react:masterfrom
rozele:patch-2

Conversation

@rozele

@rozele rozele commented Feb 16, 2017

Copy link
Copy Markdown
Contributor

In react-native-windows, we are able to overwrite React modules, but unfortunately there is not any good way of overwriting packager modules. I'm trying to implement support for unbundle in react-native-windows, but unfortunately this file limits assets-based unbundles to the Android platform only. This change will allow platforms other than Android to use unbundles, while still disabling assets unbundles for iOS.

Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:

Unless you are a React Native release maintainer and cherry-picking an existing commit into a current release, ensure your pull request is targeting the master React Native branch.

Explain the motivation for making this change. What existing problem does the pull request solve?

Prefer small pull requests. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.

Test plan (required)

Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.

Make sure tests pass on both Travis and Circle CI.

Code formatting

Look around. Match the style of the rest of the codebase. See also the simple style guide.

For more info, see the "Pull Requests" section of our "Contributing" guidelines.

In `react-native-windows`, we are able to overwrite React modules, but unfortunately there is not any good way of overwriting packager modules.  I'm trying to implement support for `unbundle` in `react-native-windows`, but unfortunately this file limits assets-based unbundles to the Android platform only.  This change will allow platforms other than Android to use unbundles, while still disabling assets unbundles for iOS.
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. GH Review: review-needed labels Feb 16, 2017
rozele added a commit to rozele/react-native-windows that referenced this pull request Feb 17, 2017
Adds unbundle support by adding a check in ChakraJavaScriptExecutor for the UNBUNDLE magic file, and by adding a `nativeRequire` hook to the Chakra runtime to dynamically load files when needed. The intent is that this should reduce app start times by reducing the amount of JavaScript that needs to be initially processed, but it doesn't seem to have much effect on the simple Playground and UIExplorer apps I've tested it on.

Remaining TODO: add unbundle support to NativeJavaScriptExecutor

Depends on react/react-native#12423

Fixes microsoft#952
@janicduplessis

Copy link
Copy Markdown
Contributor

Seems reasonable,

@facebook-github-bot shipit

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@janicduplessis has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

rozele added a commit to rozele/react-native-windows that referenced this pull request Feb 28, 2017
Adds unbundle support by adding a check in ChakraJavaScriptExecutor for the UNBUNDLE magic file, and by adding a `nativeRequire` hook to the Chakra runtime to dynamically load files when needed. The intent is that this should reduce app start times by reducing the amount of JavaScript that needs to be initially processed, but it doesn't seem to have much effect on the simple Playground and UIExplorer apps I've tested it on.

Remaining TODO: add unbundle support to NativeJavaScriptExecutor

Depends on react/react-native#12423

Fixes microsoft#952
rozele added a commit to rozele/react-native-windows that referenced this pull request Feb 28, 2017
Adds unbundle support by adding a check in ChakraJavaScriptExecutor for the UNBUNDLE magic file, and by adding a `nativeRequire` hook to the Chakra runtime to dynamically load files when needed. The intent is that this should reduce app start times by reducing the amount of JavaScript that needs to be initially processed, but it doesn't seem to have much effect on the simple Playground and UIExplorer apps I've tested it on.

Remaining TODO: add unbundle support to NativeJavaScriptExecutor

Depends on react/react-native#12423

Fixes microsoft#952
rozele added a commit to rozele/react-native-windows that referenced this pull request Mar 9, 2017
Adds unbundle support by adding a check in ChakraJavaScriptExecutor for the UNBUNDLE magic file, and by adding a `nativeRequire` hook to the Chakra runtime to dynamically load files when needed. The intent is that this should reduce app start times by reducing the amount of JavaScript that needs to be initially processed, but it doesn't seem to have much effect on the simple Playground and UIExplorer apps I've tested it on.

Remaining TODO: add unbundle support to NativeJavaScriptExecutor

Depends on react/react-native#12423

Fixes microsoft#952
rozele added a commit to rozele/react-native-windows that referenced this pull request Mar 10, 2017
Adds unbundle support by adding a check in ChakraJavaScriptExecutor for the UNBUNDLE magic file, and by adding a `nativeRequire` hook to the Chakra runtime to dynamically load files when needed. The intent is that this should reduce app start times by reducing the amount of JavaScript that needs to be initially processed, but it doesn't seem to have much effect on the simple Playground and UIExplorer apps I've tested it on.

Remaining TODO: add unbundle support to NativeJavaScriptExecutor

Depends on react/react-native#12423

Fixes microsoft#952
@facebook-github-bot facebook-github-bot added GH Review: accepted Import Started This pull request has been imported. This does not imply the PR has been approved. and removed GH Review: review-needed labels Mar 13, 2017
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@mkonicek has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@mkonicek

mkonicek commented Mar 13, 2017 •

Copy link
Copy Markdown
Contributor

Sorry about the long delay on this! Just found this PR by reading the Core Contributors group on fb. Merging.

@facebook-github-bot facebook-github-bot added Import Failed and removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Mar 14, 2017
@facebook-github-bot

Copy link
Copy Markdown
Contributor

I tried to merge this pull request into the Facebook internal repo but some checks failed. To unblock yourself please check the following: Does this pull request pass all open source tests on GitHub? If not please fix those. Does the code still apply cleanly on top of GitHub master? If not can please rebase. In all other cases this means some internal test failed, for example a part of a fb app won't work with this pull request. I've added the Import Failed label to this pull request so it is easy for someone at fb to find the pull request and check what failed. If you don't see anyone comment in a few days feel free to comment mentioning one of the core contributors to the project so they get a notification.

@mkonicek

Copy link
Copy Markdown
Contributor

Based on the discussion in the fb core contributors group this is not needed anymore. Please ping me on Slack or fb if we should merge this. I'll close it for now.

@mkonicek mkonicek closed this Mar 15, 2017
rozele added a commit to rozele/react-native-windows that referenced this pull request Jul 17, 2017
Adds unbundle support by adding a check in ChakraJavaScriptExecutor for the UNBUNDLE magic file, and by adding a `nativeRequire` hook to the Chakra runtime to dynamically load files when needed. The intent is that this should reduce app start times by reducing the amount of JavaScript that needs to be initially processed, but it doesn't seem to have much effect on the simple Playground and UIExplorer apps I've tested it on.

Remaining TODO: add unbundle support to NativeJavaScriptExecutor

Depends on react/react-native#12423

Fixes microsoft#952
rozele added a commit to rozele/react-native-windows that referenced this pull request Jul 27, 2017
Adds unbundle support by adding a check in ChakraJavaScriptExecutor for the UNBUNDLE magic file, and by adding a `nativeRequire` hook to the Chakra runtime to dynamically load files when needed. The intent is that this should reduce app start times by reducing the amount of JavaScript that needs to be initially processed, but it doesn't seem to have much effect on the simple Playground and UIExplorer apps I've tested it on.

Remaining TODO: add unbundle support to NativeJavaScriptExecutor

Depends on react/react-native#12423

Fixes microsoft#952
rozele added a commit to microsoft/react-native-windows that referenced this pull request Jul 28, 2017
Adds unbundle support by adding a check in ChakraJavaScriptExecutor for the UNBUNDLE magic file, and by adding a `nativeRequire` hook to the Chakra runtime to dynamically load files when needed. The intent is that this should reduce app start times by reducing the amount of JavaScript that needs to be initially processed, but it doesn't seem to have much effect on the simple Playground and UIExplorer apps I've tested it on.

Remaining TODO: add unbundle support to NativeJavaScriptExecutor

Depends on react/react-native#12423

Fixes #952
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

5 participants