next.js
e913c8c7 - docs: correct Turbopack loader API, magic comment, and ignoreIssue details (#102793)

Commit
9 hours ago
docs: correct Turbopack loader API, magic comment, and ignoreIssue details (#102793) ### What? Corrects Turbopack reference details that no longer match the code: - Loader API in the `turbopack` config reference: `utils` is supported, and `importModule` is supported apart from its `options` argument. Adds a `16.5.0` history row for loader `utils` and `fs.stat`. - Lazy loading guide: magic comments also work with `new URL()`, matching the Turbopack reference. Adds examples for `new URL()` and `new Worker()`. - `turbopackLazyDynamicImportsSSR`: the option also applies to `import()` in Server Components, Route Handlers, and Pages Router pages and API Routes. Proxy and instrumentation imports are compiled at startup. - `turbopack.ignoreIssue`: the `title: 'Module not found'` examples become `title: /^Module not found/`. A string title is an exact match, and the resolve issue title continues with the request (`Module not found: Can't resolve '...'`), so the string form never matched. ### Why? Found in a docs audit of the Turbopack changes in 16.5 (#99826, #99965, #99541, #100272). The `importModule` and `ignoreIssue` items predate 16.5. ### Verification - Checked against `turbopack/crates/turbopack-node/js/src/transforms/webpack-loaders.ts`, `turbopack/crates/turbopack-core/src/issue/resolve.rs` and `issue/mod.rs`, `crates/next-core/src/next_config.rs` (`to_ignore_pattern`), the `new-url-ignore` execution fixture and the `imports/ignore-comments` snapshot fixture (source of the `new URL()` and `new Worker()` examples), and `test/development/app-dir/lazy-dynamic-imports` at `v16.5.0`. - Not run: an `ignoreIssue` rule with the old string title. The mismatch is from reading the title construction and the exact-match comparison.
Author
Parents
Loading