Repository navigation
fix: resolve import() of self-accepting modules to their latest evaluation - #16595
Conversation
…their latest evaluation
📦 Binary Size-limit
🙈 Size remains the same at 68.82MB |
Rsdoctor Bundle Diff Analysis
Found 5 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
Merging this PR will not alter performance
Comparing Footnotes
|
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Motivation
With lazy compilation on,
import()of a module that accepts its own hot updates keeps returning the exports from its first evaluation. The module is re-evaluated on every edit and the page does not reload, so the stale value is silent.load()logsv2, as it does withlazyCompilation: falseload()logsv1This hits tools that add a self-accept to component modules, such as solid-refresh.
Closes #16594
Changes
A lazily compiled module is imported through a proxy module. The proxy exported one promise, created when the proxy first ran, and only replaced it when a hot update reached the proxy. An update that a module accepts itself stops at that module, so the proxy kept the old promise.
The proxy now exports a thenable that loads the inner module on every
import(), so each call reads the current module instance.