Skip to content

Babel TC39 2023-05 decorators for hoist-react v85#66

Open
lbwexler wants to merge 2 commits intodevelopfrom
tc39-decorators
Open

Babel TC39 2023-05 decorators for hoist-react v85#66
lbwexler wants to merge 2 commits intodevelopfrom
tc39-decorators

Conversation

@lbwexler
Copy link
Copy Markdown
Member

@lbwexler lbwexler commented Apr 15, 2026

Summary

  • Flip @babel/plugin-proposal-decorators from {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).
  • Enable @babel/plugin-transform-class-static-block via preset-env include — the 2023-05 decorator plugin outputs static { ... } blocks that require this transform.
  • Bump to 14.0.0-SNAPSHOT. Requires coordinated release with hoist-react >= 85.0.

Breaking change

Apps must upgrade @xh/hoist-dev-utils and @xh/hoist together. A legacy-decorator app built with this dev-utils (or vice-versa) will silently break all @observable / @bindable fields. See the v85 upgrade notes in hoist-react for consumer-side steps.

Test plan

  • Verified against local hoist-react tc39-decorators branch + toolbox tc39-decorators branch — full webpack build + dev server compile clean, app runs.

🤖 Generated with Claude Code

lbwexler and others added 2 commits April 15, 2026 15:30
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>
@lbwexler lbwexler requested review from amcclain and haynesjm42 April 15, 2026 21:54
@lbwexler lbwexler marked this pull request as ready for review April 17, 2026 00:50
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.

1 participant