Repository navigation
docs(en): merge rollup/master into rollup-docs-cn/master @ 62282b46 - #216
Open
docschina-bot wants to merge 76 commits into
Open
docschina-bot wants to merge 76 commits into
docschina-bot wants to merge 76 commits into
Conversation
* Lock file maintenance * Fix type errors and lint failures from dependency updates markdown-it 15 (via @shikijs/vitepress-twoslash 4.5.0) now ships its own types where the MarkdownIt class is only a named export, breaking the type-only default import in the vitepress types; patch it to use the named export. The root project also type-checks all implicit @types libraries and thus broke on @types/markdown-it's require-import of linkify-it 6; restrict the root tsconfig to node types like all other tsconfigs already do. A regression in @vue/language-core 3.3.12 (vuejs/language-tools#6247) makes prettier organize the Vue compiler macros into the "vue" imports; import the macros explicitly as a temporary workaround that should be reverted once the upstream issue is fixed. * Update audit resolve Ignore the new sprintf-js advisory (no fixed version exists) and the katex advisory (fixed only in katex 0.18.2 while mermaid pins ^0.16). Both affect master as well. * Make node_modules cache reuse depend on the patch files Caches are saved after patch-package has applied all patches. When the prefix restore-keys served such a snapshot to a branch with a changed lock file, npm install did not re-extract patched packages and patch-package failed on the partially applied patch state. An exact cache hit also silently reused stale patches when only a patch file changed. Pin the cache keys to the current patch files so that snapshots are only reused, fully or partially, when the patches match. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
Co-authored-by: Minho Yoo <13810291+irontaek@users.noreply.github.com> Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
Replace the label-triggered REPL and performance report workflows with an unprivileged build workflow that runs on every pull request and a separate privileged publish workflow that only posts comments and uploads to S3. The old fork flow always failed because `gh api` switches to POST when `-f` fields are passed, hitting the create-PR endpoint instead of listing pulls. The benchmark now runs for every PR. REPL artefacts are published automatically for same-repo PRs while fork PRs keep the label as a one-shot maintainer gate for serving fork builds on rollupjs.org. The label click records a SHA-bound authorization status via a trusted pull_request_target workflow and removes the label again, so the grant never carries over to a later push. The REPL comment links the Vercel preview deployment for the build head when one has succeeded.
Co-authored-by: Johan Vaz <252314190+Jo2234@users.noreply.github.com> Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
…562) * Do not resolve values of assigned variables returned on all paths The return-value resolution introduced in #6541 let value queries use the declaration initializer when a function returns the same variable on all paths. Assignments are only deoptimized lazily, so such queries could rely on stale initializers and e.g. fold pure-annotated helper calls, breaking core-js-pure (#6560). The same staleness affected call arguments, which were only forwarded to the initializer and never deoptimized when the returned function was replaced later. Such functions are now represented by a wrapper that resolves value queries to unknown and deoptimizes call arguments directly while forwarding all other interactions, keeping the #6541 scenarios working. The wrapper is only created for variables that are assignment targets, which is tracked eagerly at bind time. Direct value queries on variables keep their existing behavior (#3324). * Track destructuring assignments of variables returned on all paths Destructuring assignments only stored the assignment interaction on the pattern itself, never on the identifier targets, so variables assigned via destructuring were not flagged as assignment targets and return-value resolution could still fold on stale initializers. Patterns now forward the assignment to their targets. As each target receives only some subpath of the assigned value, targets are flagged with an unknown value instead of the full right-hand side. * Do not resolve values of assigned variables returned in a single return Single-return functions resolve to the returned identifier on all released versions. Values and call arguments were forwarded to the declaration initializer, which is stale when a later assignment replaces it: lazy singleton getters with pure-annotated calls folded to their initial value, and arguments to a returned function that is assigned first were never deoptimized. The single-return case now shares the conservative resolution of the same-variable multi-return case. As a tradeoff, getters over variables that are only assigned from never-included code, e.g. an unused setter, no longer fold to the initial value either.
…ned variables (#6565) Avoid path-dependent explosion when including call arguments of reassigned variables The general resolution of possible values of reassigned variables from #6541 visited each value once per path, growing exponentially with assignment density: tree-shaking the react-dom pattern from #6564 (#6541's core-js case is unaffected) took minutes and gigabytes of memory. Replace the union walk with a single non-recursive step: blanket inclusion of the call plus, only for directly assigned function expressions whose parameters are called from try statements, forwarding the call arguments to the function's parameter scope. Helpers reached through identifier chains or call results of reassigned variables revert to the 4.63 behavior, which also drops the corresponding test sub-case.
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
* Update dependency eslint-plugin-unicorn to v77 * Aceept repo abbreviation This is part of the GitHub API and needs to stay. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
* Improve PR testing instructions comments Post the local testing instructions immediately when a PR is created, reopened or pushed instead of only when REPL artefacts are published, and mention that the pinned Rust toolchain is installed automatically via rust-toolchain.toml instead of recommending the latest nightly. Once REPL artefacts are published, the comment is upgraded with the REPL link and the built-from commit; when a later build does not publish, the link is kept but an "outdated" warning naming the represented commit is appended and removed again on the next publish. Every fork PR now receives a bot comment right away, which does not add new attack surface as installing from a fork already runs its prepare script. * Trim CI Workflows notes in AGENTS.md Keep only the non-obvious gotchas: the gh api field behavior, the trusted contexts, the fork REPL gate and where it must live, and the duplicated comment wording. * Validate the PR install location before posting comments Only post the testing instructions comment when the fork-controlled repository and branch names match the allowlist used in the install command, so a crafted branch name can neither break out of the code fence nor smuggle shell commands into the copied npm install command. The comment is omitted in both workflows when validation fails.
* fix: make the WASM build work on big-endian hosts
The parser writes the AST buffer in its native byte order and the JS side
reads it in the byte order of the host. That only agrees as long as both
run with the same byte order, which is not the case for the WASM build on
a big-endian host: WebAssembly memory is always little-endian, so every
32-bit field comes out byte-swapped and convertNode() fails with
Error: Unknown node type: 1207959552
where 1207959552 is 0x48000000, the byte-swapped node type 72 (Program).
This is the AST buffer failure reported in #5354 for s390x and IBM i.
Fix this for that combination only: parse() gets a swap_byte_order flag,
which the WASM wrappers (native.wasm.js and browser/src/wasm.ts) set when
the host is big-endian. With the flag, the converter reverses every
32-bit field at the end of convert_ast_to_buffer(), skipping the byte
ranges that are not 32-bit fields: string bytes (registered by
convert_string) and the f64 values, which are always little-endian
(registered by the Float macro). ParseError and PanicError buffers are
treated the same way. The native bindings pass false, so nothing changes
for them, and the JS side keeps reading the buffer in host byte order.
Only WASM on big-endian hosts pays for the extra pass over the buffer.
Tests: unit tests in parse_ast check that swapping only touches the
32-bit fields, keeps strings and f64 values and also applies to parse
errors (cargo test -p parse_ast). The s390x smoke test on CI now also
runs the WASM build and requires it to produce the same output as the
native binding.
Verified on FreeBSD/powerpc64 (big-endian) with a wasm-node build from
this branch: the yt-dlp-ejs build, which failed as above, produces output
byte-identical to a powerpc64le build.
* Avoid unnecessary allocation in error cases
* Address review comments
- Replace the Rust unit tests with test/browser/ast-buffer.js, which
loads the WASM artifact and compares the buffers that parse() returns
with and without swap_byte_order word by word: every word is either
reversed or kept, the root node type and the string lengths are
reversed, string bytes and f64 values are kept. It is required from
test/browser/index.js, so it runs with the browser tests, where a
WASM build is always available.
- Rename raw_byte_ranges and add_raw_byte_range to unswapped_byte_ranges
and add_unswapped_byte_range.
- Regenerate wasm/bindings_wasm.d.ts and wasm/bindings_wasm_bg.wasm.d.ts
with npm run build:wasm instead of editing them by hand; the latter
had been missed.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
---------
Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
* fix: prevent cycles for indirectly awaited dynamic imports * fix: keep shared chunks out of entries that still await a dynamic import Marking every dynamic import reached from an entry with a top-level await as awaited was not conservative: the awaited already-loaded atoms were intersected over all awaiting importers, so an additional awaiting importer that had not loaded a shared chunk itself could drop that chunk from the protected set. The chunk was then merged into the entry and the dynamic entry imported the entry back, creating a new cycle. Awaited already-loaded atoms are now the union over all awaiting importers, and entries that await a dynamic entry indirectly are registered as awaiting importers of that entry. --------- Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
for-await loops and await using declarations make module execution asynchronous just like await expressions.
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…#6573) The test asserted that all changes made right after the initial build show up as watchChange events before the next rebuild finishes. With fsevents, events can arrive staggered or get dropped while watcher streams are still starting up, so only a subset was announced in time on slower CI runners. Replace the fixed event sequence with a retry loop that rewrites missing files until each expected watchChange event has been announced, with a deadline so genuine wiring regressions still fail.
Align lock file maintenance with the minor/patch update schedule Since Renovate v43, lock file maintenance can no longer be grouped with other dependency updates and always uses its built-in "before 4am on monday" schedule. Since a separate PR cannot be avoided, give it the same schedule and automerge behavior as the minor/patch updates and remove it from the group so its PR no longer carries the group name.
…ng a class (#6551)
* Retain instance field initializers with side effects when instantiating a class
Creating an instance of a class runs the initializers of its instance
fields, but Rollup only looked at the constructor (or the super class) when
deciding whether `new Class()` has side effects. A statement such as
`new Logger()` for `class Logger { value = console.log('created'); }` was
therefore removed from the bundle.
Instance field initializers are now checked when a class is instantiated,
with `this` bound to an entity for the new instance so that pure
initializers such as `sum = this.number + 1` are still tree-shaken.
* Cache the instance field values, expose the instance this variable and create the instance entity eagerly
---------
Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
…#6575) * Report creation of missing watch files sharing a directory on Linux When several watched files in the same directory do not exist yet, the bundled chokidar keyed its per-directory readdir throttle by directory alone, so only the first missing file's read went through and creations of the others were silently dropped on inotify. Key the throttle per missing file instead, via a build-time replacement of the bundled chokidar code. The regression test only fails on inotify platforms; macOS uses fsevents and is unaffected, so the Ubuntu CI run is what guards it. * Use chokidar 5's throttle key and make watch test order-independent The per-target key must not collide with the key used for plain directory reads, so we use the same composite key that fixes this upstream in chokidar 5. The regression test now requires the creation of all watched files to be reported instead of relying on which missing file happens to win the shared directory throttle. * Resolve audit. * Stabilize watch tests against watcher start-up noise Following #6573, replace the event-sequence assertions of the initially-missing-watch-file tests with polling retry loops. Event sequences can be disrupted by spurious rebuilds and dropped watcher events during watcher start-up, and a dropped creation is reported as an update on retry. The regression test now registers the starved watched file only after a completed build to keep the failing case deterministic.
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Lock file maintenance * Resolve audit --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
* Fix tree-shaking of disposable resources * Preserve receivers of unresolved disposers * Treat disposal symbols as missing on Object.prototype Lets "await using" on plain objects fall back to Symbol.dispose without retaining the whole resource as a potential receiver of an unknown Symbol.asyncDispose. * Cover disposal method resolution through member expressions and reassigned variables * Keep disposal methods on generator prototypes * Handle using with a disposer from object spread * Handle using with a getter for the disposal method * Correct descriptions of disposal symbols * Treat generator return values as unknown * Include only the receiver paths used by the disposer * Track nested receiver paths accessed via this * Keep symbol-keyed properties used through parameters * Resolve audit --------- Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
* Treat null sources in plugin sourcemaps as unmapped * Allow null sources in the sourcemap types Plugins may return maps with null sources, so the public types allow them now. getCombinedSourcemap traces such a map even without previous transforms, so that the map it returns only has named sources. * Compare the traced source path independently of drive letter case source-map lowercases the Windows drive letter of absolute sources. * Pass a missing sourcesContent entry through as before --------- Co-authored-by: Wleeaf <179125857+wleeaf@users.noreply.github.com> Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
* Preserve rendering errors when renderError fails * Include plugin names in compound errors --------- Co-authored-by: shuaiyafei <16618929+shuaiyafei@users.noreply.github.com>
* Flatten index sourcemaps returned by plugins * Allow index sourcemap sections without names names is optional in a source map, so an embedded map without it must not abort the build. * Add index sourcemaps to the public sourcemap types Typed plugins can now return an index map from load, transform and renderChunk without a cast. * Drop the sourcemap casts made unnecessary by #6600 --------- Co-authored-by: Wleeaf <179125857+wleeaf@users.noreply.github.com> Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
Install libatomic1 in smoke test containers Official Node 26 linux-s390x binaries link against libatomic.so.1, which the Ubuntu container did not provide. node and npm therefore failed to start and the s390x smoke test aborted with exit code 127 before running any test.
* Add android-x64 native build Allows using the native build on x86_64 Android, e.g. Termux on Chromebooks. napi-rs only sets up the NDK compiler and linker for arm and aarch64 Android targets, so the CI build points cc and cargo at the x86_64 NDK clang itself. * Test native package lookup on x64 Android --------- Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Update minor/patch updates * Keep parking_lot at 0.12 parking_lot 0.13 requires rustc 1.95, which neither the pinned nightly nor the OpenBSD distro rust provide. swc_common still uses 0.12, so the update would also have bundled a second copy. Renovate is told to hold it back until both are resolved. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Resuming a failed release always failed early because browser and wasm-node were republished unconditionally, while a transparency log conflict aborted napi publishing before it could skip the platform packages that were done. Skip versions that are already published, and retry once after a transparency log conflict, which means the upload never happened and a fresh signature does not conflict again (npm/cli#10078). The root package publish itself remains unresumable.
Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
❌ Deploy Preview for relaxed-alfajores-47dd1b failed.
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #216 +/- ##
==========================================
+ Coverage 98.27% 98.29% +0.01%
==========================================
Files 378 380 +2
Lines 13729 14036 +307
Branches 2921 2992 +71
==========================================
+ Hits 13492 13796 +304
- Misses 193 197 +4
+ Partials 44 43 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch was successfully 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 自动生成。
合并 rollup/rollup 的修改至本仓库(@ 62282b4)
以下文件存在冲突,可能需要重新翻译:
请解决所有冲突后提交到此 pull request,可直接在 Github 修改、切换到 sync-62282b46 分支进行修改或者使用 Github Desktop 拉取此 pr 修改并提交。
禁止使用 Squash Merge 来合并此 Pull Request!
使用该操作会导致上游仓库的内容丢失,并致使下一次合并产生冲突。