Skip to content

docs: improve import.meta docs#13574

Merged
ahabhgk merged 4 commits intomainfrom
docs-import-meta
Apr 2, 2026
Merged

docs: improve import.meta docs#13574
ahabhgk merged 4 commits intomainfrom
docs-import-meta

Conversation

@ahabhgk
Copy link
Copy Markdown
Contributor

@ahabhgk ahabhgk commented Apr 1, 2026

Summary

Improve import.meta docs

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings April 1, 2026 10:07
@ahabhgk
Copy link
Copy Markdown
Contributor Author

ahabhgk commented Apr 1, 2026

@codex review

@github-actions github-actions Bot added release: document release: document related release(mr only) team The issue/pr is created by the member of Rspack. labels Apr 1, 2026
@ahabhgk ahabhgk requested a review from chenjiahan April 1, 2026 10:08
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 1, 2026

Deploying rspack with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3ebd662
Status: ✅  Deploy successful!
Preview URL: https://a97a20ff.rspack-v2.pages.dev
Branch Preview URL: https://docs-import-meta.rspack-v2.pages.dev

View logs

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Copy Markdown
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

This PR updates the English and Chinese documentation to better explain import.meta behavior in Rspack (including supported access patterns and additional documented properties), and clarifies how node.__filename / node.__dirname affect import.meta.filename / import.meta.dirname.

Changes:

  • Refines node.__filename / node.__dirname docs (EN/ZH) to explicitly mention import.meta.filename / import.meta.dirname and improve wording.
  • Expands import.meta runtime API docs (EN/ZH) with clearer guidance on unsupported dynamic access and adds sections for import.meta.main, import.meta.filename, and import.meta.dirname.
  • Improves import.meta.resolve, import.meta.webpackContext, and import.meta.webpackHot descriptions and examples.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
website/docs/zh/config/node.mdx Clarifies wording and examples for __filename/__dirname and their ESM equivalents.
website/docs/zh/api/runtime-api/module-variables.mdx Expands import.meta documentation and examples in Chinese.
website/docs/en/config/node.mdx Clarifies wording and examples for __filename/__dirname and their ESM equivalents.
website/docs/en/api/runtime-api/module-variables.mdx Expands import.meta documentation and examples in English.

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

Comment thread website/docs/zh/api/runtime-api/module-variables.mdx
Comment thread website/docs/zh/api/runtime-api/module-variables.mdx
Comment thread website/docs/en/api/runtime-api/module-variables.mdx
Comment thread website/docs/en/api/runtime-api/module-variables.mdx
@ahabhgk ahabhgk enabled auto-merge (squash) April 1, 2026 11:00
Comment thread website/docs/en/api/runtime-api/module-variables.mdx Outdated
Comment thread website/docs/en/api/runtime-api/module-variables.mdx
@ahabhgk ahabhgk requested a review from hardfist as a code owner April 2, 2026 06:37
@ahabhgk ahabhgk requested a review from chenjiahan April 2, 2026 06:37
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 2, 2026

Merging this PR will degrade performance by 3.79%

❌ 2 regressed benchmarks
✅ 14 untouched benchmarks
⏩ 19 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation rust@create_chunk_ids 10.5 ms 10.8 ms -3%
Simulation rust@concatenate_module_code_generation 143.7 ms 149.4 ms -3.79%

Comparing docs-import-meta (3ebd662) with main (e723074)

Open in CodSpeed

Footnotes

  1. 19 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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

Rsdoctor Bundle Diff Analysis

Found 5 projects in monorepo, 5 projects with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB -
react-1k 826.3 KB -
react-5k 2.7 MB -
rome 984.2 KB -
ui-components 2.3 MB -
📋 Detailed Reports (Click to expand)

📁 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.7 MB - -
📄 JavaScript 5.7 MB - -
🎨 CSS 21.0 B - -
🌐 HTML 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 826.3 KB - -
📄 JavaScript 826.3 KB - -
🎨 CSS 0 B - -
🌐 HTML 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 - -
📄 JavaScript 2.7 MB - -
🎨 CSS 21.0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 rome

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

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

Metric Current Baseline Change
📊 Total Size 984.2 KB - -
📄 JavaScript 984.2 KB - -
🎨 CSS 0 B - -
🌐 HTML 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 2.3 MB - -
📄 JavaScript 2.0 MB - -
🎨 CSS 271.6 KB - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

📦 Binary Size-limit

Comparing 3ebd662 to chore: run @rspack/cli, @rspack/tests tests sequentially in wasm (#13557) by CPunisher

🎉 Size decreased by 7.97KB from 49.09MB to 49.08MB (⬇️0.02%)

Copy link
Copy Markdown
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

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

👍

@ahabhgk ahabhgk merged commit 173af38 into main Apr 2, 2026
42 of 45 checks passed
@ahabhgk ahabhgk deleted the docs-import-meta branch April 2, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: document release: document related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants