Repository navigation
Conversation
Discovery only followed static imports, so a module a dependency loads with import() after boot, and everything it imports, was fetched and transformed one file at a time on first use. Those closures are now discovered as well and registered lazily, so the import() URL serves a shim into the bundle. A target whose closure does not build keeps per-module serving.
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx test apps-automated -c=ios |
❌ Failed | 9m 14s | View ↗ |
nx run-many --target=test --configuration=ci --... |
✅ Succeeded | <1s | View ↗ |
💡 Dealing with memory or CPU issues? See memory and CPU details with the resource usage add-on ↗.
☁️ Nx Cloud last updated this comment at 2026-10-23 23:09:33 UTC
commit: |
This branch has not been deployed
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.

PR Checklist
What is the current behavior?
Under HMR, deps-bundle discovery only follows static imports. Dynamic
import()targets inside dependency code are externalized to their/ns/m/node_modules/...URL, and unless something else imports them statically, neither they nor anything they import end up in the bundle.When a dependency lazily loads part of itself after boot (for example, when a screen is first opened), the device fetches that closure one module at a time. The dev server also transforms each of those modules on first request. In one app this blocked the JS thread for 3.8 s the first time a screen opened (~510 ms once the server's transforms were warm). The same screen opens in ~80 ms without HMR.
What is the new behavior?
import()target it externalizes.import()call itself is unchanged: it still goes to the canonical/ns/mURL. That URL now serves a shim into the bundle, so evaluation stays lazy and module identity is preserved.metafile, the same guard against esbuild 0.27 throwing outside the build promise that is used elsewhere.In the app above, the first visit now takes 116 ms with a fresh dev server. Building the bundle took 9.4 s instead of 7.9 s.
Tests:
deps-bundle.spec.tscovers a chainedimport()(target, its static import, and its own dynamic import are all registered), and a target with an unresolvable closure that stays per-module next to one that bundles. TwocreateDepsBundleServicetests (opaque CJS / react-like shims) fail onmainwithout this change too, on Windows.