-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[build] Refactor: move error-codes generation to existing babel plugin #6005
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
facebook-github-bot
added
the
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
label
May 2, 2024
etrepum
force-pushed
the
extract-errors-fix
branch
from
May 2, 2024 05:51
d2a1472
to
a9b91aa
Compare
etrepum
force-pushed
the
extract-errors-fix
branch
from
May 2, 2024 15:37
a9b91aa
to
b5338b9
Compare
etrepum
force-pushed
the
extract-errors-fix
branch
from
May 2, 2024 18:24
b5338b9
to
42d5c70
Compare
etrepum
force-pushed
the
extract-errors-fix
branch
from
May 2, 2024 19:24
42d5c70
to
72d8acb
Compare
etrepum
requested review from
zurfyx,
fantactuka,
acywatson,
Fetz and
ivailop7
as code owners
May 2, 2024 19:29
…abel plugin and always run with build-release
etrepum
force-pushed
the
extract-errors-fix
branch
from
May 3, 2024 15:57
72d8acb
to
9252553
Compare
@ivailop7 this one would be nice to have in the release as well, especially if there is some issue running extract-codes without it |
@etrepum do you need to rebase this one before we merge? |
I don't see any conflicts flagged by github here... |
acywatson
approved these changes
May 10, 2024
ivailop7
approved these changes
May 10, 2024
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.
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.
Description
Previously we had a rollup plugin and separate a babel plugin for managing error codes, which are a map of sequential integers to error message strings that are used in minified prod builds so that we are not shipping verbose error message strings.
Both plugins essentially did the same work, but the updating of the map was only done in the rollup plugin. This consolidates all of the functionality to the babel plugin which is now able to conditionally update the error map if the
--codes
argument was present.This PR also updates the postversion script to ensure that codes are generated before a release and ensures that the versions and package-lock.json are updated accordingly.
Code extraction is now integrated into
npm run build-release
(which is a dependency ofnpm run prepare-release
andnpm run release
) as a failsafe to ensure codes are updated before release.I chose not to update the filename for codes.json in this PR. I think we can do that separately in a follow-up to address the concern that the filename should let people know that it is generated. I think we should do a release with this first before changing too many more things.
Test plan
Before
npm run error-codes
was supposedly in a state where it no longer worked (re #5996)It was also easy to forget to do this before creating a release, which would leave error messages unextracted (larger prod build).
After
npm run increment-version
andnpm run build-release
(and anything downstream such asnpm run prepare-release
ornpm run release
) will generate the scripts/error-codes/codes.json file.The new unit tests should also pass!