Skip to content

Remove macros in favor of import.meta.env?.DEV#21115

Open
NullVoxPopuli wants to merge 17 commits intomainfrom
nvp/no-more-macros
Open

Remove macros in favor of import.meta.env?.DEV#21115
NullVoxPopuli wants to merge 17 commits intomainfrom
nvp/no-more-macros

Conversation

@NullVoxPopuli
Copy link
Contributor

@NullVoxPopuli NullVoxPopuli commented Feb 24, 2026

This does mean that ember-auto-import will need an import.meta.env plugin

observations:

  • dev build is bigger
  • prod build is as expected

see: #21113

@github-actions
Copy link
Contributor

github-actions bot commented Feb 24, 2026

Estimated Asset Sizes

Diff

--- main/out.txt	2026-02-17 19:37:18.000000000 +0000
+++ pr/./pr-22431053390/out.txt	2026-02-26 06:45:14.000000000 +0000
@@ -1,62 +1,62 @@
 ╔═══════╤═══════════╤═══════════╗
 ║       │ Min       │ Gzip      ║
 ╟───────┼───────────┼───────────╢
-║ Total │ 351.99 KB │ 203.84 KB ║
+║ Total │ 432.13 KB │ 245.65 KB ║
 ╚═══════╧═══════════╧═══════════╝
 
 ╔══════════════════════╤═══════════╤═══════════╗
 ║ @ember/*             │ Min       │ Gzip      ║
 ╟──────────────────────┼───────────┼───────────╢
-║ Total                │ 313.39 KB │ 181.91 KB ║
+║ Total                │ 374.14 KB │ 212.81 KB ║
 ╟──────────────────────┼───────────┼───────────╢
-║ -internals           │ 36.65 KB  │ 26.22 KB  ║
-║ application          │ 13.23 KB  │ 8.05 KB   ║
-║ array                │ 13.01 KB  │ 7.46 KB   ║
-║ canary-features      │ 304 B     │ 389 B     ║
-║ component            │ 2.05 KB   │ 1.64 KB   ║
-║ controller           │ 1.96 KB   │ 1.41 KB   ║
-║ debug                │ 11.69 KB  │ 8.12 KB   ║
+║ -internals           │ 56.85 KB  │ 36.62 KB  ║
+║ application          │ 15.84 KB  │ 9.12 KB   ║
+║ array                │ 15.18 KB  │ 8.53 KB   ║
+║ canary-features      │ 298 B     │ 386 B     ║
+║ component            │ 2.06 KB   │ 1.57 KB   ║
+║ controller           │ 1.96 KB   │ 1.42 KB   ║
+║ debug                │ 17.18 KB  │ 11.49 KB  ║
 ║ deprecated-features  │ 31 B      │ 77 B      ║
 ║ destroyable          │ 561 B     │ 383 B     ║
 ║ enumerable           │ 259 B     │ 387 B     ║
-║ helper               │ 1.08 KB   │ 811 B     ║
-║ instrumentation      │ 2.43 KB   │ 1.79 KB   ║
-║ modifier             │ 1.22 KB   │ 965 B     ║
-║ object               │ 35.94 KB  │ 22.16 KB  ║
+║ helper               │ 1.08 KB   │ 838 B     ║
+║ instrumentation      │ 2.46 KB   │ 1.77 KB   ║
+║ modifier             │ 1.24 KB   │ 935 B     ║
+║ object               │ 51.62 KB  │ 28.78 KB  ║
 ║ owner                │ 159 B     │ 178 B     ║
-║ renderer             │ 630 B     │ 487 B     ║
-║ routing              │ 59.3 KB   │ 34.12 KB  ║
-║ runloop              │ 2.36 KB   │ 1.5 KB    ║
-║ service              │ 1 KB      │ 845 B     ║
-║ template             │ 654 B     │ 541 B     ║
-║ template-compilation │ 429 B     │ 366 B     ║
-║ template-compiler    │ 123.08 KB │ 59.45 KB  ║
-║ template-factory     │ 370 B     │ 374 B     ║
+║ renderer             │ 622 B     │ 510 B     ║
+║ routing              │ 70.86 KB  │ 40.3 KB   ║
+║ runloop              │ 2.7 KB    │ 1.66 KB   ║
+║ service              │ 1 KB      │ 850 B     ║
+║ template             │ 646 B     │ 522 B     ║
+║ template-compilation │ 640 B     │ 540 B     ║
+║ template-compiler    │ 125.23 KB │ 61.2 KB   ║
+║ template-factory     │ 370 B     │ 369 B     ║
 ║ test                 │ 923 B     │ 627 B     ║
-║ utils                │ 4.11 KB   │ 3.6 KB    ║
+║ utils                │ 4.42 KB   │ 3.78 KB   ║
 ║ version              │ 55 B      │ 131 B     ║
 ╚══════════════════════╧═══════════╧═══════════╝
 
 ╔═════════════════╤══════════╤══════════╗
 ║ @glimmer/*      │ Min      │ Gzip     ║
 ╟─────────────────┼──────────┼──────────╢
-║ Total           │ 38.6 KB  │ 21.94 KB ║
+║ Total           │ 57.98 KB │ 32.84 KB ║
 ╟─────────────────┼──────────┼──────────╢
-║ destroyable     │ 2.77 KB  │ 1.39 KB  ║
-║ encoder         │ 81 B     │ 171 B    ║
+║ destroyable     │ 4.66 KB  │ 2.29 KB  ║
+║ encoder         │ 740 B    │ 791 B    ║
 ║ env             │ 38 B     │ 87 B     ║
-║ global-context  │ 886 B    │ 545 B    ║
-║ manager         │ 977 B    │ 608 B    ║
-║ node            │ 175 B    │ 260 B    ║
-║ opcode-compiler │ 1.11 KB  │ 894 B    ║
+║ global-context  │ 2.23 KB  │ 1.22 KB  ║
+║ manager         │ 6.5 KB   │ 3.29 KB  ║
+║ node            │ 1.05 KB  │ 881 B    ║
+║ opcode-compiler │ 1.11 KB  │ 929 B    ║
 ║ owner           │ 159 B    │ 202 B    ║
-║ program         │ 252 B    │ 301 B    ║
-║ reference       │ 548 B    │ 531 B    ║
-║ runtime         │ 10.32 KB │ 5.32 KB  ║
-║ tracking        │ 1.34 KB  │ 1.16 KB  ║
-║ util            │ 1.94 KB  │ 1.68 KB  ║
-║ validator       │ 15.75 KB │ 6.96 KB  ║
-║ vm              │ 495 B    │ 569 B    ║
+║ program         │ 367 B    │ 324 B    ║
+║ reference       │ 3.51 KB  │ 2.42 KB  ║
+║ runtime         │ 10.32 KB │ 5.2 KB   ║
+║ tracking        │ 2.11 KB  │ 1.8 KB   ║
+║ util            │ 1.94 KB  │ 1.71 KB  ║
+║ validator       │ 20.95 KB │ 9.85 KB  ║
+║ vm              │ 495 B    │ 575 B    ║
 ║ wire-format     │ 1.84 KB  │ 1.35 KB  ║
 ╚═════════════════╧══════════╧══════════╝
 

Details

This PRmain
╔═══════╤═══════════╤═══════════╗
║       │ Min       │ Gzip      ║
╟───────┼───────────┼───────────╢
║ Total │ 432.13 KB │ 245.65 KB ║
╚═══════╧═══════════╧═══════════╝

╔══════════════════════╤═══════════╤═══════════╗
║ @ember/*             │ Min       │ Gzip      ║
╟──────────────────────┼───────────┼───────────╢
║ Total                │ 374.14 KB │ 212.81 KB ║
╟──────────────────────┼───────────┼───────────╢
║ -internals           │ 56.85 KB  │ 36.62 KB  ║
║ application          │ 15.84 KB  │ 9.12 KB   ║
║ array                │ 15.18 KB  │ 8.53 KB   ║
║ canary-features      │ 298 B     │ 386 B     ║
║ component            │ 2.06 KB   │ 1.57 KB   ║
║ controller           │ 1.96 KB   │ 1.42 KB   ║
║ debug                │ 17.18 KB  │ 11.49 KB  ║
║ deprecated-features  │ 31 B      │ 77 B      ║
║ destroyable          │ 561 B     │ 383 B     ║
║ enumerable           │ 259 B     │ 387 B     ║
║ helper               │ 1.08 KB   │ 838 B     ║
║ instrumentation      │ 2.46 KB   │ 1.77 KB   ║
║ modifier             │ 1.24 KB   │ 935 B     ║
║ object               │ 51.62 KB  │ 28.78 KB  ║
║ owner                │ 159 B     │ 178 B     ║
║ renderer             │ 622 B     │ 510 B     ║
║ routing              │ 70.86 KB  │ 40.3 KB   ║
║ runloop              │ 2.7 KB    │ 1.66 KB   ║
║ service              │ 1 KB      │ 850 B     ║
║ template             │ 646 B     │ 522 B     ║
║ template-compilation │ 640 B     │ 540 B     ║
║ template-compiler    │ 125.23 KB │ 61.2 KB   ║
║ template-factory     │ 370 B     │ 369 B     ║
║ test                 │ 923 B     │ 627 B     ║
║ utils                │ 4.42 KB   │ 3.78 KB   ║
║ version              │ 55 B      │ 131 B     ║
╚══════════════════════╧═══════════╧═══════════╝

╔═════════════════╤══════════╤══════════╗
║ @glimmer/*      │ Min      │ Gzip     ║
╟─────────────────┼──────────┼──────────╢
║ Total           │ 57.98 KB │ 32.84 KB ║
╟─────────────────┼──────────┼──────────╢
║ destroyable     │ 4.66 KB  │ 2.29 KB  ║
║ encoder         │ 740 B    │ 791 B    ║
║ env             │ 38 B     │ 87 B     ║
║ global-context  │ 2.23 KB  │ 1.22 KB  ║
║ manager         │ 6.5 KB   │ 3.29 KB  ║
║ node            │ 1.05 KB  │ 881 B    ║
║ opcode-compiler │ 1.11 KB  │ 929 B    ║
║ owner           │ 159 B    │ 202 B    ║
║ program         │ 367 B    │ 324 B    ║
║ reference       │ 3.51 KB  │ 2.42 KB  ║
║ runtime         │ 10.32 KB │ 5.2 KB   ║
║ tracking        │ 2.11 KB  │ 1.8 KB   ║
║ util            │ 1.94 KB  │ 1.71 KB  ║
║ validator       │ 20.95 KB │ 9.85 KB  ║
║ vm              │ 495 B    │ 575 B    ║
║ wire-format     │ 1.84 KB  │ 1.35 KB  ║
╚═════════════════╧══════════╧══════════╝
╔═══════╤═══════════╤═══════════╗
║       │ Min       │ Gzip      ║
╟───────┼───────────┼───────────╢
║ Total │ 351.99 KB │ 203.84 KB ║
╚═══════╧═══════════╧═══════════╝

╔══════════════════════╤═══════════╤═══════════╗
║ @ember/*             │ Min       │ Gzip      ║
╟──────────────────────┼───────────┼───────────╢
║ Total                │ 313.39 KB │ 181.91 KB ║
╟──────────────────────┼───────────┼───────────╢
║ -internals           │ 36.65 KB  │ 26.22 KB  ║
║ application          │ 13.23 KB  │ 8.05 KB   ║
║ array                │ 13.01 KB  │ 7.46 KB   ║
║ canary-features      │ 304 B     │ 389 B     ║
║ component            │ 2.05 KB   │ 1.64 KB   ║
║ controller           │ 1.96 KB   │ 1.41 KB   ║
║ debug                │ 11.69 KB  │ 8.12 KB   ║
║ deprecated-features  │ 31 B      │ 77 B      ║
║ destroyable          │ 561 B     │ 383 B     ║
║ enumerable           │ 259 B     │ 387 B     ║
║ helper               │ 1.08 KB   │ 811 B     ║
║ instrumentation      │ 2.43 KB   │ 1.79 KB   ║
║ modifier             │ 1.22 KB   │ 965 B     ║
║ object               │ 35.94 KB  │ 22.16 KB  ║
║ owner                │ 159 B     │ 178 B     ║
║ renderer             │ 630 B     │ 487 B     ║
║ routing              │ 59.3 KB   │ 34.12 KB  ║
║ runloop              │ 2.36 KB   │ 1.5 KB    ║
║ service              │ 1 KB      │ 845 B     ║
║ template             │ 654 B     │ 541 B     ║
║ template-compilation │ 429 B     │ 366 B     ║
║ template-compiler    │ 123.08 KB │ 59.45 KB  ║
║ template-factory     │ 370 B     │ 374 B     ║
║ test                 │ 923 B     │ 627 B     ║
║ utils                │ 4.11 KB   │ 3.6 KB    ║
║ version              │ 55 B      │ 131 B     ║
╚══════════════════════╧═══════════╧═══════════╝

╔═════════════════╤══════════╤══════════╗
║ @glimmer/*      │ Min      │ Gzip     ║
╟─────────────────┼──────────┼──────────╢
║ Total           │ 38.6 KB  │ 21.94 KB ║
╟─────────────────┼──────────┼──────────╢
║ destroyable     │ 2.77 KB  │ 1.39 KB  ║
║ encoder         │ 81 B     │ 171 B    ║
║ env             │ 38 B     │ 87 B     ║
║ global-context  │ 886 B    │ 545 B    ║
║ manager         │ 977 B    │ 608 B    ║
║ node            │ 175 B    │ 260 B    ║
║ opcode-compiler │ 1.11 KB  │ 894 B    ║
║ owner           │ 159 B    │ 202 B    ║
║ program         │ 252 B    │ 301 B    ║
║ reference       │ 548 B    │ 531 B    ║
║ runtime         │ 10.32 KB │ 5.32 KB  ║
║ tracking        │ 1.34 KB  │ 1.16 KB  ║
║ util            │ 1.94 KB  │ 1.68 KB  ║
║ validator       │ 15.75 KB │ 6.96 KB  ║
║ vm              │ 495 B    │ 569 B    ║
║ wire-format     │ 1.84 KB  │ 1.35 KB  ║
╚═════════════════╧══════════╧══════════╝

This will require a dev environment to enable (or manually setting
import.meta.env.DEV = true.
Otherwise prod behavior will be received.
@NullVoxPopuli
Copy link
Contributor Author

@copilot -- why are the firefox tests failing? https://github.com/emberjs/ember.js/actions/runs/22373598336/job/64760184334?pr=21115

Copy link
Contributor

Copilot AI commented Feb 25, 2026

@NullVoxPopuli I've opened a new pull request, #21116, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 3 commits February 25, 2026 20:28
…or in Firefox

Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
…o vite.config.mjs

Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Fix Firefox test build: add `import.meta.env?.DEV` replacement plugin to vite.config.mjs
@NullVoxPopuli
Copy link
Contributor Author

@copilot -- why is the "perf script still works" job failing? it runs on macos locally -- logs here: https://github.com/emberjs/ember.js/actions/runs/22418787765/job/64911265511?pr=21115

Copy link
Contributor

Copilot AI commented Feb 25, 2026

@NullVoxPopuli I've opened a new pull request, #21117, to work on those changes. Once the pull request is ready, I'll request review from you.

@NullVoxPopuli
Copy link
Contributor Author

@copilot fix the embroiderVite-basics scenario -- logs and commands available here : https://github.com/emberjs/ember.js/actions/runs/22418787765/job/64911509835?pr=21115

Copy link
Contributor

Copilot AI commented Feb 26, 2026

@NullVoxPopuli I've opened a new pull request, #21118, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 3 commits February 26, 2026 00:28
When building with `vite build --mode test`, import.meta.env.DEV is false,
so COMPUTED_GETTERS (a WeakSet) is never initialized. The assert() call in
makeComputedDecorator was unconditionally evaluating COMPUTED_GETTERS.has(),
causing TypeError: Cannot read properties of undefined (reading 'has').

Guard the .has() call with `import.meta.env?.DEV &&` so it short-circuits
before accessing the undefined WeakSet in production/test builds.

Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Fix embroiderVite-basics: guard COMPUTED_GETTERS.has() with DEV check
@NullVoxPopuli
Copy link
Contributor Author

@copilot fix whatever went wrong https://github.com/emberjs/ember.js/actions/runs/22427276534/job/64938112498?pr=21115 use browser devtools to debug.

Copy link
Contributor

Copilot AI commented Feb 26, 2026

@NullVoxPopuli I've opened a new pull request, #21120, to work on those changes. Once the pull request is ready, I'll request review from you.

… incorrect string replacements

Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Fix assert conditions and incorrect string replacements from import.meta.env?.DEV migration
@NullVoxPopuli NullVoxPopuli marked this pull request as ready for review February 26, 2026 06:32
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