Babel TC39 2023-05 decorators for hoist-react v85#66
Open
Babel TC39 2023-05 decorators for hoist-react v85#66
Conversation
Flips `@babel/plugin-proposal-decorators` from `{version: 'legacy'}` to `{version: '2023-05'}` in support of hoist-react's migration to TC39 Stage 3 modern decorators (xh/hoist-react#4321). Bumps to 14.0.0-SNAPSHOT; requires coordinated upgrade with hoist-react >= 85.0 and the app-side codemod described in the v85 upgrade notes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Babel 2023-05 decorators plugin compiles `@observable accessor foo = 0` fields into class definitions that use `static { ... }` class blocks. Those blocks need `@babel/plugin-transform-class-static-block` enabled in preset-env. Adding it to the `include` list ensures consistent behavior across all target-browser configurations — the plugin is bundled with preset-env, so no new dependency is required.
Without this fix, webpack compilation fails against migrated hoist-react v85 code with errors like "Static class blocks are not enabled."
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
@babel/plugin-proposal-decoratorsfrom{version: 'legacy'}to{version: '2023-05'}to align with hoist-react v85's migration to TC39 Stage 3 modern decorators (Migrate to TC39 Modern Decorators hoist-react#4321).@babel/plugin-transform-class-static-blockvia preset-envinclude— the 2023-05 decorator plugin outputsstatic { ... }blocks that require this transform.14.0.0-SNAPSHOT. Requires coordinated release withhoist-react >= 85.0.Breaking change
Apps must upgrade
@xh/hoist-dev-utilsand@xh/hoisttogether. A legacy-decorator app built with this dev-utils (or vice-versa) will silently break all@observable/@bindablefields. See the v85 upgrade notes in hoist-react for consumer-side steps.Test plan
tc39-decoratorsbranch + toolboxtc39-decoratorsbranch — full webpack build + dev server compile clean, app runs.🤖 Generated with Claude Code