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

Fix LOG_VERSIONS and restore test suite coverage of real class field semantics #20867

Merged
merged 1 commit into from
Mar 8, 2025

Conversation

ef4
Copy link
Contributor

@ef4 ef4 commented Mar 7, 2025

Ember's debug logging of its own version was accidentally broken since 5.10 when we reformed the build.

The problem was:

  • we switched to typescript's more spec-compliant class field semantics, where fields without declare are in fact present as real class fields with an undefined initializer.
  • our test suite was accidentally getting processed by vite's default (and pretty broken!) esbuild TS loader, which uses the loose & wrong field semantics.
  • logVersions in class Libraries is written in a picky way that breaks if you get the spec-compliant field semantics.

This PR disables vite's built-in esbuild, which revealed the bug.

The change to logVersions is the only real user-facing bugfix. There were also some similar bugs in the test suite itself which are fixed here.

(All of this was precipated by me working on stable decorators, which also requires disabling vite's hidden-and-terrible TS support.)

@ef4 ef4 changed the title Fix LOG_VERSIONS Fix LOG_VERSIONS and restore test suite coverage of real class field semantics Mar 7, 2025
Ember's debug logging of its own version was accidentally broken since 5.10 when we reformed the build.

The problem was:
 - we switched to typescript's more spec-compliant class field semantics, where fields without `declare` are in fact present as real class fields with an undefined initializer.
 - our test suite was accidentally getting processed by vite's default (and pretty broken!) esbuild TS loader, which uses the loose & wrong field semantics.
 - `logVersions` in `class Libraries` is written in a picky way that breaks if you get the spec-compliant field semantics.

This PR disables vite's built-in esbuild, which revealed the bug.

The change to logVersions is the only real user-facing bugfix. There were also some similar bugs in the test suite itself which are fixed here.

(All of this was precipated by me working on stable decorators, which *also* requires disabling vite's hidden-and-terrible TS support.)
@ef4 ef4 force-pushed the fix-class-field-tests branch from d111db3 to fc11632 Compare March 7, 2025 18:37
@ef4 ef4 merged commit ae12539 into main Mar 8, 2025
27 checks passed
@ef4 ef4 deleted the fix-class-field-tests branch March 8, 2025 14:52
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.

2 participants