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

feat: experimental lazy-compilation support #457

Merged
merged 6 commits into from
Oct 30, 2023
Merged

Conversation

jbroma
Copy link
Member

@jbroma jbroma commented Oct 27, 2023

Summary

Enable experimental lazy compilation support. This is done via react-native-event-source package which serves as a polyfill for EventSource which is not present in react-native environment.

Checklist

  • - enable lazy compilation in DevelopmentPlugin
  • - add DX errors related to lazy compilation
  • - add a guide to docs about lazy compilation

Test plan

  • tested locally on TesterApp

@changeset-bot
Copy link

changeset-bot bot commented Oct 27, 2023

🦋 Changeset detected

Latest commit: ea76674

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@callstack/repack Minor
testerapp Patch

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

@jbroma
Copy link
Member Author

jbroma commented Oct 30, 2023

@thymikee
Copy link
Member

The docs look good. Maybe one more thing that I would expect as a user would be code example – what code patterns do I need to use to benefit from lazy compilation. So something like:

You may find this useful if you have a lot of code like this:

const Component = React.lazy(() => await import('./component'));
return (
  <Supense>
    <Component />
  </Supense>
);

@jbroma jbroma merged commit 74de630 into main Oct 30, 2023
4 checks passed
@jbroma jbroma deleted the feat/lazy-compilation branch October 30, 2023 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants