GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add exports field to react-refresh's package.json by otakustay · Pull Request #23087 · react/react

Conversation

@otakustay

@otakustay otakustay commented Jan 10, 2022

Copy link
Copy Markdown
Contributor

Summary

We were migrating our build tools to pure ESM format, and found we cannot import react-refresh/babel from a pure ESM module, it indicates to add an extension:

Cannot find module '/Users/otakustay/Develop/reskript/packages/config-babel/node_modules/react-refresh/babel' imported from /Users/otakustay/Develop/reskript/packages/config-babel/dist/index.js

In order to make pure ESM able to import react-refresh/babel, we need to add an exports field into package.json mapping ./babel to ./babel.js.

How did you test this change?

I have manually modified local node_modules/react-refresh/package.json and tested our build.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@otakustay
Add exports field to react-refresh's package.json
29881ee
@facebook-github-bot

facebook-github-bot commented Jan 10, 2022

Copy link
Copy Markdown
Contributor

Hi @otakustay!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@otakustay

otakustay commented Jan 10, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Although I exported both . and ./babel, but it is a potential breaking change if developers already use require('react-refresh/babel.js') (explicit .js extension) or require('react-refresh/cjs/...') (deep into cjs folder), thus we may need a minor version 0.12.0

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@facebook-github-bot facebook-github-bot added the CLA Signed label Jan 10, 2022
@facebook-github-bot

facebook-github-bot commented Jan 10, 2022

Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

otakustay added 2 commits January 10, 2022 21:45
@otakustay
Update package.json
fc43577
@otakustay
Add runtime to exports
f0ad608
@sizebot

sizebot commented Jan 11, 2022

Copy link
Copy Markdown

Comparing: fe905f1...f0ad608

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 129.52 kB 129.52 kB = 41.53 kB 41.53 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 134.65 kB 134.65 kB = 43.01 kB 43.01 kB
facebook-www/ReactDOM-prod.classic.js = 427.76 kB 427.76 kB = 78.53 kB 78.53 kB
facebook-www/ReactDOM-prod.modern.js = 417.45 kB 417.45 kB = 77.06 kB 77.06 kB
facebook-www/ReactDOMForked-prod.classic.js = 427.76 kB 427.76 kB = 78.53 kB 78.53 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against f0ad608

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gaearon
gaearon merged commit 2f26eb8 into react:main Jan 11, 2022
@gaearon

gaearon commented Jan 11, 2022

Copy link
Copy Markdown
Collaborator

looks good, thanks

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

facebook-github-bot pushed a commit to react/react-native that referenced this pull request Jan 19, 2022
Andrei Shikov @facebook-github-bot
React Native sync for revisions fe905f1...51947a1
0a54819
Summary:
This sync includes the following changes:
- **[51947a1](react/react@51947a14b )**: Refactored how React/DevTools log Timeline performance data ([#23102](react/react#23102)) //<Brian Vaughn>//
- **[c09596c](react/react@c09596cc6 )**: Add RN_FB bundles for react-is ([#23101](react/react#23101)) //<Moti Zilberman>//
- **[9a7e6bf](react/react@9a7e6bf0d )**: Add --no-show-signature to "git show" commands ([#23038](react/react#23038)) //<Stefan Sundin>//
- **[2f26eb8](react/react@2f26eb85d )**: Add exports field to react-refresh's package.json ([#23087](react/react#23087)) //<Gray Zhang>//
- **[8116347](react/react@811634762 )**: add enableTransitionTracing feature flag ([#23079](react/react#23079)) //<Luna Ruan>//

Changelog:
[General][Changed] - React Native sync for revisions fe905f1...51947a1

jest_e2e[run_all_tests]

Reviewed By: rickhanlonii, kacieb

Differential Revision: D33634332

fbshipit-source-id: a83b663a122a2cb79225ca33a007fe1774728c03
@gaearon gaearon mentioned this pull request Mar 29, 2022
Add React 18 changelog #24195
Merged
zhengjitf pushed a commit to zhengjitf/react that referenced this pull request Apr 15, 2022
@otakustay @zhengjitf
Add exports field to react-refresh's package.json (react#23087)
ee8f4ed
* Add exports field to react-refresh's package.json

* Update package.json

* Add runtime to exports
nevilm-lt pushed a commit to nevilm-lt/react that referenced this pull request Apr 22, 2022
@otakustay @nevilm-lt
Add exports field to react-refresh's package.json (react#23087)
5a522d0
* Add exports field to react-refresh's package.json

* Update package.json

* Add runtime to exports
mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
@otakustay
Add exports field to react-refresh's package.json (react#23087)
ee8cc57
* Add exports field to react-refresh's package.json

* Update package.json

* Add runtime to exports
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@otakustay
Add exports field to react-refresh's package.json (react#23087)
a61e21e
* Add exports field to react-refresh's package.json

* Update package.json

* Add runtime to exports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

CLA Signed

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@otakustay @facebook-github-bot @sizebot @gaearon
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.