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

[Fresh] Set up infra for runtime and Babel plugin #15698

Merged
merged 4 commits into from May 21, 2019

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented May 21, 2019

  • Adds a new react-fresh top level package.
    • Name TBD, I just need somewhere to put my stuff in.
  • Adds a new react-fresh/babel entry point.
    • This will be the Babel plugin. It's a noop now. I added an empty snapshot test.
  • Adds a new react-fresh/runtime entry point.
    • This will be the hot reloading runtime that manages component registration and Families.
    • It will be shared between web and RN implementations.
    • The first version I'm checking in is extracted from what we used in the test suite.

I want to keep it all in this repo so that I can write integration tests which run against latest React, and verify all pieces work together. This also makes it easier to ensure we actually fix this if we break it.

The next follow-up will be to actually write the Babel plugin, and add some kind of integration testing.

@sizebot
Copy link

sizebot commented May 21, 2019

Details of bundled changes.

Comparing: 9c9ea94...4dbd247

react-fresh

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-fresh-babel.development.js n/a n/a 0 B 810 B 0 B 449 B NODE_DEV
react-fresh-babel.production.min.js n/a n/a 0 B 366 B 0 B 282 B NODE_PROD
react-fresh-runtime.development.js n/a n/a 0 B 3.72 KB 0 B 1.58 KB NODE_DEV
react-fresh-runtime.production.min.js n/a n/a 0 B 1.06 KB 0 B 650 B NODE_PROD

Generated by 🚫 dangerJS

const ReactFreshBabelPlugin = require('./src/ReactFreshBabelPlugin');

// This is hacky but makes it work with both Rollup and Jest.
module.exports = ReactFreshBabelPlugin.default || ReactFreshBabelPlugin;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I thought new packages can use ES modules.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think we enabled ESM output for anything yet because of how DEV/PROD split is done.

@gaearon gaearon merged commit 6d4f85b into facebook:master May 21, 2019
@gaearon gaearon deleted the fresh-runtime branch May 21, 2019 20:54
gaearon added a commit to gaearon/react that referenced this pull request Jun 11, 2019
* Add a stub for React Fresh Babel plugin package

* Move ReactFresh-test into ReactFresh top level directory

* Add a stub for React Fresh Runtime entry point

* Extract Fresh runtime from tests into its entry point
gaearon added a commit to gaearon/react that referenced this pull request Jun 19, 2019
* Add a stub for React Fresh Babel plugin package

* Move ReactFresh-test into ReactFresh top level directory

* Add a stub for React Fresh Runtime entry point

* Extract Fresh runtime from tests into its entry point
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants