Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "16.3.1-canary.16"
"version": "16.3.1-canary.17"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "16.3.1-canary.16",
"version": "16.3.1-canary.17",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/devlow-bench/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@vercel/devlow-bench",
"private": true,
"version": "16.3.1-canary.16",
"version": "16.3.1-canary.17",
"description": "Benchmarking tool for the developer workflow",
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "16.3.1-canary.16",
"version": "16.3.1-canary.17",
"description": "ESLint configuration used by Next.js.",
"license": "MIT",
"repository": {
Expand All @@ -12,7 +12,7 @@
"dist"
],
"dependencies": {
"@next/eslint-plugin-next": "16.3.1-canary.16",
"@next/eslint-plugin-next": "16.3.1-canary.17",
"eslint-import-resolver-node": "^0.3.6",
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-import": "^2.32.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-internal/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@next/eslint-plugin-internal",
"private": true,
"version": "16.3.1-canary.16",
"version": "16.3.1-canary.17",
"description": "ESLint plugin for working on Next.js.",
"exports": {
".": "./src/eslint-plugin-internal.js"
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "16.3.1-canary.16",
"version": "16.3.1-canary.17",
"description": "ESLint plugin for Next.js.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/font/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@next/font",
"private": true,
"version": "16.3.1-canary.16",
"version": "16.3.1-canary.17",
"repository": {
"url": "vercel/next.js",
"directory": "packages/font"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "16.3.1-canary.16",
"version": "16.3.1-canary.17",
"main": "index.js",
"types": "index.d.ts",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "16.3.1-canary.16",
"version": "16.3.1-canary.17",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-env/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/env",
"version": "16.3.1-canary.16",
"version": "16.3.1-canary.17",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "16.3.1-canary.16",
"version": "16.3.1-canary.17",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-playwright/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/playwright",
"version": "16.3.1-canary.16",
"version": "16.3.1-canary.17",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-playwright"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "16.3.1-canary.16",
"version": "16.3.1-canary.17",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-module/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-module",
"version": "16.3.1-canary.16",
"version": "16.3.1-canary.17",
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
"main": "dist/polyfill-module.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-nomodule/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "16.3.1-canary.16",
"version": "16.3.1-canary.17",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-routing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/routing",
"version": "16.3.1-canary.16",
"version": "16.3.1-canary.17",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-rspack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-rspack",
"version": "16.3.1-canary.16",
"version": "16.3.1-canary.17",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-rspack"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/swc",
"version": "16.3.1-canary.16",
"version": "16.3.1-canary.17",
"private": true,
"files": [
"native/"
Expand Down
14 changes: 7 additions & 7 deletions packages/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "16.3.1-canary.16",
"version": "16.3.1-canary.17",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -100,7 +100,7 @@
]
},
"dependencies": {
"@next/env": "16.3.1-canary.16",
"@next/env": "16.3.1-canary.17",
"@swc/helpers": "0.5.23",
"baseline-browser-mapping": "^2.9.19",
"caniuse-lite": "^1.0.30001579",
Expand Down Expand Up @@ -164,11 +164,11 @@
"@modelcontextprotocol/sdk": "1.18.1",
"@mswjs/interceptors": "0.42.0",
"@napi-rs/triples": "1.2.0",
"@next/font": "16.3.1-canary.16",
"@next/polyfill-module": "16.3.1-canary.16",
"@next/polyfill-nomodule": "16.3.1-canary.16",
"@next/react-refresh-utils": "16.3.1-canary.16",
"@next/swc": "16.3.1-canary.16",
"@next/font": "16.3.1-canary.17",
"@next/polyfill-module": "16.3.1-canary.17",
"@next/polyfill-nomodule": "16.3.1-canary.17",
"@next/react-refresh-utils": "16.3.1-canary.17",
"@next/swc": "16.3.1-canary.17",
"@opentelemetry/api": "1.6.0",
"@playwright/test": "1.61.0",
"@rspack/core": "1.6.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-refresh-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/react-refresh-utils",
"version": "16.3.1-canary.16",
"version": "16.3.1-canary.17",
"description": "An experimental package providing utilities for React Refresh.",
"repository": {
"url": "vercel/next.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/third-parties/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/third-parties",
"version": "16.3.1-canary.16",
"version": "16.3.1-canary.17",
"repository": {
"url": "vercel/next.js",
"directory": "packages/third-parties"
Expand All @@ -26,7 +26,7 @@
"third-party-capital": "1.0.20"
},
"devDependencies": {
"next": "16.3.1-canary.16",
"next": "16.3.1-canary.17",
"outdent": "0.8.0",
"prettier": "2.5.1",
"typescript": "6.0.2"
Expand Down
22 changes: 11 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { addOne } from 'wasm-dep'

export async function GET() {
return Response.json({ result: await addOne(1) })
}
7 changes: 7 additions & 0 deletions test/production/turbopack-wasm-output-tracing/app/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function Root({ children }) {
return (
<html>
<body>{children}</body>
</html>
)
}
3 changes: 3 additions & 0 deletions test/production/turbopack-wasm-output-tracing/app/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return <p>hello</p>
}
3 changes: 3 additions & 0 deletions test/production/turbopack-wasm-output-tracing/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
serverExternalPackages: ['wasm-dep'],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { nextTestSetup } from 'e2e-utils'

describe('turbopack wasm output tracing', () => {
const { next, isTurbopack, isNextStart, isNextDeploy } = nextTestSetup({
files: __dirname,
dependencies: {
'wasm-dep': 'file:./wasm-dep',
},
})

it('builds and serves a node route whose external package references a wasm module', async () => {
const res = await next.fetch('/api/wasm')
expect(res.status).toBe(200)
expect(await res.json()).toEqual({ result: 2 })
})

if (isNextStart && !isNextDeploy) {
it('does not list the embedded wasm runtime helper in the route trace', async () => {
const trace = (await next.readJSON(
'.next/server/app/api/wasm/route.js.nft.json'
)) as { files: string[] }

// The `[turbopack-wasm]/**/loadWasm.ts` helper is compiled into the output
// chunk, it is not a deployable source file. Tracing it used to fail the
// build outright, because a traced file has to live in the project or in
// the output directory.
expect(
trace.files.filter(
(file) => file.includes('turbopack-wasm') || file.includes('loadWasm')
)
).toEqual([])

if (isTurbopack) {
// The wasm file itself has to stay in the trace, the external package
// reads it at runtime.
expect(trace.files.some((file) => file.endsWith('add.wasm'))).toBe(true)
}
})
}
})
Binary file not shown.
18 changes: 18 additions & 0 deletions test/production/turbopack-wasm-output-tracing/wasm-dep/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const fs = require('fs')
const path = require('path')

const WASM_PATH = path.join(__dirname, 'add.wasm')

// This is never called: it only exists so that the module graph of this package
// reaches a WebAssembly module through a static reference, like packages that
// ship a bundler-friendly WASM entry next to a runtime fallback do.
exports.loadWasmModule = function loadWasmModule() {
return require('./add.wasm')
}

// The runtime fallback, which is what the route below actually uses.
exports.addOne = async function addOne(value) {
const bytes = await fs.promises.readFile(WASM_PATH)
const { instance } = await WebAssembly.instantiate(bytes)
return instance.exports.add_one(value)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "wasm-dep",
"version": "1.0.0",
"main": "index.js"
}
6 changes: 3 additions & 3 deletions turbopack/crates/turbopack-ecmascript/src/chunk/placeable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ pub trait EcmascriptChunkPlaceable: ChunkableModule + Module {
_estimated: bool,
) -> Vc<EcmascriptChunkItemContent>;

/// Returns the content identity for cache invalidation.
/// Override this for modules whose content depends on more than just the module source
/// (e.g., async loaders that depend on available modules).
/// See [`ChunkItem::content_ident`]
///
/// [`ChunkItem::content_ident`]: turbopack_core::chunk::ChunkItem::content_ident
#[turbo_tasks::function]
fn chunk_item_content_ident(
self: Vc<Self>,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const marker = 'resolved';
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { marker } from '#internal/marker.js'
console.log(marker)
Loading
Loading