Skip to content

test(dev): add hot API test cases#10181

Merged
graphite-app[bot] merged 1 commit into
mainfrom
07-07-test_dev_add_hot_api_test_cases
Jul 15, 2026
Merged

test(dev): add hot API test cases#10181
graphite-app[bot] merged 1 commit into
mainfrom
07-07-test_dev_add_hot_api_test_cases

Conversation

@h-a-n-a

@h-a-n-a h-a-n-a commented Jul 7, 2026

Copy link
Copy Markdown
Member

Summary

For full design and principles, please refer to #10164 (comment).

The playgrounds

Each playground is a small app (index.html + JS modules + dev.config.mjs + package.json) with a __tests__/*.spec.ts that edits a file and asserts on the running page. Several port behavior expectations from Vite's HMR tests (the hmr-hot-off fixture says so explicitly).

Group Playgrounds What they exercise
Accept hmr-accept-exports, hmr-nested-dep-accept hot.accept receiving new exports; accepting a dep deeper in the graph
Circular graphs hmr-circular-accept-outside, hmr-circular-self-accept, hmr-invalidate-circular accept / self-accept / hot.invalidate when the edited module sits in an import cycle
Lifecycle / state hmr-dispose-data, hmr-prune hot.dispose passing state through hot.data; hot.prune when a module is no longer imported
Events hmr-hot-events, hmr-hot-off hot.on for built-in vite:beforeUpdate / vite:afterUpdate; hot.off removing one listener while another stays
Dynamic import + lazy compilation hmr-lazy-dynamic-import-accept-dep, hmr-lazy-dynamic-import-self-accept, hmr-not-loaded-dynamic-import updates to dynamically imported modules, including under lazy compilation and when the module was never loaded
Full reload hmr-before-full-reload behavior around an update that must fall back to a full page reload

h-a-n-a commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

How to use the Graphite Merge Queue

Add the label graphite: merge-when-ready to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@h-a-n-a
h-a-n-a force-pushed the 07-07-test_dev_add_hot_api_test_cases branch from 4135730 to 66bb29d Compare July 7, 2026 14:30
@h-a-n-a
h-a-n-a force-pushed the 07-07-feat_dev_client-side_hmr branch 2 times, most recently from f0e9ee0 to b6258d8 Compare July 8, 2026 02:40
@h-a-n-a
h-a-n-a force-pushed the 07-07-test_dev_add_hot_api_test_cases branch from 882c6f7 to 400bef3 Compare July 8, 2026 02:40
@h-a-n-a
h-a-n-a changed the base branch from 07-07-feat_dev_client-side_hmr to graphite-base/10181 July 8, 2026 05:25
@h-a-n-a
h-a-n-a force-pushed the 07-07-test_dev_add_hot_api_test_cases branch from 400bef3 to 6a208a3 Compare July 8, 2026 06:04
@h-a-n-a
h-a-n-a force-pushed the graphite-base/10181 branch from b6258d8 to 069e292 Compare July 8, 2026 06:04
@h-a-n-a
h-a-n-a changed the base branch from graphite-base/10181 to 07-07-feat_dev_client-side_hmr July 8, 2026 06:04
@h-a-n-a
h-a-n-a force-pushed the 07-07-test_dev_add_hot_api_test_cases branch from 6a208a3 to 388f977 Compare July 8, 2026 15:58
@h-a-n-a
h-a-n-a force-pushed the 07-07-feat_dev_client-side_hmr branch from 069e292 to 25f8b87 Compare July 8, 2026 15:58
@h-a-n-a
h-a-n-a force-pushed the 07-07-test_dev_add_hot_api_test_cases branch from 388f977 to d2be5d9 Compare July 8, 2026 16:10
@h-a-n-a
h-a-n-a force-pushed the 07-07-feat_dev_client-side_hmr branch from 25f8b87 to 8e44792 Compare July 8, 2026 16:10
@h-a-n-a
h-a-n-a force-pushed the 07-07-test_dev_add_hot_api_test_cases branch from 46ff2f5 to d1236b2 Compare July 9, 2026 09:24
@h-a-n-a
h-a-n-a force-pushed the 07-07-feat_dev_client-side_hmr branch from dbaa9df to 0cb9954 Compare July 9, 2026 09:24
@h-a-n-a
h-a-n-a changed the base branch from 07-07-feat_dev_client-side_hmr to graphite-base/10181 July 9, 2026 11:19
@h-a-n-a
h-a-n-a force-pushed the 07-07-test_dev_add_hot_api_test_cases branch from d1236b2 to 1d8f759 Compare July 9, 2026 11:19
@h-a-n-a
h-a-n-a changed the base branch from graphite-base/10181 to 07-09-refactor_dev_move_full-reload_to_client_side July 9, 2026 11:19
@h-a-n-a
h-a-n-a force-pushed the 07-09-refactor_dev_move_full-reload_to_client_side branch from a5cca16 to e326387 Compare July 9, 2026 12:14
@h-a-n-a
h-a-n-a force-pushed the 07-07-test_dev_add_hot_api_test_cases branch from 1d8f759 to dd21d7e Compare July 9, 2026 12:14
@h-a-n-a
h-a-n-a force-pushed the 07-07-test_dev_add_hot_api_test_cases branch from dd21d7e to 81faf6a Compare July 9, 2026 14:29
@h-a-n-a
h-a-n-a force-pushed the 07-09-refactor_dev_move_full-reload_to_client_side branch 2 times, most recently from 538863f to 37e3584 Compare July 9, 2026 14:57
@h-a-n-a
h-a-n-a force-pushed the 07-07-test_dev_add_hot_api_test_cases branch from 81faf6a to 119c215 Compare July 9, 2026 14:57
@h-a-n-a
h-a-n-a force-pushed the 07-09-refactor_dev_move_full-reload_to_client_side branch from 37e3584 to 01f91d8 Compare July 9, 2026 16:51
@h-a-n-a
h-a-n-a force-pushed the 07-07-test_dev_add_hot_api_test_cases branch 2 times, most recently from b30905c to 511668d Compare July 10, 2026 04:44
@h-a-n-a
h-a-n-a force-pushed the 07-10-feat_dev_skip_shipping_factories_for_newly_imported_top-level_modules branch from 24af7ca to 96e7872 Compare July 15, 2026 04:08
@h-a-n-a
h-a-n-a force-pushed the 07-07-test_dev_add_hot_api_test_cases branch 2 times, most recently from df875eb to fc95531 Compare July 15, 2026 05:01
@h-a-n-a
h-a-n-a force-pushed the 07-10-feat_dev_skip_shipping_factories_for_newly_imported_top-level_modules branch 2 times, most recently from 7b64a5c to d983037 Compare July 15, 2026 06:17
@h-a-n-a
h-a-n-a force-pushed the 07-07-test_dev_add_hot_api_test_cases branch from fc95531 to 4bb6915 Compare July 15, 2026 06:17
@h-a-n-a
h-a-n-a force-pushed the 07-10-feat_dev_skip_shipping_factories_for_newly_imported_top-level_modules branch from d983037 to a99ebc1 Compare July 15, 2026 06:41
@h-a-n-a
h-a-n-a force-pushed the 07-07-test_dev_add_hot_api_test_cases branch from 4bb6915 to 14f9582 Compare July 15, 2026 06:41
@h-a-n-a
h-a-n-a force-pushed the 07-10-feat_dev_skip_shipping_factories_for_newly_imported_top-level_modules branch from a99ebc1 to a34f8df Compare July 15, 2026 07:13
@h-a-n-a
h-a-n-a force-pushed the 07-07-test_dev_add_hot_api_test_cases branch from 14f9582 to 0fe85ef Compare July 15, 2026 07:13
@graphite-app

graphite-app Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Merge activity

  • Jul 15, 7:25 AM UTC: h-a-n-a added this pull request to the Graphite merge queue.
  • Jul 15, 7:31 AM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #10207.
  • Jul 15, 7:31 AM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #10207.
  • Jul 15, 7:31 AM UTC: The merge label 'graphite: merge-when-ready' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jul 15, 7:31 AM UTC: The merge label 'graphite: merge-when-ready' was removed. This PR will no longer be merged by the Graphite merge queue
  • Jul 15, 7:58 AM UTC: The merge label 'graphite: merge-when-ready' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jul 15, 7:59 AM UTC: shulaoda added this pull request to the Graphite merge queue.
  • Jul 15, 8:15 AM UTC: The Graphite merge queue couldn't merge this PR because it had merge conflicts.
  • Jul 15, 8:18 AM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.
  • Jul 15, 8:21 AM UTC: h-a-n-a added this pull request to the Graphite merge queue.
  • Jul 15, 8:28 AM UTC: Merged by the Graphite merge queue.

@graphite-app
graphite-app Bot changed the base branch from 07-10-feat_dev_skip_shipping_factories_for_newly_imported_top-level_modules to graphite-base/10181 July 15, 2026 07:38
@graphite-app
graphite-app Bot changed the base branch from graphite-base/10181 to main July 15, 2026 08:14
@graphite-app
graphite-app Bot requested a review from IWANABETHATGUY as a code owner July 15, 2026 08:14
@h-a-n-a
h-a-n-a force-pushed the 07-07-test_dev_add_hot_api_test_cases branch from 0fe85ef to 6a4e249 Compare July 15, 2026 08:17
@netlify

netlify Bot commented Jul 15, 2026

Copy link
Copy Markdown

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit f26ce7a
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6a574387dbadfd0008879739

<!--
- What is this PR solving? Write a clear and concise description.
- Reference the issues it solves (e.g. `fixes #123`).
- What other alternatives have you explored?
- Are there any parts you think require more attention from reviewers?

Also, please make sure you do the following:

- Read the Contributing Guidelines at https://rolldown.rs/contribution-guide/.
- Check that there isn't already a PR that solves the problem the same way. If you find a duplicate, please help us review it.
- Update the corresponding documentation if needed.
- Include relevant tests that fail without this PR but pass with it. If the tests are not included, explain why.

Thank you for contributing to Rolldown!
-->

## Summary

For full design and principles, please refer to #10164 (comment).

## The playgrounds

Each playground is a small app (`index.html` + JS modules + `dev.config.mjs` + `package.json`) with a `__tests__/*.spec.ts` that edits a file and asserts on the running page. Several port behavior expectations from Vite's HMR tests (the `hmr-hot-off` fixture says so explicitly).

| Group | Playgrounds | What they exercise |
|---|---|---|
| Accept | `hmr-accept-exports`, `hmr-nested-dep-accept` | `hot.accept` receiving new exports; accepting a dep deeper in the graph |
| Circular graphs | `hmr-circular-accept-outside`, `hmr-circular-self-accept`, `hmr-invalidate-circular` | accept / self-accept / `hot.invalidate` when the edited module sits in an import cycle |
| Lifecycle / state | `hmr-dispose-data`, `hmr-prune` | `hot.dispose` passing state through `hot.data`; `hot.prune` when a module is no longer imported |
| Events | `hmr-hot-events`, `hmr-hot-off` | `hot.on` for built-in `vite:beforeUpdate` / `vite:afterUpdate`; `hot.off` removing one listener while another stays |
| Dynamic import + lazy compilation | `hmr-lazy-dynamic-import-accept-dep`, `hmr-lazy-dynamic-import-self-accept`, `hmr-not-loaded-dynamic-import` | updates to dynamically imported modules, including under lazy compilation and when the module was never loaded |
| Full reload | `hmr-before-full-reload` | behavior around an update that must fall back to a full page reload |
@graphite-app
graphite-app Bot force-pushed the 07-07-test_dev_add_hot_api_test_cases branch from 6a4e249 to f26ce7a Compare July 15, 2026 08:23
@graphite-app
graphite-app Bot merged commit f26ce7a into main Jul 15, 2026
32 of 33 checks passed
@graphite-app
graphite-app Bot deleted the 07-07-test_dev_add_hot_api_test_cases branch July 15, 2026 08:28
@rolldown-guard rolldown-guard Bot mentioned this pull request Jul 15, 2026
shulaoda added a commit that referenced this pull request Jul 15, 2026
## [1.2.0] - 2026-07-15

### 🚀 Features

- dev: skip shipping factories for newly imported top-level modules (#10223) by @h-a-n-a
- dev: per-client ship map for HMR patch sizing (#10208) by @h-a-n-a
- dev: client-side HMR (#10164) by @h-a-n-a
- dev: send a full-reload update to clients when a tsconfig changes (#10262) by @shulaoda
- treat `import.meta['url']` and `import.meta['ROLLUP_FILE_URL_*']` as side-effect free (#10267) by @sapphi-red
- rewrite `import.meta['url']` (#10251) by @sapphi-red
- add `FILE_NOT_FOUND` error (#10220) by @sapphi-red
- treat `import.meta.ROLLUP_FILE_URL_*` as side-effect free (#10217) by @sapphi-red

### 🐛 Bug Fixes

- sourcemap: preserve unmapped boundaries during composition (#10254) by @hyfdev
- `[format]` in `*FileNames` option for ESM format should be `es` instead of `esm` (#10214) by @sapphi-red
- sourcemap: preserve coarse mappings during composition (#10249) by @hyfdev
- rolldown_plugin_vite_import_glob: support tsconfig paths with `import.meta.glob` (#10167) by @sapphi-red
- dev: clear tsconfig caches for bare full builds (#10276) by @shulaoda
- dev: force a full rebuild when a tsconfig changes (#10261) by @shulaoda
- treat rooted drive-less module ids as absolute in preserveModules naming (#10235) by @IWANABETHATGUY
- watch: rebuild when tsconfig files change (#10258) by @shulaoda
- watch: drop tsconfig-merged transform options on each rebuild (#10257) by @shulaoda
- incorrect `EMPTY_IMPORT_META` warning for `import.meta.ROLLUP_FILE_URL_*` for CJS output (#10221) by @sapphi-red
- deconflict: rename CJS locals shadowing wrapped-ESM namespace objects (#9970) by @IWANABETHATGUY
- rolldown: drop the unused runtime module after entry-level external flattening (#10237) by @IWANABETHATGUY
- rolldown: re-propagate has_dynamic_exports to transitive star importers (#10239) by @IWANABETHATGUY
- tree-shaking: tree-shake destructured dynamic import namespace bindings (#10213) by @logaretm
- s390x: use json-escape-simd 3.1.1 for big-endian JSON escaping fix (#10211) by @satyamg1620

### 🚜 Refactor

- dev: move full-reload to client side (#10207) by @h-a-n-a
- readability follow-ups to the ReplaceWith migration (#10286) by @IWANABETHATGUY
- replace take_in-then-write-back with ReplaceWith and by-value moves (#10285) by @Boshen
- share the main resolver's cache with the transformer's tsconfig lookups (#10205) by @shulaoda
- rolldown: extract the ns star-external __reExport emission rule into LinkingMetadata (#10238) by @IWANABETHATGUY
- rolldown: unify link/generate diagnostics into a Diagnostics accumulator (#10234) by @IWANABETHATGUY
- sourcemap_filenames: drop dead sourcemap-filename plumbing (#10189) by @IWANABETHATGUY
- extract external import symbol merging into a method (#10224) by @IWANABETHATGUY
- rolldown: skip CJS namespace merging under strict execution order (#10203) by @hyfdev
- resolve the manual tsconfig per file instead of once at startup (#10200) by @shulaoda
- rolldown: route interop ESM init emission through a shared init-target view (#10202) by @hyfdev
- rolldown: collapse vestigial wrap-kind state and share chunk sort helper (#10201) by @hyfdev

### 📚 Documentation

- show plugin kinds in JSDoc and each hook's description (#10218) by @sapphi-red
- add an explanation about removing imports from external modules without any messages (#10215) by @sapphi-red

### ⚡ Performance

- sourcemap: owned merge in SourceJoiner::join (4005->5 allocs/chunk) (#10250) by @Boshen
- avoid redundant sourcemap string copies in collapse and minify paths (#10093) by @Boshen

### 🧪 Testing

- code-splitting: establish strict-order review baselines (#10287) by @hyfdev
- dev: add hot API test cases (#10181) by @h-a-n-a
- code-splitting: normalize strict execution order variants (#10277) by @hyfdev
- code-splitting: harden strict execution order coverage (#10252) by @hyfdev
- code-splitting: add strict execution order regressions (#10253) by @hyfdev

### ⚙️ Miscellaneous Tasks

- deps: update github actions (#10241) by @renovate[bot]
- deps: update oxc to 0.140.0 (#10274) by @shulaoda
- update Yunfei's GitHub username (#10275) by @hyfdev
- deps: update napi (#10260) by @renovate[bot]
- deps: update test262 submodule for tests (#10266) by @rolldown-guard[bot]
- deps: update dependency vite-plus to v0.2.4 (#10256) by @renovate[bot]
- deps: update napi (#10240) by @renovate[bot]
- deps: update oxc resolver to v11.24.2 (#10245) by @renovate[bot]
- deps: update rust crates (#10244) by @renovate[bot]
- disable Renovate updates for idna_adapter (#10248) by @shulaoda
- deps: update oxc resolver to v11.24.1 (#10232) by @renovate[bot]
- deps: update rust crate oxc_sourcemap to v8.1.1 (#10233) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to ^0.27.0 (#10206) by @renovate[bot]
- deps: upgrade sugar_path to v3 (#10230) by @hyfdev
- add `dist-*` to `.gitignore` in sourcemap-filenames/hash-final-content fixture (#10216) by @sapphi-red
- deps: update dependency rust to v1.97.0 (#10209) by @renovate[bot]

### ❤️ New Contributors

* @satyamg1620 made their first contribution in [#10211](#10211)

Co-authored-by: shulaoda <[email protected]>
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.

4 participants