Skip to content

Commit c14e435

Browse files
authored
[Turbopack] refactoring/todos (#69663)
add TODO fix function name <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
1 parent 4a4ff6c commit c14e435

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

packages/next/src/server/dev/hot-reloader-turbopack.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@ export async function createHotReloaderTurbopack(
126126
hotReloaderSpan.stop()
127127

128128
const encryptionKey = await generateEncryptionKeyBase64(true)
129+
130+
// TODO: Implement
131+
let clientRouterFilters: any
132+
if (nextConfig.experimental.clientRouterFilter) {
133+
// TODO this need to be set correctly for persistent caching to work
134+
}
135+
129136
const project = await bindings.turbo.createProject(
130137
{
131138
projectPath: dir,
@@ -137,8 +144,7 @@ export async function createHotReloaderTurbopack(
137144
env: process.env as Record<string, string>,
138145
defineEnv: createDefineEnv({
139146
isTurbopack: true,
140-
// TODO: Implement
141-
clientRouterFilters: undefined,
147+
clientRouterFilters,
142148
config: nextConfig,
143149
dev: true,
144150
distDir,

turbopack/crates/turbo-tasks/src/backend.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -312,18 +312,18 @@ impl CachedTaskType {
312312
fn_type: native_fn,
313313
this: _,
314314
arg: _,
315-
}
316-
| Self::ResolveNative {
315+
} => Cow::Borrowed(&registry::get_function(*native_fn).name),
316+
Self::ResolveNative {
317317
fn_type: native_fn,
318318
this: _,
319319
arg: _,
320-
} => Cow::Borrowed(&registry::get_function(*native_fn).name),
320+
} => format!("*{}", registry::get_function(*native_fn).name).into(),
321321
Self::ResolveTrait {
322322
trait_type: trait_id,
323323
method_name: fn_name,
324324
this: _,
325325
arg: _,
326-
} => format!("{}::{}", registry::get_trait(*trait_id).name, fn_name).into(),
326+
} => format!("*{}::{}", registry::get_trait(*trait_id).name, fn_name).into(),
327327
}
328328
}
329329

@@ -748,7 +748,7 @@ pub(crate) mod tests {
748748
arg: Box::new(()),
749749
}
750750
.get_name(),
751-
"MockTrait::mock_method_task",
751+
"*MockTrait::mock_method_task",
752752
);
753753
}
754754
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ error - [code gen] [project]/turbopack/crates/turbopack-tests/tests/snapshot/imp
66

77
Debug info:
88
- An error occurred while generating the chunk item [project]/turbopack/crates/turbopack-tests/tests/snapshot/imports/json/input/invalid.json (json)
9-
- Execution of EcmascriptChunkItemContent::module_factory failed
9+
- Execution of *EcmascriptChunkItemContent::module_factory failed
1010
- Execution of <JsonChunkItem as EcmascriptChunkItem>::content failed
1111
- Unable to make a module from invalid JSON: expected `,` or `}` at line 3 column 26
1212
at nested.?

turbopack/crates/turbopack-tests/tests/snapshot/imports/json/output/turbopack_crates_turbopack-tests_tests_snapshot_imports_json_input_52abdb._.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)