Add ChunksToHermesBytecodePlugin#378
Conversation
🦋 Changeset detectedLatest commit: b1b7c42 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
I wonder if this should be added to the output plugin as an optional step. It needs to use a lot of the same logic to determine local vs remote chunks 🤔 |
|
Hi @mikeduminy First of all, thank you so much creating PR with this! We are very excited and are looking forward to getting this to the finish line ASAP 🚀 Regarding the open questions:
What I suggest we should do starting with this plugin (and apply the same pattern for the rest of the plugins in the future):
Going forward I think this will be easier to maintain and will allow users more granular control over what gets transformed and not. |
|
The plugin now uses All the transformations are now done inside |
|
Preview of the docs available here: https://6494804b67314a519583e33b--re-pack.netlify.app/docs/configuration/plugins/chunks-to-hermes |
1eb6a70 to
30ca5b3
Compare
0a223ec to
b1b7c42
Compare
Summary
At Klarna we've been using Re.pack for a while now, and wish to contribute back our implementation of a
ChunksToHermesBytecodePlugin. This PR is based on an in-house plugin developed by @oblador.The plugin itself re-implements tranformations found in each platform (which assume a single main chunk):
Test plan
OpenResolved* questions[Resolved] Should this transformation happen inside the
OutputPlugin(orAssetProcessors)?Resolution: No, the
OutputPluginis already doing too much.[Resolved] Should we transform all chunks in this plugin, or ignore the main chunk (letting react-native transform that using hermes) and transform the rest?
Resolution: By default we let RN transform the main chunk but the API of the plugin should allow users to also transform the entry chunk if they want.
[Resolved] Alternative to (2): What if the
ChunksToHermesBytecodePluginaccepted atransformMainChunk: booleanproperty?Resolution: See (2)
TODO: