Skip to content

feat: support import.meta.hot hmr alias#14555

Open
intellild wants to merge 5 commits into
mainfrom
codex/import-meta-hot-alias
Open

feat: support import.meta.hot hmr alias#14555
intellild wants to merge 5 commits into
mainfrom
codex/import-meta-hot-alias

Conversation

@intellild

@intellild intellild commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Treat import.meta.hot as an alias of import.meta.webpackHot in the HMR parser.
  • Add ImportMeta.hot typing and document the alias in the HMR runtime API docs.
  • Cover the alias in dedicated config cases for HMR accept parsing and production-mode false transformation.

Motivation

Bun, Deno, and Vite already support import.meta.hot for HMR. Adding the same entry in Rspack keeps the HMR interface consistent across modern runtimes while preserving the existing import.meta.webpackHot API.

Validation

  • pnpm --filter @rspack/core build
  • pnpm run build:binding:dev
  • corepack pnpm --filter @rspack/tests test -t "configCases/issues/issue-14974"
  • corepack pnpm --filter @rspack/tests test -t "configCases/parsing/import-meta-hot"
  • corepack pnpm --filter @rspack/tests test -t "configCases/parsing/import-meta-hot-prod"

by OpenAI Codex

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 24, 2026

Copy link
Copy Markdown

Deploying rspack with  Cloudflare Pages  Cloudflare Pages

Latest commit: c3946ac
Status: ✅  Deploy successful!
Preview URL: https://89f641ad.rspack-v2.pages.dev
Branch Preview URL: https://codex-import-meta-hot-alias.rspack-v2.pages.dev

View logs

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing c3946ac to fix(rsc): preserve multiple referenced client exports (#14794) by Cong-Cong Pan

🙈 Size remains the same at 66.55MB

@codspeed-hq

codspeed-hq Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 47 skipped benchmarks1


Comparing codex/import-meta-hot-alias (c3946ac) with main (786dec5)

Open in CodSpeed

Footnotes

  1. 47 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@intellild intellild force-pushed the codex/import-meta-hot-alias branch from d09afb5 to 37c1019 Compare June 29, 2026 06:43
@intellild

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown

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: 37c1019ba8

ℹ️ 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".

@intellild intellild force-pushed the codex/import-meta-hot-alias branch from 37c1019 to af929dc Compare June 29, 2026 11:12
@intellild

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: af929dc34a

ℹ️ 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".

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

Found 5 projects in monorepo, 5 projects with changes.

📊 Quick Summary
Project Total Size Gzip Size Change Gzip Change
popular-libs 1.7 MB 551.5 KB - -
react-10k 5.6 MB 1.3 MB - -
react-1k 823.2 KB 217.0 KB - -
react-5k 2.7 MB 663.9 KB - -
ui-components 4.9 MB 1.4 MB - -
📋 Detailed Reports (Click to expand)

📁 popular-libs

Path: ../build-tools-performance/cases/popular-libs/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 1.7 MB - -
🗜️ Gzip Size 551.5 KB - -
📄 JavaScript 1.7 MB - -
🎨 CSS 0 B - -
🌐 HTML 289.0 B - -
📁 Other Assets 0 B - -

📁 react-10k

Path: ../build-tools-performance/cases/react-10k/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 5.6 MB - -
🗜️ Gzip Size 1.3 MB - -
📄 JavaScript 5.6 MB - -
🎨 CSS 21.0 B - -
🌐 HTML 328.0 B - -
📁 Other Assets 0 B - -

📁 react-1k

Path: ../build-tools-performance/cases/react-1k/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 823.2 KB - -
🗜️ Gzip Size 217.0 KB - -
📄 JavaScript 822.9 KB - -
🎨 CSS 0 B - -
🌐 HTML 328.0 B - -
📁 Other Assets 0 B - -

📁 react-5k

Path: ../build-tools-performance/cases/react-5k/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 2.7 MB - -
🗜️ Gzip Size 663.9 KB - -
📄 JavaScript 2.7 MB - -
🎨 CSS 21.0 B - -
🌐 HTML 328.0 B - -
📁 Other Assets 0 B - -

📁 ui-components

Path: ../build-tools-performance/cases/ui-components/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 4.9 MB - -
🗜️ Gzip Size 1.4 MB - -
📄 JavaScript 4.8 MB - -
🎨 CSS 112.1 KB - -
🌐 HTML 328.0 B - -
📁 Other Assets 0 B - -

Generated by Rsdoctor GitHub Action

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

📝 Rspack Ecosystem CI: Open

suite result
devserver ✅ success
rstest ✅ success
rslib ✅ success
lynx-stack ✅ success
rsbuild ✅ success
rsdoctor ✅ success
rspress ✅ success
examples ✅ success
plugin ✅ success
rsbuild-rsc-plugin ✅ success
modernjs ❌ failure

@intellild intellild force-pushed the codex/import-meta-hot-alias branch from af929dc to f0c76d0 Compare July 7, 2026 02:19
@intellild intellild force-pushed the codex/import-meta-hot-alias branch from f0c76d0 to 21ed178 Compare July 13, 2026 04:09
@intellild

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 21ed1780c7

ℹ️ 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".

@intellild

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown

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: 766aeee37d

ℹ️ 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 thread packages/rspack/module.d.ts
@intellild

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown

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: 766aeee37d

ℹ️ 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 thread crates/rspack_plugin_javascript/src/parser_plugin/import_meta_plugin.rs Outdated
@intellild

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown

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: 267b01d2b9

ℹ️ 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 thread packages/rspack/module.d.ts
@intellild intellild marked this pull request as ready for review July 14, 2026 03:04
@intellild intellild requested a review from hardfist as a code owner July 14, 2026 03:04
@intellild intellild requested a review from stormslowly July 14, 2026 03:04
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.

1 participant