Skip to content

Commit

Permalink
Next.js Turbo build: turbopack-ecmascript-runtime and ChunkData (verc…
Browse files Browse the repository at this point in the history
…el#50375)

This PR is extracted from vercel#49942
and mostly contains changes necessary after the Turbopack PR adding the
Node.js production runtime vercel/turborepo#4998,
without any of the actual Next Build stuff, in order to be able to merge
both quickly.

* ChunkData moved from tp-dev to tp-core, the ES-serializable part moved
to tp-ecmascript;
* all runtime types moved to tp-ecmascript-runtime

This also upgrades Turbopack to turbopack-230526.2:

* vercel/turborepo#5102 <!-- Donny/강동윤 - refactor:
Fix binary bloat caused by `ValueDebugFormat` impl -->
* vercel/turborepo#4998 <!-- Alex Kirszenberg -
Node.js production runtime POC -->
  • Loading branch information
alexkirsz authored and hydRAnger committed Jun 12, 2023
1 parent 6ba00b5 commit 8617d57
Show file tree
Hide file tree
Showing 24 changed files with 110 additions and 111 deletions.
88 changes: 54 additions & 34 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ swc_core = { version = "0.76.18" }
testing = { version = "0.33.11" }

# Turbo crates
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230523.3" }
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230526.2" }
# [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros..
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230523.3" }
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230526.2" }
# [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230523.3" }
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230526.2" }

# General Deps

Expand Down
1 change: 1 addition & 0 deletions packages/next-swc/crates/next-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ turbopack-binding = { workspace = true, features = [
"__turbopack_dev_server",
"__turbopack_ecmascript",
"__turbopack_ecmascript_plugin",
"__turbopack_ecmascript_runtime",
"__turbopack_env",
"__turbopack_static",
"__turbopack_image",
Expand Down
4 changes: 2 additions & 2 deletions packages/next-swc/crates/next-core/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"check": "tsc --noEmit"
},
"dependencies": {
"@vercel/turbopack-dev": "https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-dev/js?turbopack-230523.3",
"@vercel/turbopack-node": "https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-node/js?turbopack-230523.3",
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230526.2",
"@vercel/turbopack-node": "https://gitpkg.vercel.app/vercel/turbo/crates/turbopack-node/js?turbopack-230526.2",
"anser": "^2.1.1",
"css.escape": "^1.5.1",
"next": "*",
Expand Down
4 changes: 2 additions & 2 deletions packages/next-swc/crates/next-core/js/src/dev/client.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { connect } from '@vercel/turbopack-dev/client/hmr-client'
import { connectHMR } from '@vercel/turbopack-dev/client/websocket'
import { connect } from '@vercel/turbopack-ecmascript-runtime/dev/client/hmr-client'
import { connectHMR } from '@vercel/turbopack-ecmascript-runtime/dev/client/websocket'
import { register, ReactDevOverlay } from '../overlay/client'

export function initializeHMR(options: { assetPrefix: string }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import type React from 'react'
import { useRouter, usePathname } from 'next/dist/client/components/navigation'
import { useEffect } from 'react'
import { subscribeToUpdate } from '@vercel/turbopack-dev/client/hmr-client'
import { subscribeToUpdate } from '@vercel/turbopack-ecmascript-runtime/dev/client/hmr-client'
import { ReactDevOverlay } from './client'

type HotReloadProps = React.PropsWithChildren<{
Expand Down
Loading

0 comments on commit 8617d57

Please sign in to comment.