Skip to content

lazily shim live-test dependencies#4252

Open
tintinthong wants to merge 1 commit intomainfrom
lazily-shim-modules
Open

lazily shim live-test dependencies#4252
tintinthong wants to merge 1 commit intomainfrom
lazily-shim-modules

Conversation

@tintinthong
Copy link
Contributor

No description provided.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a03a27bd73

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +118 to +121
virtualNetwork.shimModule('@ember/object', emberObject);
virtualNetwork.shimModule('@ember/object/internals', emberObjectInternals);
virtualNetwork.shimModule('@ember/helper', emberHelper);
virtualNetwork.shimModule('@ember/modifier', emberModifier);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore @ember/service virtual-network shim

shimExternals() no longer registers @ember/service, so any module that is loaded through this VirtualNetwork and imports @ember/service will now fail module resolution at import time. This is a behavior regression from the previous implementation, where the Ember service module was always shimmed, and it can break realm code paths that rely on service decorators/injection when evaluated via loader.import(...).

Useful? React with 👍 / 👎.

Comment on lines +166 to 167
virtualNetwork.shimModule('awesome-phonenumber', awesomePhoneNumber);
shimHostCommands(virtualNetwork);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reintroduce host store compatibility shim

The fallback shim for @cardstack/host/services/store was removed, which means realm modules evaluated outside the full host build can no longer safely resolve that host-only specifier. In environments like code-mode/card rendering (where this shim layer is meant to prevent host-only imports from crashing), those imports now become hard resolution failures instead of the previous safe no-op class.

Useful? React with 👍 / 👎.

@github-actions
Copy link

Preview deployments

@github-actions
Copy link

Host Test Results

    1 files  ±0      1 suites  ±0   2h 12m 17s ⏱️ + 1m 50s
2 051 tests ±0  2 035 ✅  - 1  15 💤 ±0  0 ❌ ±0  1 🔥 +1 
2 066 runs  ±0  2 049 ✅  - 2  15 💤 ±0  1 ❌ +1  1 🔥 +1 

For more details on these errors, see this check.

Results for commit a03a27b. ± Comparison against base commit 724fc8b.

Comment on lines +201 to +204
virtualNetwork.shimAsyncModule({
id: '@ember/test-helpers',
resolve: () => import('@ember/test-helpers'),
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is async, but this function is not. are you gonna have a race condition where you are expecting these modules to be available and they are not?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the host’s VirtualNetwork externals shimming to avoid eagerly pulling live-test-only dependencies into normal app startup, while still supporting live-test runs.

Changes:

  • Make live-test shims conditional on ?liveTest and lazily load @ember/test-helpers via shimAsyncModule().
  • Centralize QUnit + test-helper shims into shimModulesForLiveTests() and call it early from shimExternals().
  • Reorder/reshape a number of shimModule() registrations in shimExternals().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +114 to +121
virtualNetwork.shimModule('ember-css-url', cssUrl);
virtualNetwork.shimModule('@ember/template-factory', emberTemplateFactory);
virtualNetwork.shimModule('@ember/template', emberTemplate);
virtualNetwork.shimModule('@glimmer/tracking', glimmerTracking);
virtualNetwork.shimModule('@ember/object', emberObject);
virtualNetwork.shimModule('@ember/object/internals', emberObjectInternals);
virtualNetwork.shimModule('@ember/helper', emberHelper);
virtualNetwork.shimModule('@ember/modifier', emberModifier);
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shimExternals() no longer shims @ember/service. Because the VirtualNetwork resolves bare specifiers to https://packages/... and there is no import-map entry for @ember/service, any realm module that imports @ember/service will now fail to load. If realms are expected to be able to use Ember services, please re-add the @ember/service import + virtualNetwork.shimModule('@ember/service', …) (or document/guarantee that realm code must not import it).

Copilot uses AI. Check for mistakes.
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.

3 participants