From 3291d1f0a2e23fc7811aded1cda4c68a334e3a1d Mon Sep 17 00:00:00 2001 From: Benjamin Woodruff Date: Fri, 15 Nov 2024 17:08:20 -0500 Subject: [PATCH] refactor(turbo-rcstr): Move turbo_tasks::RcStr into it's own crate (#72858) The `RcStr` type doesn't use anything in `turbo-tasks`, so there's no reason it can't be a separate crate that doesn't depend on `turbo-tasks`. This will let it be used in wasm swc plugins, where turbo-tasks does not currently compile. Imports were automatically rewritten with: ``` # Fix imports: sg run --lang rust --pattern 'use $CRATE::{$$$PRE, RcStr};' --rewrite 'use $CRATE::{$$$PRE}; use turbo_rcstr::RcStr;' --update-all sg run --lang rust --pattern 'use $CRATE::{RcStr, $$$POST};' --rewrite 'use $CRATE::{$$$POST}; use turbo_rcstr::RcStr;' --update-all sg run --lang rust --pattern 'use $CRATE::{$$$PRE, RcStr, $$$POST};' --rewrite 'use $CRATE::{$$$PRE, $$$POST}; use turbo_rcstr::RcStr;' --update-all sg run --lang rust --pattern 'use $CRATE::RcStr;' --rewrite 'use turbo_rcstr::RcStr;' --update-all cargo fmt # Fix strings in comments: fastmod crate::RcStr turbo_rcstr::RcStr fastmod turbo_tasks::RcStr turbo_rcstr::RcStr ``` I had to manually fix the `Cargo.toml` files based on the compilation errors. --- Cargo.lock | 40 +++++++++++++++++++ Cargo.toml | 1 + crates/napi/Cargo.toml | 1 + crates/napi/src/next_api/project.rs | 3 +- crates/next-api/Cargo.toml | 1 + crates/next-api/src/app.rs | 5 ++- crates/next-api/src/dynamic_imports.rs | 3 +- crates/next-api/src/entrypoints.rs | 3 +- crates/next-api/src/font.rs | 3 +- crates/next-api/src/instrumentation.rs | 3 +- crates/next-api/src/loadable_manifest.rs | 3 +- crates/next-api/src/middleware.rs | 3 +- crates/next-api/src/nft_json.rs | 3 +- crates/next-api/src/pages.rs | 4 +- crates/next-api/src/paths.rs | 3 +- crates/next-api/src/project.rs | 5 ++- crates/next-api/src/route.rs | 3 +- crates/next-api/src/server_actions.rs | 3 +- crates/next-api/src/versioned_content_map.rs | 3 +- crates/next-api/src/webpack_stats.rs | 3 +- crates/next-build-test/Cargo.toml | 1 + crates/next-build-test/src/lib.rs | 3 +- crates/next-core/Cargo.toml | 1 + crates/next-core/src/app_page_loader_tree.rs | 3 +- crates/next-core/src/app_segment_config.rs | 3 +- crates/next-core/src/app_structure.rs | 5 ++- crates/next-core/src/base_loader_tree.rs | 3 +- crates/next-core/src/embed_js.rs | 3 +- crates/next-core/src/hmr_entry.rs | 3 +- crates/next-core/src/instrumentation.rs | 3 +- crates/next-core/src/middleware.rs | 3 +- .../next_app/app_client_references_chunks.rs | 3 +- crates/next-core/src/next_app/app_entry.rs | 3 +- .../next-core/src/next_app/app_page_entry.rs | 3 +- .../next-core/src/next_app/app_route_entry.rs | 3 +- .../src/next_app/include_modules_module.rs | 3 +- .../next-core/src/next_app/metadata/image.rs | 3 +- crates/next-core/src/next_app/metadata/mod.rs | 3 +- crates/next-core/src/next_app/mod.rs | 3 +- crates/next-core/src/next_build.rs | 3 +- crates/next-core/src/next_client/context.rs | 3 +- .../ecmascript_client_reference_module.rs | 3 +- ...cmascript_client_reference_proxy_module.rs | 3 +- .../ecmascript_client_reference_transition.rs | 3 +- .../visit_client_reference.rs | 3 +- crates/next-core/src/next_config.rs | 3 +- .../src/next_dynamic/dynamic_module.rs | 3 +- .../src/next_dynamic/dynamic_transition.rs | 3 +- .../src/next_dynamic/visit_dynamic.rs | 3 +- crates/next-core/src/next_edge/context.rs | 3 +- crates/next-core/src/next_edge/entry.rs | 3 +- .../next-core/src/next_font/font_fallback.rs | 3 +- .../src/next_font/google/font_fallback.rs | 3 +- crates/next-core/src/next_font/google/mod.rs | 3 +- .../next-core/src/next_font/google/options.rs | 6 ++- .../next-core/src/next_font/google/request.rs | 2 +- .../src/next_font/google/stylesheet.rs | 3 +- crates/next-core/src/next_font/google/util.rs | 3 +- .../next-core/src/next_font/local/errors.rs | 2 +- .../src/next_font/local/font_fallback.rs | 2 +- crates/next-core/src/next_font/local/mod.rs | 3 +- .../next-core/src/next_font/local/options.rs | 3 +- .../next-core/src/next_font/local/request.rs | 3 +- .../src/next_font/local/stylesheet.rs | 3 +- crates/next-core/src/next_font/local/util.rs | 3 +- crates/next-core/src/next_font/stylesheet.rs | 3 +- crates/next-core/src/next_font/util.rs | 3 +- .../next-core/src/next_image/source_asset.rs | 3 +- crates/next-core/src/next_import_map.rs | 3 +- .../client_reference_manifest.rs | 3 +- crates/next-core/src/next_manifests/mod.rs | 3 +- crates/next-core/src/next_pages/page_entry.rs | 3 +- .../next-core/src/next_route_matcher/mod.rs | 3 +- crates/next-core/src/next_server/context.rs | 3 +- crates/next-core/src/next_server/resolve.rs | 3 +- .../server_component_module.rs | 3 +- .../server_component_reference.rs | 3 +- .../server_component_transition.rs | 3 +- crates/next-core/src/next_shared/resolve.rs | 3 +- .../transforms/swc_ecma_transform_plugins.rs | 2 +- .../src/next_shared/webpack_rules/mod.rs | 3 +- crates/next-core/src/next_telemetry.rs | 3 +- crates/next-core/src/page_loader.rs | 3 +- crates/next-core/src/pages_structure.rs | 3 +- crates/next-core/src/util.rs | 5 ++- turbopack/crates/turbo-rcstr/Cargo.toml | 13 ++++++ .../src/rcstr.rs => turbo-rcstr/src/lib.rs} | 10 +---- .../crates/turbo-tasks-backend/Cargo.toml | 1 + turbopack/crates/turbo-tasks-env/Cargo.toml | 1 + .../turbo-tasks-env/src/command_line.rs | 3 +- .../crates/turbo-tasks-env/src/custom.rs | 3 +- .../crates/turbo-tasks-env/src/dotenv.rs | 3 +- .../crates/turbo-tasks-env/src/filter.rs | 3 +- turbopack/crates/turbo-tasks-env/src/lib.rs | 3 +- turbopack/crates/turbo-tasks-fetch/Cargo.toml | 1 + turbopack/crates/turbo-tasks-fetch/src/lib.rs | 3 +- turbopack/crates/turbo-tasks-fs/Cargo.toml | 1 + .../turbo-tasks-fs/examples/hash_directory.rs | 3 +- .../turbo-tasks-fs/examples/hash_glob.rs | 3 +- turbopack/crates/turbo-tasks-fs/src/attach.rs | 3 +- .../crates/turbo-tasks-fs/src/embed/dir.rs | 3 +- .../crates/turbo-tasks-fs/src/embed/file.rs | 3 +- .../crates/turbo-tasks-fs/src/embed/fs.rs | 3 +- turbopack/crates/turbo-tasks-fs/src/glob.rs | 3 +- .../crates/turbo-tasks-fs/src/invalidation.rs | 5 +-- turbopack/crates/turbo-tasks-fs/src/lib.rs | 5 ++- .../crates/turbo-tasks-fs/src/read_glob.rs | 3 +- .../crates/turbo-tasks-fs/src/virtual_fs.rs | 3 +- .../crates/turbo-tasks-fs/src/watcher.rs | 3 +- .../crates/turbo-tasks-memory/Cargo.toml | 1 + .../crates/turbo-tasks-testing/Cargo.toml | 1 + .../turbo-tasks-testing/tests/all_in_one.rs | 3 +- .../turbo-tasks-testing/tests/collectibles.rs | 3 +- .../tests/dirty_in_progress.rs | 3 +- .../tests/recompute_collectibles.rs | 3 +- turbopack/crates/turbo-tasks/Cargo.toml | 1 + turbopack/crates/turbo-tasks/src/debug/mod.rs | 9 ++++- turbopack/crates/turbo-tasks/src/display.rs | 3 +- turbopack/crates/turbo-tasks/src/lib.rs | 2 - .../crates/turbo-tasks/src/primitives.rs | 3 +- .../crates/turbo-tasks/src/task/function.rs | 4 +- .../crates/turbo-tasks/src/task/task_input.rs | 3 +- turbopack/crates/turbo-tasks/src/trace.rs | 3 +- .../crates/turbo-tasks/src/vc/resolved.rs | 3 +- turbopack/crates/turbopack-browser/Cargo.toml | 1 + .../turbopack-browser/src/chunking_context.rs | 3 +- .../turbopack-browser/src/ecmascript/chunk.rs | 3 +- .../src/ecmascript/content.rs | 3 +- .../src/ecmascript/evaluate/chunk.rs | 3 +- .../src/ecmascript/list/asset.rs | 3 +- .../src/ecmascript/list/version.rs | 3 +- .../src/ecmascript/merged/version.rs | 3 +- .../src/ecmascript/version.rs | 3 +- turbopack/crates/turbopack-cli/Cargo.toml | 1 + .../crates/turbopack-cli/src/build/mod.rs | 3 +- .../crates/turbopack-cli/src/contexts.rs | 3 +- turbopack/crates/turbopack-cli/src/dev/mod.rs | 3 +- .../turbopack-cli/src/dev/web_entry_source.rs | 3 +- .../crates/turbopack-cli/src/embed_js.rs | 3 +- turbopack/crates/turbopack-cli/src/util.rs | 3 +- turbopack/crates/turbopack-core/Cargo.toml | 1 + turbopack/crates/turbopack-core/src/asset.rs | 3 +- .../turbopack-core/src/chunk/chunking.rs | 3 +- .../src/chunk/chunking_context.rs | 3 +- .../crates/turbopack-core/src/chunk/data.rs | 3 +- .../crates/turbopack-core/src/chunk/mod.rs | 5 ++- .../src/chunk/module_id_strategies.rs | 3 +- .../turbopack-core/src/compile_time_info.rs | 3 +- .../crates/turbopack-core/src/context.rs | 3 +- .../turbopack-core/src/diagnostics/mod.rs | 3 +- .../crates/turbopack-core/src/environment.rs | 3 +- .../crates/turbopack-core/src/file_source.rs | 3 +- turbopack/crates/turbopack-core/src/ident.rs | 3 +- .../turbopack-core/src/introspect/mod.rs | 3 +- .../turbopack-core/src/introspect/module.rs | 3 +- .../src/introspect/output_asset.rs | 3 +- .../turbopack-core/src/introspect/source.rs | 3 +- .../turbopack-core/src/introspect/utils.rs | 3 +- .../turbopack-core/src/issue/analyze.rs | 3 +- .../crates/turbopack-core/src/issue/mod.rs | 3 +- .../turbopack-core/src/issue/resolve.rs | 3 +- .../crates/turbopack-core/src/package_json.rs | 3 +- .../turbopack-core/src/reference/mod.rs | 3 +- .../src/reference/source_map.rs | 3 +- .../turbopack-core/src/reference_type.rs | 3 +- .../turbopack-core/src/resolve/alias_map.rs | 2 +- .../crates/turbopack-core/src/resolve/mod.rs | 5 ++- .../turbopack-core/src/resolve/options.rs | 5 ++- .../turbopack-core/src/resolve/origin.rs | 3 +- .../turbopack-core/src/resolve/parse.rs | 3 +- .../turbopack-core/src/resolve/pattern.rs | 5 ++- .../turbopack-core/src/resolve/plugin.rs | 3 +- .../turbopack-core/src/resolve/remap.rs | 3 +- .../crates/turbopack-core/src/server_fs.rs | 3 +- .../turbopack-core/src/source_map/mod.rs | 3 +- .../src/source_map/source_map_asset.rs | 3 +- .../crates/turbopack-core/src/version.rs | 3 +- turbopack/crates/turbopack-css/Cargo.toml | 1 + turbopack/crates/turbopack-css/src/asset.rs | 3 +- .../crates/turbopack-css/src/chunk/mod.rs | 5 +-- .../src/chunk/single_item_chunk/chunk.rs | 3 +- .../crates/turbopack-css/src/module_asset.rs | 3 +- turbopack/crates/turbopack-css/src/process.rs | 3 +- .../turbopack-css/src/references/compose.rs | 3 +- .../turbopack-css/src/references/import.rs | 3 +- .../turbopack-css/src/references/internal.rs | 3 +- .../turbopack-css/src/references/mod.rs | 3 +- .../turbopack-css/src/references/url.rs | 3 +- .../crates/turbopack-dev-server/Cargo.toml | 1 + .../crates/turbopack-dev-server/src/html.rs | 3 +- .../src/introspect/mod.rs | 3 +- .../src/source/asset_graph.rs | 5 ++- .../src/source/combined.rs | 3 +- .../src/source/conditional.rs | 3 +- .../src/source/issue_context.rs | 3 +- .../src/source/lazy_instantiated.rs | 3 +- .../turbopack-dev-server/src/source/mod.rs | 4 +- .../src/source/resolve.rs | 3 +- .../src/source/route_tree.rs | 3 +- .../turbopack-dev-server/src/source/router.rs | 3 +- .../src/source/static_assets.rs | 3 +- .../src/source/wrapping_source.rs | 3 +- .../turbopack-dev-server/src/update/stream.rs | 3 +- .../turbopack-ecmascript-plugins/Cargo.toml | 1 + .../src/transform/directives/client.rs | 3 +- .../src/transform/directives/server.rs | 3 +- .../turbopack-ecmascript-runtime/Cargo.toml | 1 + .../src/browser_runtime.rs | 3 +- .../src/embed_js.rs | 3 +- .../crates/turbopack-ecmascript/Cargo.toml | 1 + .../src/analyzer/graph.rs | 3 +- .../src/analyzer/imports.rs | 3 +- .../turbopack-ecmascript/src/analyzer/mod.rs | 3 +- .../src/async_chunk/chunk_item.rs | 3 +- .../src/async_chunk/module.rs | 3 +- .../src/chunk/chunk_type.rs | 3 +- .../turbopack-ecmascript/src/chunk/mod.rs | 3 +- .../src/chunk_group_files_asset.rs | 3 +- .../turbopack-ecmascript/src/code_gen.rs | 3 +- .../src/global_module_id_strategy.rs | 3 +- .../crates/turbopack-ecmascript/src/lib.rs | 3 +- .../src/manifest/chunk_asset.rs | 3 +- .../src/manifest/loader_item.rs | 3 +- .../crates/turbopack-ecmascript/src/parse.rs | 3 +- .../src/references/amd.rs | 4 +- .../src/references/cjs.rs | 3 +- .../src/references/esm/base.rs | 3 +- .../src/references/esm/binding.rs | 3 +- .../src/references/esm/dynamic.rs | 3 +- .../src/references/esm/export.rs | 3 +- .../src/references/esm/module_id.rs | 3 +- .../src/references/esm/url.rs | 3 +- .../src/references/external_module.rs | 3 +- .../src/references/mod.rs | 5 +-- .../src/references/node.rs | 3 +- .../src/references/pattern_mapping.rs | 4 +- .../src/references/raw.rs | 3 +- .../src/references/require_context.rs | 3 +- .../src/references/typescript.rs | 3 +- .../src/references/util.rs | 3 +- .../src/references/worker.rs | 3 +- .../src/side_effect_optimization/reference.rs | 3 +- .../turbopack-ecmascript/src/text/mod.rs | 3 +- .../turbopack-ecmascript/src/transform/mod.rs | 3 +- .../src/tree_shake/graph.rs | 3 +- .../src/tree_shake/mod.rs | 3 +- .../src/typescript/mod.rs | 3 +- .../turbopack-ecmascript/src/webpack/mod.rs | 3 +- .../src/worker_chunk/chunk_item.rs | 3 +- .../src/worker_chunk/module.rs | 3 +- turbopack/crates/turbopack-env/Cargo.toml | 1 + .../crates/turbopack-env/src/embeddable.rs | 3 +- turbopack/crates/turbopack-json/Cargo.toml | 1 + turbopack/crates/turbopack-json/src/lib.rs | 3 +- turbopack/crates/turbopack-mdx/Cargo.toml | 1 + turbopack/crates/turbopack-mdx/src/lib.rs | 3 +- turbopack/crates/turbopack-node/Cargo.toml | 4 +- .../crates/turbopack-node/src/embed_js.rs | 3 +- turbopack/crates/turbopack-node/src/lib.rs | 3 +- turbopack/crates/turbopack-node/src/pool.rs | 3 +- .../turbopack-node/src/render/error_page.rs | 3 +- .../crates/turbopack-node/src/render/mod.rs | 3 +- .../src/render/node_api_source.rs | 3 +- .../turbopack-node/src/render/render_proxy.rs | 5 ++- .../src/render/rendered_source.rs | 3 +- .../turbopack-node/src/route_matcher.rs | 3 +- .../turbopack-node/src/source_map/trace.rs | 3 +- .../turbopack-node/src/transforms/postcss.rs | 3 +- .../turbopack-node/src/transforms/util.rs | 3 +- .../turbopack-node/src/transforms/webpack.rs | 4 +- turbopack/crates/turbopack-nodejs/Cargo.toml | 1 + .../turbopack-nodejs/src/chunking_context.rs | 3 +- .../src/ecmascript/node/chunk.rs | 3 +- .../src/ecmascript/node/entry/chunk.rs | 3 +- .../src/ecmascript/node/entry/runtime.rs | 3 +- .../src/ecmascript/node/version.rs | 3 +- turbopack/crates/turbopack-resolve/Cargo.toml | 1 + .../src/node_native_binding.rs | 5 +-- .../src/resolve_options_context.rs | 3 +- .../turbopack-resolve/src/typescript.rs | 3 +- turbopack/crates/turbopack-static/Cargo.toml | 1 + turbopack/crates/turbopack-static/src/lib.rs | 3 +- .../crates/turbopack-swc-utils/Cargo.toml | 1 + .../crates/turbopack-swc-utils/src/emitter.rs | 3 +- .../crates/turbopack-test-utils/Cargo.toml | 1 + .../turbopack-test-utils/src/snapshot.rs | 3 +- turbopack/crates/turbopack-tests/Cargo.toml | 1 + .../crates/turbopack-tests/tests/execution.rs | 3 +- .../crates/turbopack-tests/tests/snapshot.rs | 4 +- .../crates/turbopack-tests/tests/util.rs | 2 +- turbopack/crates/turbopack-wasm/Cargo.toml | 1 + turbopack/crates/turbopack-wasm/src/loader.rs | 3 +- .../crates/turbopack-wasm/src/module_asset.rs | 3 +- .../crates/turbopack-wasm/src/output_asset.rs | 3 +- turbopack/crates/turbopack-wasm/src/raw.rs | 3 +- turbopack/crates/turbopack/Cargo.toml | 1 + .../turbopack/benches/node_file_trace.rs | 3 +- .../crates/turbopack/examples/turbopack.rs | 5 +-- .../crates/turbopack/src/evaluate_context.rs | 3 +- turbopack/crates/turbopack/src/lib.rs | 3 +- .../turbopack/src/module_options/mod.rs | 3 +- .../module_options/module_options_context.rs | 3 +- .../src/transition/context_transition.rs | 3 +- .../crates/turbopack/src/transition/mod.rs | 3 +- .../crates/turbopack/tests/node-file-trace.rs | 5 +-- 305 files changed, 638 insertions(+), 313 deletions(-) create mode 100644 turbopack/crates/turbo-rcstr/Cargo.toml rename turbopack/crates/{turbo-tasks/src/rcstr.rs => turbo-rcstr/src/lib.rs} (94%) diff --git a/Cargo.lock b/Cargo.lock index 287f07ea90ded9..5484193aed37e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3944,6 +3944,7 @@ dependencies = [ "shadow-rs", "swc_core", "tracing", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-env", @@ -3984,6 +3985,7 @@ dependencies = [ "tokio-stream", "tracing", "tracing-subscriber", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-env", @@ -4031,6 +4033,7 @@ dependencies = [ "swc_relay", "thiserror", "tracing", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-bytes", @@ -4118,6 +4121,7 @@ dependencies = [ "tracing", "tracing-chrome", "tracing-subscriber", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-backend", "turbo-tasks-build", @@ -8311,6 +8315,15 @@ dependencies = [ name = "turbo-prehash" version = "0.1.0" +[[package]] +name = "turbo-rcstr" +version = "0.1.0" +dependencies = [ + "serde", + "triomphe 0.1.12", + "turbo-tasks-hash", +] + [[package]] name = "turbo-static" version = "0.1.0" @@ -8360,6 +8373,7 @@ dependencies = [ "tokio-util", "tracing", "triomphe 0.1.12", + "turbo-rcstr", "turbo-tasks-build", "turbo-tasks-hash", "turbo-tasks-macros", @@ -8396,6 +8410,7 @@ dependencies = [ "tokio-scoped", "tracing", "turbo-prehash", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-hash", @@ -8438,6 +8453,7 @@ dependencies = [ "dotenvs", "indexmap 2.5.0", "serde", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-fs", @@ -8452,6 +8468,7 @@ dependencies = [ "reqwest", "serde", "tokio", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-fs", @@ -8490,6 +8507,7 @@ dependencies = [ "tempfile", "tokio", "tracing", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-hash", @@ -8576,6 +8594,7 @@ dependencies = [ "tokio", "tracing", "turbo-prehash", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-hash", @@ -8592,6 +8611,7 @@ dependencies = [ "futures", "rustc-hash 1.1.0", "tokio", + "turbo-rcstr", "turbo-tasks", ] @@ -8612,6 +8632,7 @@ dependencies = [ "serde_json", "tokio", "tracing", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-env", @@ -8666,6 +8687,7 @@ dependencies = [ "serde_json", "serde_qs", "tracing", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-fs", @@ -8693,6 +8715,7 @@ dependencies = [ "serde", "tokio", "tracing-subscriber", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-env", @@ -8755,6 +8778,7 @@ dependencies = [ "swc_core", "tokio", "tracing", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-env", @@ -8790,6 +8814,7 @@ dependencies = [ "smallvec", "swc_core", "tracing", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-fs", @@ -8823,6 +8848,7 @@ dependencies = [ "tokio-stream", "tokio-util", "tracing", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-bytes", @@ -8860,6 +8886,7 @@ dependencies = [ "swc_core", "tokio", "tracing", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-fs", @@ -8900,6 +8927,7 @@ dependencies = [ "swc_emotion", "swc_relay", "tracing", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-fs", @@ -8914,6 +8942,7 @@ dependencies = [ "anyhow", "indoc", "serde", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-fs", @@ -8929,6 +8958,7 @@ dependencies = [ "anyhow", "indexmap 2.5.0", "serde", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-env", @@ -8962,6 +8992,7 @@ dependencies = [ "anyhow", "serde", "serde_json", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-fs", @@ -8977,6 +9008,7 @@ dependencies = [ "markdown", "mdxjs", "serde", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-fs", @@ -9007,6 +9039,7 @@ dependencies = [ "serde_with", "tokio", "tracing", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-bytes", @@ -9028,6 +9061,7 @@ dependencies = [ "indoc", "serde", "tracing", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-fs", @@ -9049,6 +9083,7 @@ dependencies = [ "serde", "serde_json", "tracing", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-fs", @@ -9061,6 +9096,7 @@ version = "0.1.0" dependencies = [ "anyhow", "serde", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-fs", @@ -9075,6 +9111,7 @@ name = "turbopack-swc-utils" version = "0.1.0" dependencies = [ "swc_core", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbopack-core", @@ -9089,6 +9126,7 @@ dependencies = [ "regex", "serde", "similar", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-fs", @@ -9110,6 +9148,7 @@ dependencies = [ "serde_json", "testing", "tokio", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-bytes", @@ -9172,6 +9211,7 @@ dependencies = [ "indexmap 2.5.0", "indoc", "serde", + "turbo-rcstr", "turbo-tasks", "turbo-tasks-build", "turbo-tasks-fs", diff --git a/Cargo.toml b/Cargo.toml index 9bd55bd7a99b28..3566410bd36f45 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,6 +42,7 @@ next-custom-transforms = { path = "crates/next-custom-transforms" } auto-hash-map = { path = "turbopack/crates/turbo-tasks-auto-hash-map" } swc-ast-explorer = { path = "turbopack/crates/turbopack-swc-ast-explorer" } turbo-prehash = { path = "turbopack/crates/turbo-prehash" } +turbo-rcstr = { path = "turbopack/crates/turbo-rcstr" } turbo-tasks-malloc = { path = "turbopack/crates/turbo-tasks-malloc", default-features = false } turbo-tasks = { path = "turbopack/crates/turbo-tasks" } turbo-tasks-backend = { path = "turbopack/crates/turbo-tasks-backend" } diff --git a/crates/napi/Cargo.toml b/crates/napi/Cargo.toml index f878d36b5f2ff4..8d377853ad70a5 100644 --- a/crates/napi/Cargo.toml +++ b/crates/napi/Cargo.toml @@ -96,6 +96,7 @@ swc_core = { workspace = true, features = [ [target.'cfg(not(target_arch = "wasm32"))'.dependencies] lightningcss-napi = { workspace = true } tokio = { workspace = true, features = ["full"] } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-memory = { workspace = true } turbo-tasks-backend = { workspace = true } diff --git a/crates/napi/src/next_api/project.rs b/crates/napi/src/next_api/project.rs index c949c85050bed8..1ad7e650747b67 100644 --- a/crates/napi/src/next_api/project.rs +++ b/crates/napi/src/next_api/project.rs @@ -23,7 +23,8 @@ use rand::Rng; use tokio::{io::AsyncWriteExt, time::Instant}; use tracing::Instrument; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Registry}; -use turbo_tasks::{Completion, RcStr, ReadRef, TransientInstance, UpdateInfo, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Completion, ReadRef, TransientInstance, UpdateInfo, Vc}; use turbo_tasks_fs::{ util::uri_from_file, DiskFileSystem, FileContent, FileSystem, FileSystemPath, }; diff --git a/crates/next-api/Cargo.toml b/crates/next-api/Cargo.toml index a28c9ce8ca1181..431746269c50e6 100644 --- a/crates/next-api/Cargo.toml +++ b/crates/next-api/Cargo.toml @@ -22,6 +22,7 @@ serde = { workspace = true } serde_json = { workspace = true } shadow-rs = { workspace = true } tracing = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-env = { workspace = true } turbo-tasks-fs = { workspace = true } diff --git a/crates/next-api/src/app.rs b/crates/next-api/src/app.rs index 71897ad15660f4..06a231f68ba2f8 100644 --- a/crates/next-api/src/app.rs +++ b/crates/next-api/src/app.rs @@ -37,9 +37,10 @@ use next_core::{ }; use serde::{Deserialize, Serialize}; use tracing::Instrument; +use turbo_rcstr::RcStr; use turbo_tasks::{ - fxindexset, trace::TraceRawVcs, Completion, FxIndexMap, FxIndexSet, RcStr, ResolvedVc, - TryJoinIterExt, Value, ValueToString, Vc, + fxindexset, trace::TraceRawVcs, Completion, FxIndexMap, FxIndexSet, ResolvedVc, TryJoinIterExt, + Value, ValueToString, Vc, }; use turbo_tasks_env::{CustomProcessEnv, ProcessEnv}; use turbo_tasks_fs::{File, FileContent, FileSystemPath}; diff --git a/crates/next-api/src/dynamic_imports.rs b/crates/next-api/src/dynamic_imports.rs index 98d4cf68ee9cc9..422f791f05148e 100644 --- a/crates/next-api/src/dynamic_imports.rs +++ b/crates/next-api/src/dynamic_imports.rs @@ -8,10 +8,11 @@ use swc_core::ecma::{ visit::{Visit, VisitWith}, }; use tracing::{Instrument, Level}; +use turbo_rcstr::RcStr; use turbo_tasks::{ graph::{GraphTraversal, NonDeterministic, VisitControlFlow, VisitedNodes}, trace::TraceRawVcs, - FxIndexMap, RcStr, ReadRef, ResolvedVc, TryJoinIterExt, Value, ValueToString, Vc, + FxIndexMap, ReadRef, ResolvedVc, TryJoinIterExt, Value, ValueToString, Vc, }; use turbopack_core::{ chunk::{ diff --git a/crates/next-api/src/entrypoints.rs b/crates/next-api/src/entrypoints.rs index f7c6bc84b23bc1..cc7be9c9cbb90f 100644 --- a/crates/next-api/src/entrypoints.rs +++ b/crates/next-api/src/entrypoints.rs @@ -1,4 +1,5 @@ -use turbo_tasks::{FxIndexMap, RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, Vc}; use crate::{ project::{Instrumentation, Middleware}, diff --git a/crates/next-api/src/font.rs b/crates/next-api/src/font.rs index bd0c2c7d71a747..de24b5aac4853f 100644 --- a/crates/next-api/src/font.rs +++ b/crates/next-api/src/font.rs @@ -1,6 +1,7 @@ use anyhow::Result; use next_core::{all_assets_from_entries, next_manifests::NextFontManifest}; -use turbo_tasks::{RcStr, ResolvedVc, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, ValueToString, Vc}; use turbo_tasks_fs::{File, FileSystemPath}; use turbopack_core::{ asset::AssetContent, diff --git a/crates/next-api/src/instrumentation.rs b/crates/next-api/src/instrumentation.rs index 1d27843831f2dc..cd0d6a57f9131d 100644 --- a/crates/next-api/src/instrumentation.rs +++ b/crates/next-api/src/instrumentation.rs @@ -6,7 +6,8 @@ use next_core::{ next_server::{get_server_runtime_entries, ServerContextType}, }; use tracing::Instrument; -use turbo_tasks::{Completion, RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Completion, ResolvedVc, Value, Vc}; use turbo_tasks_fs::{File, FileContent, FileSystemPath}; use turbopack_core::{ asset::AssetContent, diff --git a/crates/next-api/src/loadable_manifest.rs b/crates/next-api/src/loadable_manifest.rs index e0f4cccd094b72..e46d75adf05431 100644 --- a/crates/next-api/src/loadable_manifest.rs +++ b/crates/next-api/src/loadable_manifest.rs @@ -2,7 +2,8 @@ use std::collections::HashMap; use anyhow::Result; use next_core::next_manifests::LoadableManifest; -use turbo_tasks::{RcStr, ResolvedVc, TryFlatJoinIterExt, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, TryFlatJoinIterExt, Vc}; use turbo_tasks_fs::{File, FileContent, FileSystemPath}; use turbopack_core::{ asset::AssetContent, diff --git a/crates/next-api/src/middleware.rs b/crates/next-api/src/middleware.rs index c9bc87ea64eb08..ddffd8a2fe36bb 100644 --- a/crates/next-api/src/middleware.rs +++ b/crates/next-api/src/middleware.rs @@ -8,7 +8,8 @@ use next_core::{ util::{parse_config_from_source, MiddlewareMatcherKind}, }; use tracing::Instrument; -use turbo_tasks::{Completion, RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Completion, ResolvedVc, Value, Vc}; use turbo_tasks_fs::{self, File, FileContent, FileSystemPath}; use turbopack_core::{ asset::AssetContent, diff --git a/crates/next-api/src/nft_json.rs b/crates/next-api/src/nft_json.rs index 14c632d423f718..fd7811802a3b25 100644 --- a/crates/next-api/src/nft_json.rs +++ b/crates/next-api/src/nft_json.rs @@ -1,6 +1,7 @@ use anyhow::{bail, Result}; use serde_json::json; -use turbo_tasks::{RcStr, ResolvedVc, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, ValueToString, Vc}; use turbo_tasks_fs::{DiskFileSystem, File, FileSystem, FileSystemPath, VirtualFileSystem}; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/crates/next-api/src/pages.rs b/crates/next-api/src/pages.rs index be23f53ade9df0..99cfd27586d9bc 100644 --- a/crates/next-api/src/pages.rs +++ b/crates/next-api/src/pages.rs @@ -27,9 +27,9 @@ use next_core::{ }; use serde::{Deserialize, Serialize}; use tracing::Instrument; +use turbo_rcstr::RcStr; use turbo_tasks::{ - trace::TraceRawVcs, Completion, FxIndexMap, RcStr, ResolvedVc, TaskInput, TryJoinIterExt, - Value, Vc, + trace::TraceRawVcs, Completion, FxIndexMap, ResolvedVc, TaskInput, TryJoinIterExt, Value, Vc, }; use turbo_tasks_fs::{ self, File, FileContent, FileSystem, FileSystemPath, FileSystemPathOption, VirtualFileSystem, diff --git a/crates/next-api/src/paths.rs b/crates/next-api/src/paths.rs index 71aacc9ec9dc07..e3f2c77f52aaec 100644 --- a/crates/next-api/src/paths.rs +++ b/crates/next-api/src/paths.rs @@ -1,7 +1,8 @@ use anyhow::Result; use next_core::{all_assets_from_entries, next_manifests::AssetBinding}; use serde::{Deserialize, Serialize}; -use turbo_tasks::{trace::TraceRawVcs, RcStr, ResolvedVc, TryFlatJoinIterExt, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{trace::TraceRawVcs, ResolvedVc, TryFlatJoinIterExt, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/crates/next-api/src/project.rs b/crates/next-api/src/project.rs index 5f18177b2cc035..f346ad6c71f5f6 100644 --- a/crates/next-api/src/project.rs +++ b/crates/next-api/src/project.rs @@ -22,13 +22,14 @@ use next_core::{ }; use serde::{Deserialize, Serialize}; use tracing::Instrument; +use turbo_rcstr::RcStr; use turbo_tasks::{ debug::ValueDebugFormat, fxindexmap, graph::{AdjacencyMap, GraphTraversal}, trace::TraceRawVcs, - Completion, Completions, FxIndexMap, IntoTraitRef, RcStr, ReadRef, ResolvedVc, State, - TaskInput, TransientInstance, TryFlatJoinIterExt, Value, Vc, + Completion, Completions, FxIndexMap, IntoTraitRef, ReadRef, ResolvedVc, State, TaskInput, + TransientInstance, TryFlatJoinIterExt, Value, Vc, }; use turbo_tasks_env::{EnvMap, ProcessEnv}; use turbo_tasks_fs::{DiskFileSystem, FileSystem, FileSystemPath, VirtualFileSystem}; diff --git a/crates/next-api/src/route.rs b/crates/next-api/src/route.rs index 36b6da8d84e861..ce894fa1ff38d0 100644 --- a/crates/next-api/src/route.rs +++ b/crates/next-api/src/route.rs @@ -1,6 +1,7 @@ use anyhow::Result; use serde::{Deserialize, Serialize}; -use turbo_tasks::{debug::ValueDebugFormat, trace::TraceRawVcs, Completion, FxIndexMap, RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{debug::ValueDebugFormat, trace::TraceRawVcs, Completion, FxIndexMap, Vc}; use turbopack_core::module::Modules; use crate::paths::ServerPath; diff --git a/crates/next-api/src/server_actions.rs b/crates/next-api/src/server_actions.rs index 7fcd6ca341def2..ddec197beee2c8 100644 --- a/crates/next-api/src/server_actions.rs +++ b/crates/next-api/src/server_actions.rs @@ -17,9 +17,10 @@ use swc_core::{ }, }; use tracing::Instrument; +use turbo_rcstr::RcStr; use turbo_tasks::{ graph::{GraphTraversal, NonDeterministic}, - FxIndexMap, RcStr, ResolvedVc, TryFlatJoinIterExt, Value, ValueToString, Vc, + FxIndexMap, ResolvedVc, TryFlatJoinIterExt, Value, ValueToString, Vc, }; use turbo_tasks_fs::{self, rope::RopeBuilder, File, FileSystemPath}; use turbopack_core::{ diff --git a/crates/next-api/src/versioned_content_map.rs b/crates/next-api/src/versioned_content_map.rs index 857a5b5b36c7d2..65af91d71c903e 100644 --- a/crates/next-api/src/versioned_content_map.rs +++ b/crates/next-api/src/versioned_content_map.rs @@ -3,8 +3,9 @@ use std::collections::{HashMap, HashSet}; use anyhow::{bail, Result}; use next_core::emit_assets; use serde::{Deserialize, Serialize}; +use turbo_rcstr::RcStr; use turbo_tasks::{ - debug::ValueDebugFormat, trace::TraceRawVcs, Completion, FxIndexSet, RcStr, ResolvedVc, State, + debug::ValueDebugFormat, trace::TraceRawVcs, Completion, FxIndexSet, ResolvedVc, State, TryFlatJoinIterExt, TryJoinIterExt, ValueDefault, ValueToString, Vc, }; use turbo_tasks_fs::FileSystemPath; diff --git a/crates/next-api/src/webpack_stats.rs b/crates/next-api/src/webpack_stats.rs index fdd989f1e0d4eb..6dcced25800122 100644 --- a/crates/next-api/src/webpack_stats.rs +++ b/crates/next-api/src/webpack_stats.rs @@ -1,6 +1,7 @@ use anyhow::Result; use serde::Serialize; -use turbo_tasks::{FxIndexMap, FxIndexSet, RcStr, ResolvedVc, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, FxIndexSet, ResolvedVc, Vc}; use turbopack_browser::ecmascript::EcmascriptDevChunk; use turbopack_core::{ chunk::{Chunk, ChunkItem}, diff --git a/crates/next-build-test/Cargo.toml b/crates/next-build-test/Cargo.toml index 6ad2628882cb18..4ac6c2a1dc6b59 100644 --- a/crates/next-build-test/Cargo.toml +++ b/crates/next-build-test/Cargo.toml @@ -21,6 +21,7 @@ tokio = { workspace = true, features = ["full"] } tokio-stream = "0.1.15" tracing = "0.1" tracing-subscriber = "0.3" +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-env = { workspace = true } turbo-tasks-fs = { workspace = true } diff --git a/crates/next-build-test/src/lib.rs b/crates/next-build-test/src/lib.rs index 6636b418d237f7..e05e37d89845b7 100644 --- a/crates/next-build-test/src/lib.rs +++ b/crates/next-build-test/src/lib.rs @@ -11,7 +11,8 @@ use next_api::{ project::{ProjectContainer, ProjectOptions}, route::{Endpoint, Route}, }; -use turbo_tasks::{RcStr, ReadConsistency, TransientInstance, TurboTasks, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ReadConsistency, TransientInstance, TurboTasks, Vc}; use turbo_tasks_malloc::TurboMalloc; use turbo_tasks_memory::MemoryBackend; diff --git a/crates/next-core/Cargo.toml b/crates/next-core/Cargo.toml index f5bce8214cf269..2c03a3cafb56d2 100644 --- a/crates/next-core/Cargo.toml +++ b/crates/next-core/Cargo.toml @@ -57,6 +57,7 @@ swc_core = { workspace = true, features = [ modularize_imports = { workspace = true } swc_relay = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-bytes = { workspace = true } turbo-tasks-env = { workspace = true } diff --git a/crates/next-core/src/app_page_loader_tree.rs b/crates/next-core/src/app_page_loader_tree.rs index f639414f7e57f3..befe56f1a84cae 100644 --- a/crates/next-core/src/app_page_loader_tree.rs +++ b/crates/next-core/src/app_page_loader_tree.rs @@ -4,7 +4,8 @@ use std::{ }; use anyhow::Result; -use turbo_tasks::{FxIndexMap, RcStr, ResolvedVc, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, ResolvedVc, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack::{transition::Transition, ModuleAssetContext}; use turbopack_core::{file_source::FileSource, module::Module}; diff --git a/crates/next-core/src/app_segment_config.rs b/crates/next-core/src/app_segment_config.rs index 175ea21be1a92e..0be48b6e12ccdb 100644 --- a/crates/next-core/src/app_segment_config.rs +++ b/crates/next-core/src/app_segment_config.rs @@ -7,7 +7,8 @@ use swc_core::{ common::{source_map::SmallPos, Span, Spanned, GLOBALS}, ecma::ast::{Decl, Expr, FnExpr, Ident, Program}, }; -use turbo_tasks::{trace::TraceRawVcs, RcStr, TryJoinIterExt, ValueDefault, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{trace::TraceRawVcs, TryJoinIterExt, ValueDefault, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ file_source::FileSource, diff --git a/crates/next-core/src/app_structure.rs b/crates/next-core/src/app_structure.rs index 194d31c1829872..813d95c435325d 100644 --- a/crates/next-core/src/app_structure.rs +++ b/crates/next-core/src/app_structure.rs @@ -5,9 +5,10 @@ use indexmap::map::{Entry, OccupiedEntry}; use rustc_hash::FxHashMap; use serde::{Deserialize, Serialize}; use tracing::Instrument; +use turbo_rcstr::RcStr; use turbo_tasks::{ - debug::ValueDebugFormat, fxindexmap, trace::TraceRawVcs, FxIndexMap, RcStr, ResolvedVc, - TaskInput, TryJoinIterExt, ValueDefault, ValueToString, Vc, + debug::ValueDebugFormat, fxindexmap, trace::TraceRawVcs, FxIndexMap, ResolvedVc, TaskInput, + TryJoinIterExt, ValueDefault, ValueToString, Vc, }; use turbo_tasks_fs::{DirectoryContent, DirectoryEntry, FileSystemEntryType, FileSystemPath}; use turbopack_core::issue::{ diff --git a/crates/next-core/src/base_loader_tree.rs b/crates/next-core/src/base_loader_tree.rs index 686041654c8a0c..df25100d7625e2 100644 --- a/crates/next-core/src/base_loader_tree.rs +++ b/crates/next-core/src/base_loader_tree.rs @@ -1,6 +1,7 @@ use anyhow::Result; use indoc::formatdoc; -use turbo_tasks::{FxIndexMap, RcStr, ResolvedVc, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, ResolvedVc, Value, ValueToString, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack::{transition::Transition, ModuleAssetContext}; use turbopack_core::{ diff --git a/crates/next-core/src/embed_js.rs b/crates/next-core/src/embed_js.rs index 9a7eee773ca37b..1944d5a46b5d11 100644 --- a/crates/next-core/src/embed_js.rs +++ b/crates/next-core/src/embed_js.rs @@ -1,4 +1,5 @@ -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbo_tasks_fs::{FileContent, FileSystem, FileSystemPath}; use turbopack_core::{file_source::FileSource, source::Source}; diff --git a/crates/next-core/src/hmr_entry.rs b/crates/next-core/src/hmr_entry.rs index dc5420add986d5..38f60b4dc97726 100644 --- a/crates/next-core/src/hmr_entry.rs +++ b/crates/next-core/src/hmr_entry.rs @@ -1,7 +1,8 @@ use std::io::Write; use anyhow::Result; -use turbo_tasks::{RcStr, ResolvedVc, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, ValueToString, Vc}; use turbo_tasks_fs::{glob::Glob, rope::RopeBuilder}; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/crates/next-core/src/instrumentation.rs b/crates/next-core/src/instrumentation.rs index be5d31570745c3..582ede3b7d078e 100644 --- a/crates/next-core/src/instrumentation.rs +++ b/crates/next-core/src/instrumentation.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; #[turbo_tasks::function] pub async fn instrumentation_files(page_extensions: Vc>) -> Result>> { diff --git a/crates/next-core/src/middleware.rs b/crates/next-core/src/middleware.rs index 57649cefa49fb5..57efacc7563c0e 100644 --- a/crates/next-core/src/middleware.rs +++ b/crates/next-core/src/middleware.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{fxindexmap, FxIndexMap, RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{fxindexmap, FxIndexMap, ResolvedVc, Value, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{context::AssetContext, module::Module, reference_type::ReferenceType}; diff --git a/crates/next-core/src/next_app/app_client_references_chunks.rs b/crates/next-core/src/next_app/app_client_references_chunks.rs index 0ea549a80e8208..489231ac754b51 100644 --- a/crates/next-core/src/next_app/app_client_references_chunks.rs +++ b/crates/next-core/src/next_app/app_client_references_chunks.rs @@ -1,7 +1,8 @@ use anyhow::Result; use tracing::Instrument; +use turbo_rcstr::RcStr; use turbo_tasks::{ - FxIndexMap, RcStr, ResolvedVc, TryFlatJoinIterExt, TryJoinIterExt, Value, ValueToString, Vc, + FxIndexMap, ResolvedVc, TryFlatJoinIterExt, TryJoinIterExt, Value, ValueToString, Vc, }; use turbopack_core::{ chunk::{availability_info::AvailabilityInfo, ChunkingContext, ChunkingContextExt}, diff --git a/crates/next-core/src/next_app/app_entry.rs b/crates/next-core/src/next_app/app_entry.rs index 5c3cf7b04961fb..dc143c4d917a1d 100644 --- a/crates/next-core/src/next_app/app_entry.rs +++ b/crates/next-core/src/next_app/app_entry.rs @@ -1,4 +1,5 @@ -use turbo_tasks::{RcStr, ResolvedVc, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Vc}; use turbopack_core::module::Module; use crate::app_segment_config::NextSegmentConfig; diff --git a/crates/next-core/src/next_app/app_page_entry.rs b/crates/next-core/src/next_app/app_page_entry.rs index f1b7ebb24ea38f..6f2229fc5698ab 100644 --- a/crates/next-core/src/next_app/app_page_entry.rs +++ b/crates/next-core/src/next_app/app_page_entry.rs @@ -1,7 +1,8 @@ use std::io::Write; use anyhow::Result; -use turbo_tasks::{fxindexmap, RcStr, ResolvedVc, TryJoinIterExt, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{fxindexmap, ResolvedVc, TryJoinIterExt, Value, ValueToString, Vc}; use turbo_tasks_fs::{self, rope::RopeBuilder, File, FileSystemPath}; use turbopack::ModuleAssetContext; use turbopack_core::{ diff --git a/crates/next-core/src/next_app/app_route_entry.rs b/crates/next-core/src/next_app/app_route_entry.rs index a875592622ad40..2280269a50549e 100644 --- a/crates/next-core/src/next_app/app_route_entry.rs +++ b/crates/next-core/src/next_app/app_route_entry.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{fxindexmap, RcStr, ResolvedVc, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{fxindexmap, ResolvedVc, Value, ValueToString, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack::ModuleAssetContext; use turbopack_core::{ diff --git a/crates/next-core/src/next_app/include_modules_module.rs b/crates/next-core/src/next_app/include_modules_module.rs index 093ff30080a19e..a12131c7bd7d7c 100644 --- a/crates/next-core/src/next_app/include_modules_module.rs +++ b/crates/next-core/src/next_app/include_modules_module.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, ResolvedVc, TryJoinIterExt, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, TryJoinIterExt, ValueToString, Vc}; use turbo_tasks_fs::glob::Glob; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/crates/next-core/src/next_app/metadata/image.rs b/crates/next-core/src/next_app/metadata/image.rs index b396d67d25e964..7a41a3b6a1723e 100644 --- a/crates/next-core/src/next_app/metadata/image.rs +++ b/crates/next-core/src/next_app/metadata/image.rs @@ -4,7 +4,8 @@ use anyhow::{bail, Result}; use indoc::formatdoc; -use turbo_tasks::{RcStr, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ValueToString, Vc}; use turbo_tasks_fs::{File, FileContent, FileSystemPath}; use turbo_tasks_hash::hash_xxh3_hash64; use turbopack_core::{ diff --git a/crates/next-core/src/next_app/metadata/mod.rs b/crates/next-core/src/next_app/metadata/mod.rs index 08af0f5908a727..f0d1ae1da797e4 100644 --- a/crates/next-core/src/next_app/metadata/mod.rs +++ b/crates/next-core/src/next_app/metadata/mod.rs @@ -2,7 +2,8 @@ use std::{collections::HashMap, ops::Deref}; use anyhow::Result; use once_cell::sync::Lazy; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbo_tasks_fs::FileSystemPath; use crate::next_app::{AppPage, PageSegment, PageType}; diff --git a/crates/next-core/src/next_app/mod.rs b/crates/next-core/src/next_app/mod.rs index 15087647985311..fb5740bc4d123f 100644 --- a/crates/next-core/src/next_app/mod.rs +++ b/crates/next-core/src/next_app/mod.rs @@ -14,7 +14,8 @@ use std::{ use anyhow::{bail, Result}; use serde::{Deserialize, Serialize}; -use turbo_tasks::{trace::TraceRawVcs, RcStr, TaskInput}; +use turbo_rcstr::RcStr; +use turbo_tasks::{trace::TraceRawVcs, TaskInput}; pub use crate::next_app::{ app_client_references_chunks::{get_app_client_references_chunks, ClientReferencesChunks}, diff --git a/crates/next-core/src/next_build.rs b/crates/next-core/src/next_build.rs index 56267568759597..e9ae92fd55f6e0 100644 --- a/crates/next-core/src/next_build.rs +++ b/crates/next-core/src/next_build.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, ResolvedVc, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::resolve::{options::ImportMapping, ExternalType}; diff --git a/crates/next-core/src/next_client/context.rs b/crates/next-core/src/next_client/context.rs index 97d27e84ca4446..b46a44c3e16b4b 100644 --- a/crates/next-core/src/next_client/context.rs +++ b/crates/next-core/src/next_client/context.rs @@ -1,7 +1,8 @@ use std::iter::once; use anyhow::Result; -use turbo_tasks::{FxIndexMap, RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, ResolvedVc, Value, Vc}; use turbo_tasks_env::EnvMap; use turbo_tasks_fs::{FileSystem, FileSystemPath}; use turbopack::{ diff --git a/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_module.rs b/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_module.rs index e83bb7662fc5f4..906f39b0d6b968 100644 --- a/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_module.rs +++ b/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_module.rs @@ -1,6 +1,7 @@ #![allow(rustdoc::private_intra_doc_links)] use anyhow::{bail, Result}; -use turbo_tasks::{RcStr, ResolvedVc, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Vc}; use turbopack_core::{ asset::{Asset, AssetContent}, ident::AssetIdent, diff --git a/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_proxy_module.rs b/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_proxy_module.rs index e5577f1644c3b7..68ac130b65ca8c 100644 --- a/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_proxy_module.rs +++ b/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_proxy_module.rs @@ -2,7 +2,8 @@ use std::{io::Write, iter::once}; use anyhow::{bail, Context, Result}; use indoc::writedoc; -use turbo_tasks::{RcStr, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Value, ValueToString, Vc}; use turbo_tasks_fs::File; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_transition.rs b/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_transition.rs index 4096364afccf0e..08a41cbb9ba65e 100644 --- a/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_transition.rs +++ b/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_transition.rs @@ -1,5 +1,6 @@ use anyhow::{bail, Result}; -use turbo_tasks::{RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Value, Vc}; use turbopack::{ transition::{ContextTransition, Transition}, ModuleAssetContext, diff --git a/crates/next-core/src/next_client_reference/visit_client_reference.rs b/crates/next-core/src/next_client_reference/visit_client_reference.rs index 780b8745dc70dc..3626cf364d0207 100644 --- a/crates/next-core/src/next_client_reference/visit_client_reference.rs +++ b/crates/next-core/src/next_client_reference/visit_client_reference.rs @@ -3,11 +3,12 @@ use std::{collections::HashSet, future::Future}; use anyhow::Result; use serde::{Deserialize, Serialize}; use tracing::Instrument; +use turbo_rcstr::RcStr; use turbo_tasks::{ debug::ValueDebugFormat, graph::{AdjacencyMap, GraphTraversal, Visit, VisitControlFlow, VisitedNodes}, trace::TraceRawVcs, - FxIndexMap, FxIndexSet, RcStr, ReadRef, ResolvedVc, TryJoinIterExt, ValueToString, Vc, + FxIndexMap, FxIndexSet, ReadRef, ResolvedVc, TryJoinIterExt, ValueToString, Vc, }; use turbo_tasks_fs::FileSystemPath; use turbopack::css::CssModuleAsset; diff --git a/crates/next-core/src/next_config.rs b/crates/next-core/src/next_config.rs index ba271446d2aba2..e5b20e16c45b76 100644 --- a/crates/next-core/src/next_config.rs +++ b/crates/next-core/src/next_config.rs @@ -3,7 +3,8 @@ use std::collections::HashSet; use anyhow::{bail, Context, Result}; use serde::{Deserialize, Deserializer, Serialize}; use serde_json::Value as JsonValue; -use turbo_tasks::{trace::TraceRawVcs, FxIndexMap, RcStr, ResolvedVc, TaskInput, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{trace::TraceRawVcs, FxIndexMap, ResolvedVc, TaskInput, Vc}; use turbo_tasks_env::EnvMap; use turbo_tasks_fs::FileSystemPath; use turbopack::module_options::{ diff --git a/crates/next-core/src/next_dynamic/dynamic_module.rs b/crates/next-core/src/next_dynamic/dynamic_module.rs index 70c9747185bb8b..f6b52079a118ea 100644 --- a/crates/next-core/src/next_dynamic/dynamic_module.rs +++ b/crates/next-core/src/next_dynamic/dynamic_module.rs @@ -1,5 +1,6 @@ use anyhow::{bail, Result}; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbopack_core::{ asset::{Asset, AssetContent}, chunk::{ChunkableModule, ChunkingContext, ChunkingContextExt}, diff --git a/crates/next-core/src/next_dynamic/dynamic_transition.rs b/crates/next-core/src/next_dynamic/dynamic_transition.rs index 097adb09248e2c..1a3372d4fc8d70 100644 --- a/crates/next-core/src/next_dynamic/dynamic_transition.rs +++ b/crates/next-core/src/next_dynamic/dynamic_transition.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Value, Vc}; use turbopack::{transition::Transition, ModuleAssetContext}; use turbopack_core::{context::ProcessResult, reference_type::ReferenceType, source::Source}; diff --git a/crates/next-core/src/next_dynamic/visit_dynamic.rs b/crates/next-core/src/next_dynamic/visit_dynamic.rs index 568c9222fddf55..1caac76354a818 100644 --- a/crates/next-core/src/next_dynamic/visit_dynamic.rs +++ b/crates/next-core/src/next_dynamic/visit_dynamic.rs @@ -2,9 +2,10 @@ use std::future::Future; use anyhow::Result; use tracing::Instrument; +use turbo_rcstr::RcStr; use turbo_tasks::{ graph::{AdjacencyMap, GraphTraversal, Visit, VisitControlFlow}, - RcStr, ReadRef, ResolvedVc, TryJoinIterExt, ValueToString, Vc, + ReadRef, ResolvedVc, TryJoinIterExt, ValueToString, Vc, }; use turbopack_core::{ module::{Module, Modules}, diff --git a/crates/next-core/src/next_edge/context.rs b/crates/next-core/src/next_edge/context.rs index bab4981138dc33..6994e30fd59f6d 100644 --- a/crates/next-core/src/next_edge/context.rs +++ b/crates/next-core/src/next_edge/context.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{FxIndexMap, RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, ResolvedVc, Value, Vc}; use turbo_tasks_env::EnvMap; use turbo_tasks_fs::FileSystemPath; use turbopack::resolve_options_context::ResolveOptionsContext; diff --git a/crates/next-core/src/next_edge/entry.rs b/crates/next-core/src/next_edge/entry.rs index 935bc36e58f78f..cd0096894289fe 100644 --- a/crates/next-core/src/next_edge/entry.rs +++ b/crates/next-core/src/next_edge/entry.rs @@ -1,5 +1,6 @@ use indoc::formatdoc; -use turbo_tasks::{fxindexmap, RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{fxindexmap, ResolvedVc, Value, Vc}; use turbo_tasks_fs::{File, FileSystemPath}; use turbopack_core::{ asset::AssetContent, context::AssetContext, module::Module, reference_type::ReferenceType, diff --git a/crates/next-core/src/next_font/font_fallback.rs b/crates/next-core/src/next_font/font_fallback.rs index 923b449b305de6..73e7cb901ac81e 100644 --- a/crates/next-core/src/next_font/font_fallback.rs +++ b/crates/next-core/src/next_font/font_fallback.rs @@ -1,7 +1,8 @@ use anyhow::Result; use once_cell::sync::Lazy; use serde::{Deserialize, Serialize}; -use turbo_tasks::{trace::TraceRawVcs, RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{trace::TraceRawVcs, Vc}; pub(crate) struct DefaultFallbackFont { pub name: RcStr, diff --git a/crates/next-core/src/next_font/google/font_fallback.rs b/crates/next-core/src/next_font/google/font_fallback.rs index 356c8cc64cad03..363d0bf1ebd84b 100644 --- a/crates/next-core/src/next_font/google/font_fallback.rs +++ b/crates/next-core/src/next_font/google/font_fallback.rs @@ -4,7 +4,8 @@ use anyhow::{Context, Result}; use once_cell::sync::Lazy; use regex::Regex; use serde::{Deserialize, Serialize}; -use turbo_tasks::{trace::TraceRawVcs, RcStr, ResolvedVc, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{trace::TraceRawVcs, ResolvedVc, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::issue::{IssueExt, IssueSeverity, StyledString}; diff --git a/crates/next-core/src/next_font/google/mod.rs b/crates/next-core/src/next_font/google/mod.rs index f2922f64f9d450..78baf40968584e 100644 --- a/crates/next-core/src/next_font/google/mod.rs +++ b/crates/next-core/src/next_font/google/mod.rs @@ -4,7 +4,8 @@ use anyhow::{bail, Context, Result}; use futures::FutureExt; use indoc::formatdoc; use serde::{Deserialize, Serialize}; -use turbo_tasks::{Completion, FxIndexMap, RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Completion, FxIndexMap, ResolvedVc, Value, Vc}; use turbo_tasks_bytes::stream::SingleValue; use turbo_tasks_env::{CommandLineProcessEnv, ProcessEnv}; use turbo_tasks_fetch::{fetch, HttpResponseBody}; diff --git a/crates/next-core/src/next_font/google/options.rs b/crates/next-core/src/next_font/google/options.rs index 55b37ced586507..83bdf653f420ef 100644 --- a/crates/next-core/src/next_font/google/options.rs +++ b/crates/next-core/src/next_font/google/options.rs @@ -1,6 +1,7 @@ use anyhow::{Context, Result}; use serde::{Deserialize, Serialize}; -use turbo_tasks::{fxindexset, trace::TraceRawVcs, FxIndexMap, FxIndexSet, RcStr, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{fxindexset, trace::TraceRawVcs, FxIndexMap, FxIndexSet, Value, Vc}; use super::request::{NextFontRequest, OneOrManyStrings}; @@ -200,7 +201,8 @@ pub(super) fn options_from_request( #[cfg(test)] mod tests { use anyhow::Result; - use turbo_tasks::{FxIndexMap, RcStr}; + use turbo_rcstr::RcStr; + use turbo_tasks::FxIndexMap; use turbo_tasks_fs::json::parse_json_with_source_context; use super::{options_from_request, FontDataEntry, NextFontGoogleOptions}; diff --git a/crates/next-core/src/next_font/google/request.rs b/crates/next-core/src/next_font/google/request.rs index e312757b2f5e1e..8ba52fa54d1f4d 100644 --- a/crates/next-core/src/next_font/google/request.rs +++ b/crates/next-core/src/next_font/google/request.rs @@ -1,5 +1,5 @@ use serde::Deserialize; -use turbo_tasks::RcStr; +use turbo_rcstr::RcStr; /// The top-most structure encoded into the query param in requests to /// `next/font/google` generated by the next/font swc transform. e.g. diff --git a/crates/next-core/src/next_font/google/stylesheet.rs b/crates/next-core/src/next_font/google/stylesheet.rs index 7ea9badf8a1c0f..f346abd2da60ad 100644 --- a/crates/next-core/src/next_font/google/stylesheet.rs +++ b/crates/next-core/src/next_font/google/stylesheet.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use super::FontCssProperties; use crate::next_font::{ diff --git a/crates/next-core/src/next_font/google/util.rs b/crates/next-core/src/next_font/google/util.rs index 28819476ab0a65..a3270235de817c 100644 --- a/crates/next-core/src/next_font/google/util.rs +++ b/crates/next-core/src/next_font/google/util.rs @@ -1,7 +1,8 @@ use std::{cmp::Ordering, collections::BTreeSet}; use anyhow::{bail, Context, Result}; -use turbo_tasks::{FxIndexSet, RcStr}; +use turbo_rcstr::RcStr; +use turbo_tasks::FxIndexSet; use super::options::{FontData, FontWeights}; diff --git a/crates/next-core/src/next_font/local/errors.rs b/crates/next-core/src/next_font/local/errors.rs index 99f1d46f86b8a8..3f09137e077cca 100644 --- a/crates/next-core/src/next_font/local/errors.rs +++ b/crates/next-core/src/next_font/local/errors.rs @@ -1,5 +1,5 @@ use thiserror::Error; -use turbo_tasks::RcStr; +use turbo_rcstr::RcStr; #[derive(Debug, Error)] pub enum FontError { diff --git a/crates/next-core/src/next_font/local/font_fallback.rs b/crates/next-core/src/next_font/local/font_fallback.rs index e828181d0cb0a6..4b46415d50b001 100644 --- a/crates/next-core/src/next_font/local/font_fallback.rs +++ b/crates/next-core/src/next_font/local/font_fallback.rs @@ -254,7 +254,7 @@ fn parse_weight_string(weight_str: &str) -> Result { #[cfg(test)] mod tests { use anyhow::Result; - use turbo_tasks::RcStr; + use turbo_rcstr::RcStr; use crate::next_font::local::{ font_fallback::pick_font_for_fallback_generation, diff --git a/crates/next-core/src/next_font/local/mod.rs b/crates/next-core/src/next_font/local/mod.rs index c3a833ee37da71..d4bbeee29f4fbb 100644 --- a/crates/next-core/src/next_font/local/mod.rs +++ b/crates/next-core/src/next_font/local/mod.rs @@ -1,7 +1,8 @@ use anyhow::{bail, Context, Result}; use indoc::formatdoc; use serde::{Deserialize, Serialize}; -use turbo_tasks::{RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Value, Vc}; use turbo_tasks_fs::{ glob::Glob, json::parse_json_with_source_context, FileContent, FileSystemPath, }; diff --git a/crates/next-core/src/next_font/local/options.rs b/crates/next-core/src/next_font/local/options.rs index 7f9ea6809a6105..798d0fb89471a0 100644 --- a/crates/next-core/src/next_font/local/options.rs +++ b/crates/next-core/src/next_font/local/options.rs @@ -2,7 +2,8 @@ use std::{fmt::Display, str::FromStr}; use anyhow::{Context, Result}; use serde::{Deserialize, Serialize}; -use turbo_tasks::{trace::TraceRawVcs, RcStr, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{trace::TraceRawVcs, Value, Vc}; use super::request::{ AdjustFontFallback, NextFontLocalRequest, NextFontLocalRequestArguments, SrcDescriptor, diff --git a/crates/next-core/src/next_font/local/request.rs b/crates/next-core/src/next_font/local/request.rs index f084699603d758..113cd76e3abbe5 100644 --- a/crates/next-core/src/next_font/local/request.rs +++ b/crates/next-core/src/next_font/local/request.rs @@ -1,5 +1,6 @@ use serde::{Deserialize, Serialize}; -use turbo_tasks::{trace::TraceRawVcs, RcStr}; +use turbo_rcstr::RcStr; +use turbo_tasks::trace::TraceRawVcs; /// The top-most structure encoded into the query param in requests to /// `next/font/local` generated by the next/font swc transform. e.g. diff --git a/crates/next-core/src/next_font/local/stylesheet.rs b/crates/next-core/src/next_font/local/stylesheet.rs index c0167abe39dca3..8589828c7841ad 100644 --- a/crates/next-core/src/next_font/local/stylesheet.rs +++ b/crates/next-core/src/next_font/local/stylesheet.rs @@ -1,6 +1,7 @@ use anyhow::{bail, Result}; use indoc::formatdoc; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use super::options::{FontDescriptors, NextFontLocalOptions}; use crate::next_font::{ diff --git a/crates/next-core/src/next_font/local/util.rs b/crates/next-core/src/next_font/local/util.rs index 63d3c89ff39f21..c55df155fa7347 100644 --- a/crates/next-core/src/next_font/local/util.rs +++ b/crates/next-core/src/next_font/local/util.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use super::options::NextFontLocalOptions; use crate::next_font::{ diff --git a/crates/next-core/src/next_font/stylesheet.rs b/crates/next-core/src/next_font/stylesheet.rs index 307a53d5e1a31a..cd482b4de2bbec 100644 --- a/crates/next-core/src/next_font/stylesheet.rs +++ b/crates/next-core/src/next_font/stylesheet.rs @@ -1,6 +1,7 @@ use anyhow::Result; use indoc::formatdoc; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use super::{ font_fallback::{FontFallback, FontFallbacks}, diff --git a/crates/next-core/src/next_font/util.rs b/crates/next-core/src/next_font/util.rs index d3482a15e6736a..a6aa71c708dd00 100644 --- a/crates/next-core/src/next_font/util.rs +++ b/crates/next-core/src/next_font/util.rs @@ -1,6 +1,7 @@ use anyhow::{Context, Result}; use serde::Deserialize; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbo_tasks_fs::{json::parse_json_with_source_context, FileSystemPath}; use turbo_tasks_hash::hash_xxh3_hash64; use turbopack_core::issue::{IssueExt, IssueSeverity, StyledString}; diff --git a/crates/next-core/src/next_image/source_asset.rs b/crates/next-core/src/next_image/source_asset.rs index 7ed3fa726e731d..ecef2cf384f6bd 100644 --- a/crates/next-core/src/next_image/source_asset.rs +++ b/crates/next-core/src/next_image/source_asset.rs @@ -1,7 +1,8 @@ use std::io::Write; use anyhow::{bail, Result}; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbo_tasks_fs::{rope::RopeBuilder, FileContent}; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/crates/next-core/src/next_import_map.rs b/crates/next-core/src/next_import_map.rs index 4f4dd5b8ef33ad..5ab11b65ba1104 100644 --- a/crates/next-core/src/next_import_map.rs +++ b/crates/next-core/src/next_import_map.rs @@ -1,7 +1,8 @@ use std::collections::{BTreeMap, HashMap}; use anyhow::{Context, Result}; -use turbo_tasks::{fxindexmap, FxIndexMap, RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{fxindexmap, FxIndexMap, ResolvedVc, Value, Vc}; use turbo_tasks_fs::{FileSystem, FileSystemPath}; use turbopack_core::{ reference_type::{CommonJsReferenceSubType, ReferenceType}, diff --git a/crates/next-core/src/next_manifests/client_reference_manifest.rs b/crates/next-core/src/next_manifests/client_reference_manifest.rs index db4b65a1f5f931..d85ddea1484726 100644 --- a/crates/next-core/src/next_manifests/client_reference_manifest.rs +++ b/crates/next-core/src/next_manifests/client_reference_manifest.rs @@ -1,6 +1,7 @@ use anyhow::Result; use indoc::formatdoc; -use turbo_tasks::{RcStr, TryJoinIterExt, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{TryJoinIterExt, Value, ValueToString, Vc}; use turbo_tasks_fs::{File, FileSystemPath}; use turbopack_core::{ asset::AssetContent, diff --git a/crates/next-core/src/next_manifests/mod.rs b/crates/next-core/src/next_manifests/mod.rs index ac89d4b5daeb25..5340e480ca88b5 100644 --- a/crates/next-core/src/next_manifests/mod.rs +++ b/crates/next-core/src/next_manifests/mod.rs @@ -5,7 +5,8 @@ pub(crate) mod client_reference_manifest; use std::collections::HashMap; use serde::{Deserialize, Serialize}; -use turbo_tasks::{trace::TraceRawVcs, FxIndexMap, FxIndexSet, RcStr, TaskInput}; +use turbo_rcstr::RcStr; +use turbo_tasks::{trace::TraceRawVcs, FxIndexMap, FxIndexSet, TaskInput}; use crate::next_config::{CrossOriginConfig, Rewrites, RouteHas}; diff --git a/crates/next-core/src/next_pages/page_entry.rs b/crates/next-core/src/next_pages/page_entry.rs index c37b40fcb1615c..a41cf74892420f 100644 --- a/crates/next-core/src/next_pages/page_entry.rs +++ b/crates/next-core/src/next_pages/page_entry.rs @@ -2,7 +2,8 @@ use std::io::Write; use anyhow::{bail, Result}; use serde::Serialize; -use turbo_tasks::{fxindexmap, FxIndexMap, RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{fxindexmap, FxIndexMap, ResolvedVc, Value, Vc}; use turbo_tasks_fs::{rope::RopeBuilder, File, FileSystemPath}; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/crates/next-core/src/next_route_matcher/mod.rs b/crates/next-core/src/next_route_matcher/mod.rs index aa7c46c467bbcc..606164ab1581bd 100644 --- a/crates/next-core/src/next_route_matcher/mod.rs +++ b/crates/next-core/src/next_route_matcher/mod.rs @@ -1,5 +1,6 @@ use anyhow::{bail, Result}; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbopack_node::route_matcher::{Params, RouteMatcher, RouteMatcherRef}; use self::{ diff --git a/crates/next-core/src/next_server/context.rs b/crates/next-core/src/next_server/context.rs index 7404f8f38f8cfb..49ec73d0ff4772 100644 --- a/crates/next-core/src/next_server/context.rs +++ b/crates/next-core/src/next_server/context.rs @@ -1,7 +1,8 @@ use std::iter::once; use anyhow::{bail, Result}; -use turbo_tasks::{FxIndexMap, RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, ResolvedVc, Value, Vc}; use turbo_tasks_env::{EnvMap, ProcessEnv}; use turbo_tasks_fs::{FileSystem, FileSystemPath}; use turbopack::{ diff --git a/crates/next-core/src/next_server/resolve.rs b/crates/next-core/src/next_server/resolve.rs index c5e3a5baabd462..7af5baa9df8063 100644 --- a/crates/next-core/src/next_server/resolve.rs +++ b/crates/next-core/src/next_server/resolve.rs @@ -1,6 +1,7 @@ use anyhow::Result; use serde::{Deserialize, Serialize}; -use turbo_tasks::{trace::TraceRawVcs, RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{trace::TraceRawVcs, ResolvedVc, Value, Vc}; use turbo_tasks_fs::{self, glob::Glob, FileJsonContent, FileSystemPath}; use turbopack_core::{ issue::{Issue, IssueExt, IssueSeverity, IssueStage, OptionStyledString, StyledString}, diff --git a/crates/next-core/src/next_server_component/server_component_module.rs b/crates/next-core/src/next_server_component/server_component_module.rs index 6cecec37769427..9bad430511ffa2 100644 --- a/crates/next-core/src/next_server_component/server_component_module.rs +++ b/crates/next-core/src/next_server_component/server_component_module.rs @@ -2,7 +2,8 @@ use std::collections::BTreeMap; use anyhow::{bail, Result}; use indoc::formatdoc; -use turbo_tasks::{RcStr, ResolvedVc, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/crates/next-core/src/next_server_component/server_component_reference.rs b/crates/next-core/src/next_server_component/server_component_reference.rs index f3a69cb95fac64..fdfc58a9cc7152 100644 --- a/crates/next-core/src/next_server_component/server_component_reference.rs +++ b/crates/next-core/src/next_server_component/server_component_reference.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, ResolvedVc, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, ValueToString, Vc}; use turbopack_core::{ chunk::ChunkableModuleReference, module::Module, reference::ModuleReference, resolve::ModuleResolveResult, diff --git a/crates/next-core/src/next_server_component/server_component_transition.rs b/crates/next-core/src/next_server_component/server_component_transition.rs index ccb011d75e5a74..d061cbee3f0d03 100644 --- a/crates/next-core/src/next_server_component/server_component_transition.rs +++ b/crates/next-core/src/next_server_component/server_component_transition.rs @@ -1,5 +1,6 @@ use anyhow::{bail, Result}; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbopack::{transition::Transition, ModuleAssetContext}; use turbopack_core::module::Module; use turbopack_ecmascript::chunk::EcmascriptChunkPlaceable; diff --git a/crates/next-core/src/next_shared/resolve.rs b/crates/next-core/src/next_shared/resolve.rs index ea4b9351277470..e90bdb66f1de05 100644 --- a/crates/next-core/src/next_shared/resolve.rs +++ b/crates/next-core/src/next_shared/resolve.rs @@ -2,7 +2,8 @@ use std::collections::HashMap; use anyhow::Result; use lazy_static::lazy_static; -use turbo_tasks::{RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Value, Vc}; use turbo_tasks_fs::{glob::Glob, FileSystemPath}; use turbopack_core::{ diagnostics::DiagnosticExt, diff --git a/crates/next-core/src/next_shared/transforms/swc_ecma_transform_plugins.rs b/crates/next-core/src/next_shared/transforms/swc_ecma_transform_plugins.rs index 8f6651449052e8..61d169c14e6158 100644 --- a/crates/next-core/src/next_shared/transforms/swc_ecma_transform_plugins.rs +++ b/crates/next-core/src/next_shared/transforms/swc_ecma_transform_plugins.rs @@ -1,6 +1,6 @@ use anyhow::Result; #[allow(unused_imports)] -use turbo_tasks::RcStr; +use turbo_rcstr::RcStr; use turbo_tasks::{ResolvedVc, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack::module_options::ModuleRule; diff --git a/crates/next-core/src/next_shared/webpack_rules/mod.rs b/crates/next-core/src/next_shared/webpack_rules/mod.rs index eda92a6e58a527..fd608a2f28e301 100644 --- a/crates/next-core/src/next_shared/webpack_rules/mod.rs +++ b/crates/next-core/src/next_shared/webpack_rules/mod.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, ResolvedVc, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack::module_options::WebpackLoadersOptions; use turbopack_core::resolve::options::ImportMapping; diff --git a/crates/next-core/src/next_telemetry.rs b/crates/next-core/src/next_telemetry.rs index be9cffce89d150..7c80e60f895b94 100644 --- a/crates/next-core/src/next_telemetry.rs +++ b/crates/next-core/src/next_telemetry.rs @@ -1,4 +1,5 @@ -use turbo_tasks::{fxindexmap, RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{fxindexmap, Vc}; use turbopack_core::diagnostics::{Diagnostic, DiagnosticPayload}; /// A structure that keeps track of whether a particular Next.js feature is diff --git a/crates/next-core/src/page_loader.rs b/crates/next-core/src/page_loader.rs index 0392add3b5ddc2..8bfc79c38bb4cf 100644 --- a/crates/next-core/src/page_loader.rs +++ b/crates/next-core/src/page_loader.rs @@ -1,7 +1,8 @@ use std::io::Write; use anyhow::{bail, Result}; -use turbo_tasks::{fxindexmap, RcStr, TryJoinIterExt, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{fxindexmap, TryJoinIterExt, Value, Vc}; use turbo_tasks_fs::{ self, rope::RopeBuilder, File, FileContent, FileSystemPath, FileSystemPathOption, }; diff --git a/crates/next-core/src/pages_structure.rs b/crates/next-core/src/pages_structure.rs index 28d4add714f087..3f40ae0ce7f13b 100644 --- a/crates/next-core/src/pages_structure.rs +++ b/crates/next-core/src/pages_structure.rs @@ -1,6 +1,7 @@ use anyhow::Result; use tracing::Instrument; -use turbo_tasks::{RcStr, ResolvedVc, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, ValueToString, Vc}; use turbo_tasks_fs::{ DirectoryContent, DirectoryEntry, FileSystemEntryType, FileSystemPath, FileSystemPathOption, }; diff --git a/crates/next-core/src/util.rs b/crates/next-core/src/util.rs index 93bed88bd40a72..8da1efbf3a0078 100644 --- a/crates/next-core/src/util.rs +++ b/crates/next-core/src/util.rs @@ -4,9 +4,10 @@ use swc_core::{ common::GLOBALS, ecma::ast::{Expr, Lit, Program}, }; +use turbo_rcstr::RcStr; use turbo_tasks::{ - trace::TraceRawVcs, FxIndexMap, FxIndexSet, RcStr, ResolvedVc, TaskInput, ValueDefault, - ValueToString, Vc, + trace::TraceRawVcs, FxIndexMap, FxIndexSet, ResolvedVc, TaskInput, ValueDefault, ValueToString, + Vc, }; use turbo_tasks_fs::{ self, json::parse_json_rope_with_source_context, rope::Rope, util::join_path, File, diff --git a/turbopack/crates/turbo-rcstr/Cargo.toml b/turbopack/crates/turbo-rcstr/Cargo.toml new file mode 100644 index 00000000000000..a217496d7f4daf --- /dev/null +++ b/turbopack/crates/turbo-rcstr/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "turbo-rcstr" +version = "0.1.0" +edition = "2021" +license = "MIT" + +[dependencies] +triomphe = { workspace = true } +turbo-tasks-hash = { workspace = true } +serde = { workspace = true } + +[lints] +workspace = true diff --git a/turbopack/crates/turbo-tasks/src/rcstr.rs b/turbopack/crates/turbo-rcstr/src/lib.rs similarity index 94% rename from turbopack/crates/turbo-tasks/src/rcstr.rs rename to turbopack/crates/turbo-rcstr/src/lib.rs index caca34d1937d7c..e351900a337baa 100644 --- a/turbopack/crates/turbo-tasks/src/rcstr.rs +++ b/turbopack/crates/turbo-rcstr/src/lib.rs @@ -10,8 +10,6 @@ use serde::{Deserialize, Serialize}; use triomphe::Arc; use turbo_tasks_hash::{DeterministicHash, DeterministicHasher}; -use crate::debug::{ValueDebugFormat, ValueDebugFormatString}; - /// An immutable reference counted [`String`], similar to [`Arc`][std::sync::Arc]. /// /// This is the preferred immutable string type for [`turbo_task::function`][macro@crate::function] @@ -27,7 +25,7 @@ use crate::debug::{ValueDebugFormat, ValueDebugFormatString}; /// `RcStr::from(...)`: /// /// ``` -/// # use turbo_tasks::RcStr; +/// # use turbo_rcstr::RcStr; /// # /// let s = "foo"; /// let rc_s1: RcStr = s.into(); @@ -181,9 +179,3 @@ impl From for PathBuf { String::from(s).into() } } - -impl ValueDebugFormat for RcStr { - fn value_debug_format(&self, _: usize) -> ValueDebugFormatString { - ValueDebugFormatString::Sync(self.to_string()) - } -} diff --git a/turbopack/crates/turbo-tasks-backend/Cargo.toml b/turbopack/crates/turbo-tasks-backend/Cargo.toml index f24ad3ada543ac..1def3ef47f75b3 100644 --- a/turbopack/crates/turbo-tasks-backend/Cargo.toml +++ b/turbopack/crates/turbo-tasks-backend/Cargo.toml @@ -42,6 +42,7 @@ tokio-scoped = "0.2.0" tracing = { workspace = true } thread_local = { workspace = true } turbo-prehash = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-hash = { workspace = true } turbo-tasks-malloc = { workspace = true, default-features = false } diff --git a/turbopack/crates/turbo-tasks-env/Cargo.toml b/turbopack/crates/turbo-tasks-env/Cargo.toml index ed9c8ca19dbf58..29c8dbb44c9a89 100644 --- a/turbopack/crates/turbo-tasks-env/Cargo.toml +++ b/turbopack/crates/turbo-tasks-env/Cargo.toml @@ -16,6 +16,7 @@ anyhow = { workspace = true } dotenvs = "0.1.0" indexmap = { workspace = true, features = ["serde"] } serde = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-fs = { workspace = true } diff --git a/turbopack/crates/turbo-tasks-env/src/command_line.rs b/turbopack/crates/turbo-tasks-env/src/command_line.rs index 200e44c144abbc..da3d9f8ba200e0 100644 --- a/turbopack/crates/turbo-tasks-env/src/command_line.rs +++ b/turbopack/crates/turbo-tasks-env/src/command_line.rs @@ -1,4 +1,5 @@ -use turbo_tasks::{mark_session_dependent, FxIndexMap, RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{mark_session_dependent, FxIndexMap, Vc}; use crate::{sorted_env_vars, EnvMap, ProcessEnv, GLOBAL_ENV_LOCK}; diff --git a/turbopack/crates/turbo-tasks-env/src/custom.rs b/turbopack/crates/turbo-tasks-env/src/custom.rs index 2f3eec2c770ddd..f816c5966c1f91 100644 --- a/turbopack/crates/turbo-tasks-env/src/custom.rs +++ b/turbopack/crates/turbo-tasks-env/src/custom.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use crate::{case_insensitive_read, EnvMap, ProcessEnv}; diff --git a/turbopack/crates/turbo-tasks-env/src/dotenv.rs b/turbopack/crates/turbo-tasks-env/src/dotenv.rs index e663e58718c053..0288782a706366 100644 --- a/turbopack/crates/turbo-tasks-env/src/dotenv.rs +++ b/turbopack/crates/turbo-tasks-env/src/dotenv.rs @@ -1,7 +1,8 @@ use std::{env, sync::MutexGuard}; use anyhow::{anyhow, Context, Result}; -use turbo_tasks::{FxIndexMap, RcStr, ResolvedVc, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, ResolvedVc, ValueToString, Vc}; use turbo_tasks_fs::{FileContent, FileSystemPath}; use crate::{sorted_env_vars, EnvMap, ProcessEnv, GLOBAL_ENV_LOCK}; diff --git a/turbopack/crates/turbo-tasks-env/src/filter.rs b/turbopack/crates/turbo-tasks-env/src/filter.rs index 5975e3f286192f..08a8112600fef6 100644 --- a/turbopack/crates/turbo-tasks-env/src/filter.rs +++ b/turbopack/crates/turbo-tasks-env/src/filter.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{FxIndexMap, RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, Vc}; use crate::{EnvMap, ProcessEnv}; diff --git a/turbopack/crates/turbo-tasks-env/src/lib.rs b/turbopack/crates/turbo-tasks-env/src/lib.rs index 9f8c4ef7f3c6b2..0e97d0cc7eb1cd 100644 --- a/turbopack/crates/turbo-tasks-env/src/lib.rs +++ b/turbopack/crates/turbo-tasks-env/src/lib.rs @@ -9,7 +9,8 @@ mod filter; use std::{env, sync::Mutex}; use anyhow::Result; -use turbo_tasks::{FxIndexMap, RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, Vc}; pub use self::{ command_line::CommandLineProcessEnv, custom::CustomProcessEnv, dotenv::DotenvProcessEnv, diff --git a/turbopack/crates/turbo-tasks-fetch/Cargo.toml b/turbopack/crates/turbo-tasks-fetch/Cargo.toml index e4181877d16da3..dbf58c23880e70 100644 --- a/turbopack/crates/turbo-tasks-fetch/Cargo.toml +++ b/turbopack/crates/turbo-tasks-fetch/Cargo.toml @@ -28,6 +28,7 @@ anyhow = { workspace = true } reqwest = { workspace = true } serde = { workspace = true } tokio = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-fs = { workspace = true } turbopack-core = { workspace = true } diff --git a/turbopack/crates/turbo-tasks-fetch/src/lib.rs b/turbopack/crates/turbo-tasks-fetch/src/lib.rs index f7362a3c671170..ed1c10518636e6 100644 --- a/turbopack/crates/turbo-tasks-fetch/src/lib.rs +++ b/turbopack/crates/turbo-tasks-fetch/src/lib.rs @@ -3,7 +3,8 @@ #![feature(arbitrary_self_types_pointers)] use anyhow::Result; -use turbo_tasks::{mark_session_dependent, RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{mark_session_dependent, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::issue::{Issue, IssueSeverity, IssueStage, OptionStyledString, StyledString}; diff --git a/turbopack/crates/turbo-tasks-fs/Cargo.toml b/turbopack/crates/turbo-tasks-fs/Cargo.toml index 0a67b32b5ef625..175500e8198fd6 100644 --- a/turbopack/crates/turbo-tasks-fs/Cargo.toml +++ b/turbopack/crates/turbo-tasks-fs/Cargo.toml @@ -46,6 +46,7 @@ serde_json = { workspace = true } serde_path_to_error = { workspace = true } tokio = { workspace = true } tracing = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-hash = { workspace = true } unicode-segmentation = { workspace = true } diff --git a/turbopack/crates/turbo-tasks-fs/examples/hash_directory.rs b/turbopack/crates/turbo-tasks-fs/examples/hash_directory.rs index a1728fd9fadaac..ce1e6bd030dbe0 100644 --- a/turbopack/crates/turbo-tasks-fs/examples/hash_directory.rs +++ b/turbopack/crates/turbo-tasks-fs/examples/hash_directory.rs @@ -10,7 +10,8 @@ use std::{ use anyhow::Result; use sha2::{Digest, Sha256}; -use turbo_tasks::{util::FormatDuration, RcStr, ReadConsistency, TurboTasks, UpdateInfo, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{util::FormatDuration, ReadConsistency, TurboTasks, UpdateInfo, Vc}; use turbo_tasks_fs::{ register, DirectoryContent, DirectoryEntry, DiskFileSystem, FileContent, FileSystem, FileSystemPath, diff --git a/turbopack/crates/turbo-tasks-fs/examples/hash_glob.rs b/turbopack/crates/turbo-tasks-fs/examples/hash_glob.rs index b5102fd80903a1..1106067c26860b 100644 --- a/turbopack/crates/turbo-tasks-fs/examples/hash_glob.rs +++ b/turbopack/crates/turbo-tasks-fs/examples/hash_glob.rs @@ -10,7 +10,8 @@ use std::{ use anyhow::Result; use sha2::{Digest, Sha256}; -use turbo_tasks::{util::FormatDuration, RcStr, ReadConsistency, TurboTasks, UpdateInfo, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{util::FormatDuration, ReadConsistency, TurboTasks, UpdateInfo, Vc}; use turbo_tasks_fs::{ glob::Glob, register, DirectoryEntry, DiskFileSystem, FileContent, FileSystem, FileSystemPath, ReadGlobResult, diff --git a/turbopack/crates/turbo-tasks-fs/src/attach.rs b/turbopack/crates/turbo-tasks-fs/src/attach.rs index 23c8302c38813f..d046b8d0a9fb7c 100644 --- a/turbopack/crates/turbo-tasks-fs/src/attach.rs +++ b/turbopack/crates/turbo-tasks-fs/src/attach.rs @@ -1,6 +1,7 @@ use anyhow::{bail, Result}; use auto_hash_map::AutoMap; -use turbo_tasks::{Completion, RcStr, ResolvedVc, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Completion, ResolvedVc, ValueToString, Vc}; use crate::{ DirectoryContent, DirectoryEntry, FileContent, FileMeta, FileSystem, FileSystemPath, diff --git a/turbopack/crates/turbo-tasks-fs/src/embed/dir.rs b/turbopack/crates/turbo-tasks-fs/src/embed/dir.rs index b1d45be6da2b6c..6d227e22d65417 100644 --- a/turbopack/crates/turbo-tasks-fs/src/embed/dir.rs +++ b/turbopack/crates/turbo-tasks-fs/src/embed/dir.rs @@ -2,7 +2,8 @@ pub use ::include_dir::{ include_dir, {self}, }; use anyhow::Result; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use crate::{embed::EmbeddedFileSystem, DiskFileSystem, FileSystem}; diff --git a/turbopack/crates/turbo-tasks-fs/src/embed/file.rs b/turbopack/crates/turbo-tasks-fs/src/embed/file.rs index 7565e6555a095d..a1fb35e246520e 100644 --- a/turbopack/crates/turbo-tasks-fs/src/embed/file.rs +++ b/turbopack/crates/turbo-tasks-fs/src/embed/file.rs @@ -2,7 +2,8 @@ use std::path::PathBuf; use anyhow::{Context, Result}; use dunce::canonicalize; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use crate::{DiskFileSystem, File, FileContent, FileSystem}; diff --git a/turbopack/crates/turbo-tasks-fs/src/embed/fs.rs b/turbopack/crates/turbo-tasks-fs/src/embed/fs.rs index 159042797b6eb9..373239ad4a411d 100644 --- a/turbopack/crates/turbo-tasks-fs/src/embed/fs.rs +++ b/turbopack/crates/turbo-tasks-fs/src/embed/fs.rs @@ -1,7 +1,8 @@ use anyhow::{bail, Result}; use auto_hash_map::AutoMap; use include_dir::{Dir, DirEntry}; -use turbo_tasks::{Completion, RcStr, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Completion, ValueToString, Vc}; use crate::{ DirectoryContent, DirectoryEntry, File, FileContent, FileMeta, FileSystem, FileSystemPath, diff --git a/turbopack/crates/turbo-tasks-fs/src/glob.rs b/turbopack/crates/turbo-tasks-fs/src/glob.rs index 5ede3cf026b753..8e7f10f285528b 100644 --- a/turbopack/crates/turbo-tasks-fs/src/glob.rs +++ b/turbopack/crates/turbo-tasks-fs/src/glob.rs @@ -2,7 +2,8 @@ use std::mem::take; use anyhow::{anyhow, bail, Context, Result}; use serde::{Deserialize, Serialize}; -use turbo_tasks::{trace::TraceRawVcs, RcStr, TryJoinIterExt, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{trace::TraceRawVcs, TryJoinIterExt, Vc}; use unicode_segmentation::GraphemeCursor; #[derive(PartialEq, Eq, Debug, Clone, TraceRawVcs, Serialize, Deserialize)] diff --git a/turbopack/crates/turbo-tasks-fs/src/invalidation.rs b/turbopack/crates/turbo-tasks-fs/src/invalidation.rs index 5bc3f224312731..ab6a938ba9f5bd 100644 --- a/turbopack/crates/turbo-tasks-fs/src/invalidation.rs +++ b/turbopack/crates/turbo-tasks-fs/src/invalidation.rs @@ -3,9 +3,8 @@ use std::{ hash::Hash, }; -use turbo_tasks::{ - util::StaticOrArc, FxIndexSet, InvalidationReason, InvalidationReasonKind, RcStr, -}; +use turbo_rcstr::RcStr; +use turbo_tasks::{util::StaticOrArc, FxIndexSet, InvalidationReason, InvalidationReasonKind}; /// Invalidation was caused by a file change detected by the file watcher #[derive(PartialEq, Eq, Hash)] diff --git a/turbopack/crates/turbo-tasks-fs/src/lib.rs b/turbopack/crates/turbo-tasks-fs/src/lib.rs index a7e8ed07320a39..9a18051a6a0f2f 100644 --- a/turbopack/crates/turbo-tasks-fs/src/lib.rs +++ b/turbopack/crates/turbo-tasks-fs/src/lib.rs @@ -57,9 +57,10 @@ use tokio::{ sync::{RwLock, RwLockReadGuard}, }; use tracing::Instrument; +use turbo_rcstr::RcStr; use turbo_tasks::{ - mark_session_dependent, mark_stateful, trace::TraceRawVcs, Completion, Invalidator, RcStr, - ReadRef, ResolvedVc, ValueToString, Vc, + mark_session_dependent, mark_stateful, trace::TraceRawVcs, Completion, Invalidator, ReadRef, + ResolvedVc, ValueToString, Vc, }; use turbo_tasks_hash::{ hash_xxh3_hash128, hash_xxh3_hash64, DeterministicHash, DeterministicHasher, diff --git a/turbopack/crates/turbo-tasks-fs/src/read_glob.rs b/turbopack/crates/turbo-tasks-fs/src/read_glob.rs index d5a88996ce2c26..501b1b0adc8ee1 100644 --- a/turbopack/crates/turbo-tasks-fs/src/read_glob.rs +++ b/turbopack/crates/turbo-tasks-fs/src/read_glob.rs @@ -1,7 +1,8 @@ use std::collections::HashMap; use anyhow::Result; -use turbo_tasks::{RcStr, ResolvedVc, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Vc}; use crate::{glob::Glob, DirectoryContent, DirectoryEntry, FileSystemPath}; diff --git a/turbopack/crates/turbo-tasks-fs/src/virtual_fs.rs b/turbopack/crates/turbo-tasks-fs/src/virtual_fs.rs index 9bcfdccbe4ceef..922b66a6a35516 100644 --- a/turbopack/crates/turbo-tasks-fs/src/virtual_fs.rs +++ b/turbopack/crates/turbo-tasks-fs/src/virtual_fs.rs @@ -1,5 +1,6 @@ use anyhow::{bail, Result}; -use turbo_tasks::{Completion, RcStr, ValueDefault, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Completion, ValueDefault, ValueToString, Vc}; use super::{DirectoryContent, FileContent, FileMeta, FileSystem, FileSystemPath, LinkContent}; diff --git a/turbopack/crates/turbo-tasks-fs/src/watcher.rs b/turbopack/crates/turbo-tasks-fs/src/watcher.rs index 50450d1360e6a1..c8eff95d164180 100644 --- a/turbopack/crates/turbo-tasks-fs/src/watcher.rs +++ b/turbopack/crates/turbo-tasks-fs/src/watcher.rs @@ -18,7 +18,8 @@ use rayon::iter::{IntoParallelIterator, ParallelIterator}; use serde::{Deserialize, Serialize}; use tokio::sync::RwLock; use tracing::instrument; -use turbo_tasks::{spawn_thread, Invalidator, RcStr}; +use turbo_rcstr::RcStr; +use turbo_tasks::{spawn_thread, Invalidator}; use crate::{ format_absolute_fs_path, diff --git a/turbopack/crates/turbo-tasks-memory/Cargo.toml b/turbopack/crates/turbo-tasks-memory/Cargo.toml index df3bfe76c6d238..261b410c45bf0e 100644 --- a/turbopack/crates/turbo-tasks-memory/Cargo.toml +++ b/turbopack/crates/turbo-tasks-memory/Cargo.toml @@ -41,6 +41,7 @@ regex = { workspace = true } rstest = { workspace = true } serde_json = { workspace = true } tokio = { workspace = true, features = ["full"] } +turbo-rcstr = { workspace = true } turbo-tasks-testing = { workspace = true } [build-dependencies] diff --git a/turbopack/crates/turbo-tasks-testing/Cargo.toml b/turbopack/crates/turbo-tasks-testing/Cargo.toml index 14f374cf5fe509..12b69bf1df1b6c 100644 --- a/turbopack/crates/turbo-tasks-testing/Cargo.toml +++ b/turbopack/crates/turbo-tasks-testing/Cargo.toml @@ -19,4 +19,5 @@ auto-hash-map = { workspace = true } futures = { workspace = true } rustc-hash = { workspace = true } tokio = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } diff --git a/turbopack/crates/turbo-tasks-testing/tests/all_in_one.rs b/turbopack/crates/turbo-tasks-testing/tests/all_in_one.rs index 0e297136bbada5..c8b70ffa02e531 100644 --- a/turbopack/crates/turbo-tasks-testing/tests/all_in_one.rs +++ b/turbopack/crates/turbo-tasks-testing/tests/all_in_one.rs @@ -3,7 +3,8 @@ #![feature(arbitrary_self_types_pointers)] use anyhow::{bail, Result}; -use turbo_tasks::{RcStr, ResolvedVc, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Value, ValueToString, Vc}; use turbo_tasks_testing::{register, run, Registration}; static REGISTRATION: Registration = register!(); diff --git a/turbopack/crates/turbo-tasks-testing/tests/collectibles.rs b/turbopack/crates/turbo-tasks-testing/tests/collectibles.rs index 35ed02c4fe501f..6165c903df05b3 100644 --- a/turbopack/crates/turbo-tasks-testing/tests/collectibles.rs +++ b/turbopack/crates/turbo-tasks-testing/tests/collectibles.rs @@ -7,7 +7,8 @@ use std::{collections::HashSet, time::Duration}; use anyhow::Result; use auto_hash_map::AutoSet; use tokio::time::sleep; -use turbo_tasks::{emit, CollectiblesSource, RcStr, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{emit, CollectiblesSource, ValueToString, Vc}; use turbo_tasks_testing::{register, run, Registration}; static REGISTRATION: Registration = register!(); diff --git a/turbopack/crates/turbo-tasks-testing/tests/dirty_in_progress.rs b/turbopack/crates/turbo-tasks-testing/tests/dirty_in_progress.rs index d3c17eba0dbf45..a4a9767a478162 100644 --- a/turbopack/crates/turbo-tasks-testing/tests/dirty_in_progress.rs +++ b/turbopack/crates/turbo-tasks-testing/tests/dirty_in_progress.rs @@ -5,7 +5,8 @@ use std::time::Duration; use anyhow::{bail, Result}; -use turbo_tasks::{emit, CollectiblesSource, RcStr, State, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{emit, CollectiblesSource, State, ValueToString, Vc}; use turbo_tasks_testing::{register, run, Registration}; static REGISTRATION: Registration = register!(); diff --git a/turbopack/crates/turbo-tasks-testing/tests/recompute_collectibles.rs b/turbopack/crates/turbo-tasks-testing/tests/recompute_collectibles.rs index 1ae617e2b135b0..64c2c975670da3 100644 --- a/turbopack/crates/turbo-tasks-testing/tests/recompute_collectibles.rs +++ b/turbopack/crates/turbo-tasks-testing/tests/recompute_collectibles.rs @@ -3,7 +3,8 @@ #![allow(clippy::needless_return)] // clippy bug causes false positive use anyhow::{bail, Result}; -use turbo_tasks::{emit, CollectiblesSource, RcStr, State, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{emit, CollectiblesSource, State, ValueToString, Vc}; use turbo_tasks_testing::{register, run, Registration}; static REGISTRATION: Registration = register!(); diff --git a/turbopack/crates/turbo-tasks/Cargo.toml b/turbopack/crates/turbo-tasks/Cargo.toml index 63ba0dedb9023e..2d5ec147029833 100644 --- a/turbopack/crates/turbo-tasks/Cargo.toml +++ b/turbopack/crates/turbo-tasks/Cargo.toml @@ -41,6 +41,7 @@ tokio = { workspace = true, features = ["full"] } tokio-util = { workspace = true } tracing = { workspace = true } triomphe = { workspace = true, features = ["unsize", "unstable"] } +turbo-rcstr = { workspace = true } turbo-tasks-hash = { workspace = true } turbo-tasks-macros = { workspace = true } turbo-tasks-malloc = { workspace = true } diff --git a/turbopack/crates/turbo-tasks/src/debug/mod.rs b/turbopack/crates/turbo-tasks/src/debug/mod.rs index 425406f74d71bf..ede12f56b956f1 100644 --- a/turbopack/crates/turbo-tasks/src/debug/mod.rs +++ b/turbopack/crates/turbo-tasks/src/debug/mod.rs @@ -1,6 +1,7 @@ use std::fmt::{Debug, Display}; use auto_hash_map::{AutoMap, AutoSet}; +use turbo_rcstr::RcStr; use turbo_tasks::{FxIndexMap, FxIndexSet, Vc}; pub use turbo_tasks_macros::ValueDebugFormat; @@ -14,7 +15,7 @@ use internal::PassthroughDebug; /// The return type of [`ValueDebug::dbg`]. /// -/// We don't use [`Vc`][crate::RcStr] or [`String`] directly because we +/// We don't use [`Vc`][turbo_rcstr::RcStr] or [`String`] directly because we /// don't want the [`Debug`]/[`Display`] representations to be escaped. #[turbo_tasks::value] pub struct ValueDebugString(String); @@ -74,6 +75,12 @@ impl ValueDebugFormat for String { } } +impl ValueDebugFormat for RcStr { + fn value_debug_format(&self, _: usize) -> ValueDebugFormatString { + ValueDebugFormatString::Sync(self.to_string()) + } +} + // Use autoref specialization [1] to implement `ValueDebugFormat` for `T: // Debug` as a fallback if `T` does not implement it directly, hence the `for // &T` clause. diff --git a/turbopack/crates/turbo-tasks/src/display.rs b/turbopack/crates/turbo-tasks/src/display.rs index 78a8e05cb965f0..46beb590c8434a 100644 --- a/turbopack/crates/turbo-tasks/src/display.rs +++ b/turbopack/crates/turbo-tasks/src/display.rs @@ -1,6 +1,7 @@ +use turbo_rcstr::RcStr; use turbo_tasks::Vc; -use crate::{self as turbo_tasks, RcStr}; +use crate::{self as turbo_tasks}; #[turbo_tasks::value_trait] pub trait ValueToString { diff --git a/turbopack/crates/turbo-tasks/src/lib.rs b/turbopack/crates/turbo-tasks/src/lib.rs index ea0f1d5935ed49..cea38d257fa319 100644 --- a/turbopack/crates/turbo-tasks/src/lib.rs +++ b/turbopack/crates/turbo-tasks/src/lib.rs @@ -61,7 +61,6 @@ mod output; pub mod persisted_graph; pub mod primitives; mod raw_vc; -mod rcstr; mod read_ref; pub mod registry; mod scope; @@ -107,7 +106,6 @@ pub use manager::{ pub use native_function::{FunctionMeta, NativeFunction}; pub use output::OutputContent; pub use raw_vc::{CellId, RawVc, ReadRawVcFuture, ResolveTypeError}; -pub use rcstr::RcStr; pub use read_ref::ReadRef; use rustc_hash::FxHasher; pub use scope::scope; diff --git a/turbopack/crates/turbo-tasks/src/primitives.rs b/turbopack/crates/turbo-tasks/src/primitives.rs index bf27ef537ef9e5..4899cf7807e849 100644 --- a/turbopack/crates/turbo-tasks/src/primitives.rs +++ b/turbopack/crates/turbo-tasks/src/primitives.rs @@ -1,10 +1,11 @@ use std::{ops::Deref, time::Duration}; +use turbo_rcstr::RcStr; // This specific macro identifier is detected by turbo-tasks-build. use turbo_tasks_macros::primitive as __turbo_tasks_internal_primitive; use crate::{ - RcStr, Vc, {self as turbo_tasks}, + Vc, {self as turbo_tasks}, }; __turbo_tasks_internal_primitive!(()); diff --git a/turbopack/crates/turbo-tasks/src/task/function.rs b/turbopack/crates/turbo-tasks/src/task/function.rs index d09d91471213f0..f0b2555b4a7321 100644 --- a/turbopack/crates/turbo-tasks/src/task/function.rs +++ b/turbopack/crates/turbo-tasks/src/task/function.rs @@ -369,8 +369,10 @@ task_inputs_impl! { A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 } #[cfg(test)] mod tests { + use turbo_rcstr::RcStr; + use super::*; - use crate::{RcStr, ShrinkToFit, VcCellNewMode, VcDefaultRead}; + use crate::{ShrinkToFit, VcCellNewMode, VcDefaultRead}; #[test] fn test_task_fn() { diff --git a/turbopack/crates/turbo-tasks/src/task/task_input.rs b/turbopack/crates/turbo-tasks/src/task/task_input.rs index ddc6b560e41f87..bb30ca6341c0a4 100644 --- a/turbopack/crates/turbo-tasks/src/task/task_input.rs +++ b/turbopack/crates/turbo-tasks/src/task/task_input.rs @@ -2,9 +2,10 @@ use std::{any::Any, fmt::Debug, future::Future, hash::Hash, time::Duration}; use anyhow::Result; use serde::{Deserialize, Serialize}; +use turbo_rcstr::RcStr; use crate::{ - MagicAny, RcStr, ResolvedVc, TaskId, TransientInstance, TransientValue, Value, ValueTypeId, Vc, + MagicAny, ResolvedVc, TaskId, TransientInstance, TransientValue, Value, ValueTypeId, Vc, }; /// Trait to implement in order for a type to be accepted as a diff --git a/turbopack/crates/turbo-tasks/src/trace.rs b/turbopack/crates/turbo-tasks/src/trace.rs index 162b64cdf2050a..fa0615692e30a0 100644 --- a/turbopack/crates/turbo-tasks/src/trace.rs +++ b/turbopack/crates/turbo-tasks/src/trace.rs @@ -9,8 +9,9 @@ use std::{ use auto_hash_map::{AutoMap, AutoSet}; use indexmap::{IndexMap, IndexSet}; +use turbo_rcstr::RcStr; -use crate::{RawVc, RcStr}; +use crate::RawVc; pub struct TraceRawVcsContext { list: Vec, diff --git a/turbopack/crates/turbo-tasks/src/vc/resolved.rs b/turbopack/crates/turbo-tasks/src/vc/resolved.rs index 78c1c849d79df5..77bca100563cf9 100644 --- a/turbopack/crates/turbo-tasks/src/vc/resolved.rs +++ b/turbopack/crates/turbo-tasks/src/vc/resolved.rs @@ -21,12 +21,13 @@ use std::{ use auto_hash_map::{AutoMap, AutoSet}; use indexmap::{IndexMap, IndexSet}; use serde::{Deserialize, Serialize}; +use turbo_rcstr::RcStr; use crate::{ debug::{ValueDebug, ValueDebugFormat, ValueDebugFormatString}, trace::{TraceRawVcs, TraceRawVcsContext}, vc::Vc, - RcStr, ResolveTypeError, Upcast, VcRead, VcTransparentRead, VcValueTrait, VcValueType, + ResolveTypeError, Upcast, VcRead, VcTransparentRead, VcValueTrait, VcValueType, }; #[derive(Serialize, Deserialize)] diff --git a/turbopack/crates/turbopack-browser/Cargo.toml b/turbopack/crates/turbopack-browser/Cargo.toml index 6bdbf326f71f4d..c43e8ccabc56df 100644 --- a/turbopack/crates/turbopack-browser/Cargo.toml +++ b/turbopack/crates/turbopack-browser/Cargo.toml @@ -28,6 +28,7 @@ serde_qs = { workspace = true } tracing = { workspace = true } urlencoding = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-fs = { workspace = true } turbo-tasks-hash = { workspace = true } diff --git a/turbopack/crates/turbopack-browser/src/chunking_context.rs b/turbopack/crates/turbopack-browser/src/chunking_context.rs index b0a76e5dd9d424..fd1c5a9aaa37d6 100644 --- a/turbopack/crates/turbopack-browser/src/chunking_context.rs +++ b/turbopack/crates/turbopack-browser/src/chunking_context.rs @@ -1,6 +1,7 @@ use anyhow::{bail, Context, Result}; use tracing::Instrument; -use turbo_tasks::{RcStr, ResolvedVc, TryJoinIterExt, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, TryJoinIterExt, Value, ValueToString, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ chunk::{ diff --git a/turbopack/crates/turbopack-browser/src/ecmascript/chunk.rs b/turbopack/crates/turbopack-browser/src/ecmascript/chunk.rs index 4247a4a732f62a..6c6d8f4da93e6a 100644 --- a/turbopack/crates/turbopack-browser/src/ecmascript/chunk.rs +++ b/turbopack/crates/turbopack-browser/src/ecmascript/chunk.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{FxIndexSet, RcStr, ResolvedVc, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexSet, ResolvedVc, ValueToString, Vc}; use turbopack_core::{ asset::{Asset, AssetContent}, chunk::{Chunk, ChunkingContext, OutputChunk, OutputChunkRuntimeInfo}, diff --git a/turbopack/crates/turbopack-browser/src/ecmascript/content.rs b/turbopack/crates/turbopack-browser/src/ecmascript/content.rs index b7833094ff6406..ee9e533675c09b 100644 --- a/turbopack/crates/turbopack-browser/src/ecmascript/content.rs +++ b/turbopack/crates/turbopack-browser/src/ecmascript/content.rs @@ -2,7 +2,8 @@ use std::io::Write; use anyhow::{bail, Result}; use indoc::writedoc; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbo_tasks_fs::File; use turbopack_core::{ asset::AssetContent, diff --git a/turbopack/crates/turbopack-browser/src/ecmascript/evaluate/chunk.rs b/turbopack/crates/turbopack-browser/src/ecmascript/evaluate/chunk.rs index a315f4b23bf0fd..ece6c4ae2ddfcc 100644 --- a/turbopack/crates/turbopack-browser/src/ecmascript/evaluate/chunk.rs +++ b/turbopack/crates/turbopack-browser/src/ecmascript/evaluate/chunk.rs @@ -3,7 +3,8 @@ use std::io::Write; use anyhow::{bail, Result}; use indoc::writedoc; use serde::Serialize; -use turbo_tasks::{RcStr, ReadRef, ResolvedVc, TryJoinIterExt, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ReadRef, ResolvedVc, TryJoinIterExt, Value, ValueToString, Vc}; use turbo_tasks_fs::File; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/turbopack/crates/turbopack-browser/src/ecmascript/list/asset.rs b/turbopack/crates/turbopack-browser/src/ecmascript/list/asset.rs index 9e312e99302606..0b8b4d33429017 100644 --- a/turbopack/crates/turbopack-browser/src/ecmascript/list/asset.rs +++ b/turbopack/crates/turbopack-browser/src/ecmascript/list/asset.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Value, ValueToString, Vc}; use turbopack_core::{ asset::{Asset, AssetContent}, chunk::{ChunkingContext, EvaluatableAssets}, diff --git a/turbopack/crates/turbopack-browser/src/ecmascript/list/version.rs b/turbopack/crates/turbopack-browser/src/ecmascript/list/version.rs index e6dd9bd611378f..24c1478405ec0c 100644 --- a/turbopack/crates/turbopack-browser/src/ecmascript/list/version.rs +++ b/turbopack/crates/turbopack-browser/src/ecmascript/list/version.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{FxIndexMap, RcStr, TraitRef, TryJoinIterExt, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, TraitRef, TryJoinIterExt, Vc}; use turbo_tasks_hash::{encode_hex, Xxh3Hash64Hasher}; use turbopack_core::version::{Version, VersionedContentMerger}; diff --git a/turbopack/crates/turbopack-browser/src/ecmascript/merged/version.rs b/turbopack/crates/turbopack-browser/src/ecmascript/merged/version.rs index dd55cf5216b0f2..9096079be92276 100644 --- a/turbopack/crates/turbopack-browser/src/ecmascript/merged/version.rs +++ b/turbopack/crates/turbopack-browser/src/ecmascript/merged/version.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, ReadRef, TryJoinIterExt, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ReadRef, TryJoinIterExt, Vc}; use turbo_tasks_hash::{encode_hex, Xxh3Hash64Hasher}; use turbopack_core::version::Version; diff --git a/turbopack/crates/turbopack-browser/src/ecmascript/version.rs b/turbopack/crates/turbopack-browser/src/ecmascript/version.rs index 57e733bc725c01..aaa2f0c58c0a06 100644 --- a/turbopack/crates/turbopack-browser/src/ecmascript/version.rs +++ b/turbopack/crates/turbopack-browser/src/ecmascript/version.rs @@ -1,5 +1,6 @@ use anyhow::{bail, Result}; -use turbo_tasks::{FxIndexMap, RcStr, ReadRef, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, ReadRef, Vc}; use turbo_tasks_fs::FileSystemPath; use turbo_tasks_hash::{encode_hex, Xxh3Hash64Hasher}; use turbopack_core::{chunk::ModuleId, version::Version}; diff --git a/turbopack/crates/turbopack-cli/Cargo.toml b/turbopack/crates/turbopack-cli/Cargo.toml index af7cfbc20a537f..81fafa456eb32d 100644 --- a/turbopack/crates/turbopack-cli/Cargo.toml +++ b/turbopack/crates/turbopack-cli/Cargo.toml @@ -43,6 +43,7 @@ owo-colors = { workspace = true } serde = { workspace = true } tokio = { workspace = true, features = ["full"] } tracing-subscriber = { workspace = true, features = ["env-filter", "json"] } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-env = { workspace = true } turbo-tasks-fetch = { workspace = true } diff --git a/turbopack/crates/turbopack-cli/src/build/mod.rs b/turbopack/crates/turbopack-cli/src/build/mod.rs index a8c6b3050dc262..628207b53e63be 100644 --- a/turbopack/crates/turbopack-cli/src/build/mod.rs +++ b/turbopack/crates/turbopack-cli/src/build/mod.rs @@ -6,8 +6,9 @@ use std::{ }; use anyhow::{bail, Context, Result}; +use turbo_rcstr::RcStr; use turbo_tasks::{ - RcStr, ReadConsistency, ResolvedVc, TransientInstance, TryJoinIterExt, TurboTasks, Value, Vc, + ReadConsistency, ResolvedVc, TransientInstance, TryJoinIterExt, TurboTasks, Value, Vc, }; use turbo_tasks_fs::FileSystem; use turbo_tasks_memory::MemoryBackend; diff --git a/turbopack/crates/turbopack-cli/src/contexts.rs b/turbopack/crates/turbopack-cli/src/contexts.rs index 5365b471324258..30239bd13fbdf2 100644 --- a/turbopack/crates/turbopack-cli/src/contexts.rs +++ b/turbopack/crates/turbopack-cli/src/contexts.rs @@ -1,7 +1,8 @@ use std::fmt; use anyhow::Result; -use turbo_tasks::{RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Value, Vc}; use turbo_tasks_fs::{FileSystem, FileSystemPath}; use turbopack::{ ecmascript::{EcmascriptInputTransform, TreeShakingMode}, diff --git a/turbopack/crates/turbopack-cli/src/dev/mod.rs b/turbopack/crates/turbopack-cli/src/dev/mod.rs index fe3d75c931fb3d..fa0f044f742a1d 100644 --- a/turbopack/crates/turbopack-cli/src/dev/mod.rs +++ b/turbopack/crates/turbopack-cli/src/dev/mod.rs @@ -11,9 +11,10 @@ use std::{ use anyhow::{Context, Result}; use owo_colors::OwoColorize; +use turbo_rcstr::RcStr; use turbo_tasks::{ util::{FormatBytes, FormatDuration}, - RcStr, TransientInstance, TurboTasks, UpdateInfo, Value, Vc, + TransientInstance, TurboTasks, UpdateInfo, Value, Vc, }; use turbo_tasks_fs::FileSystem; use turbo_tasks_malloc::TurboMalloc; diff --git a/turbopack/crates/turbopack-cli/src/dev/web_entry_source.rs b/turbopack/crates/turbopack-cli/src/dev/web_entry_source.rs index ddb1a64acf2f77..0dfcce7d295d08 100644 --- a/turbopack/crates/turbopack-cli/src/dev/web_entry_source.rs +++ b/turbopack/crates/turbopack-cli/src/dev/web_entry_source.rs @@ -1,5 +1,6 @@ use anyhow::{anyhow, Result}; -use turbo_tasks::{RcStr, ResolvedVc, TryJoinIterExt, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, TryJoinIterExt, Value, Vc}; use turbo_tasks_env::ProcessEnv; use turbo_tasks_fs::FileSystemPath; use turbopack_browser::{react_refresh::assert_can_resolve_react_refresh, BrowserChunkingContext}; diff --git a/turbopack/crates/turbopack-cli/src/embed_js.rs b/turbopack/crates/turbopack-cli/src/embed_js.rs index 676341316d70b1..d79e1bc6846751 100644 --- a/turbopack/crates/turbopack-cli/src/embed_js.rs +++ b/turbopack/crates/turbopack-cli/src/embed_js.rs @@ -1,4 +1,5 @@ -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbo_tasks_fs::{embed_directory, FileContent, FileSystem, FileSystemPath}; #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-cli/src/util.rs b/turbopack/crates/turbopack-cli/src/util.rs index 6e5c6a449a1313..8993219b228250 100644 --- a/turbopack/crates/turbopack-cli/src/util.rs +++ b/turbopack/crates/turbopack-cli/src/util.rs @@ -2,7 +2,8 @@ use std::{env::current_dir, path::PathBuf}; use anyhow::{Context, Result}; use dunce::canonicalize; -use turbo_tasks::{RcStr, ResolvedVc, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Vc}; use turbo_tasks_fs::{DiskFileSystem, FileSystem}; #[turbo_tasks::value(transparent)] diff --git a/turbopack/crates/turbopack-core/Cargo.toml b/turbopack/crates/turbopack-core/Cargo.toml index 906077cbdd74f9..612d202f96caab 100644 --- a/turbopack/crates/turbopack-core/Cargo.toml +++ b/turbopack/crates/turbopack-core/Cargo.toml @@ -30,6 +30,7 @@ serde_json = { workspace = true, features = ["preserve_order"] } sourcemap = { workspace = true } swc_core = { workspace = true, features = ["ecma_preset_env", "common"] } tracing = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-env = { workspace = true } turbo-tasks-fs = { workspace = true } diff --git a/turbopack/crates/turbopack-core/src/asset.rs b/turbopack/crates/turbopack-core/src/asset.rs index 6155fb564ae82d..054392a6a6246b 100644 --- a/turbopack/crates/turbopack-core/src/asset.rs +++ b/turbopack/crates/turbopack-core/src/asset.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{Completion, RcStr, ResolvedVc, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Completion, ResolvedVc, Vc}; use turbo_tasks_fs::{ FileContent, FileJsonContent, FileLinesContent, FileSystemPath, LinkContent, LinkType, }; diff --git a/turbopack/crates/turbopack-core/src/chunk/chunking.rs b/turbopack/crates/turbopack-core/src/chunk/chunking.rs index 976e0a2358e6a6..063ed430b25a9e 100644 --- a/turbopack/crates/turbopack-core/src/chunk/chunking.rs +++ b/turbopack/crates/turbopack-core/src/chunk/chunking.rs @@ -7,7 +7,8 @@ use anyhow::Result; use once_cell::sync::Lazy; use regex::Regex; use tracing::Level; -use turbo_tasks::{FxIndexMap, RcStr, ReadRef, TryJoinIterExt, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, ReadRef, TryJoinIterExt, ValueToString, Vc}; use super::{ AsyncModuleInfo, Chunk, ChunkItem, ChunkItemsWithAsyncModuleInfo, ChunkType, ChunkingContext, diff --git a/turbopack/crates/turbopack-core/src/chunk/chunking_context.rs b/turbopack/crates/turbopack-core/src/chunk/chunking_context.rs index 0da46c1384bb66..85eef00a5c160a 100644 --- a/turbopack/crates/turbopack-core/src/chunk/chunking_context.rs +++ b/turbopack/crates/turbopack-core/src/chunk/chunking_context.rs @@ -1,6 +1,7 @@ use anyhow::Result; use serde::{Deserialize, Serialize}; -use turbo_tasks::{trace::TraceRawVcs, RcStr, ResolvedVc, TaskInput, Upcast, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{trace::TraceRawVcs, ResolvedVc, TaskInput, Upcast, Value, Vc}; use turbo_tasks_fs::FileSystemPath; use turbo_tasks_hash::DeterministicHash; diff --git a/turbopack/crates/turbopack-core/src/chunk/data.rs b/turbopack/crates/turbopack-core/src/chunk/data.rs index b3066a5ce31fec..04e6340c759247 100644 --- a/turbopack/crates/turbopack-core/src/chunk/data.rs +++ b/turbopack/crates/turbopack-core/src/chunk/data.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, ReadRef, TryJoinIterExt, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ReadRef, TryJoinIterExt, Vc}; use turbo_tasks_fs::FileSystemPath; use crate::{ diff --git a/turbopack/crates/turbopack-core/src/chunk/mod.rs b/turbopack/crates/turbopack-core/src/chunk/mod.rs index ec2747d170a738..73c12c91ad9317 100644 --- a/turbopack/crates/turbopack-core/src/chunk/mod.rs +++ b/turbopack/crates/turbopack-core/src/chunk/mod.rs @@ -20,12 +20,13 @@ use anyhow::Result; use auto_hash_map::AutoSet; use serde::{Deserialize, Serialize}; use tracing::{info_span, Span}; +use turbo_rcstr::RcStr; use turbo_tasks::{ debug::ValueDebugFormat, graph::{AdjacencyMap, GraphTraversal, GraphTraversalResult, Visit, VisitControlFlow}, trace::TraceRawVcs, - FxIndexMap, FxIndexSet, RcStr, ReadRef, ResolvedVc, TaskInput, TryFlatJoinIterExt, - TryJoinIterExt, Upcast, ValueToString, Vc, + FxIndexMap, FxIndexSet, ReadRef, ResolvedVc, TaskInput, TryFlatJoinIterExt, TryJoinIterExt, + Upcast, ValueToString, Vc, }; use turbo_tasks_fs::FileSystemPath; use turbo_tasks_hash::DeterministicHash; diff --git a/turbopack/crates/turbopack-core/src/chunk/module_id_strategies.rs b/turbopack/crates/turbopack-core/src/chunk/module_id_strategies.rs index 307979dbff5fc6..c4a585e8ba7a2b 100644 --- a/turbopack/crates/turbopack-core/src/chunk/module_id_strategies.rs +++ b/turbopack/crates/turbopack-core/src/chunk/module_id_strategies.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{FxIndexMap, RcStr, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, ValueToString, Vc}; use turbo_tasks_hash::hash_xxh3_hash64; use super::ModuleId; diff --git a/turbopack/crates/turbopack-core/src/compile_time_info.rs b/turbopack/crates/turbopack-core/src/compile_time_info.rs index f6d7a605aeb887..f33b2d22fef425 100644 --- a/turbopack/crates/turbopack-core/src/compile_time_info.rs +++ b/turbopack/crates/turbopack-core/src/compile_time_info.rs @@ -1,4 +1,5 @@ -use turbo_tasks::{FxIndexMap, RcStr, ResolvedVc, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, ResolvedVc, Vc}; use turbo_tasks_fs::FileSystemPath; use crate::environment::Environment; diff --git a/turbopack/crates/turbopack-core/src/context.rs b/turbopack/crates/turbopack-core/src/context.rs index d8408b999aec53..be26a1b3c6e643 100644 --- a/turbopack/crates/turbopack-core/src/context.rs +++ b/turbopack/crates/turbopack-core/src/context.rs @@ -1,5 +1,6 @@ use anyhow::{bail, Result}; -use turbo_tasks::{RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Value, Vc}; use turbo_tasks_fs::{glob::Glob, FileSystemPath}; use crate::{ diff --git a/turbopack/crates/turbopack-core/src/diagnostics/mod.rs b/turbopack/crates/turbopack-core/src/diagnostics/mod.rs index c302c296216b96..c07ca4cf1226c6 100644 --- a/turbopack/crates/turbopack-core/src/diagnostics/mod.rs +++ b/turbopack/crates/turbopack-core/src/diagnostics/mod.rs @@ -2,7 +2,8 @@ use std::cmp::Ordering; use anyhow::Result; use async_trait::async_trait; -use turbo_tasks::{emit, CollectiblesSource, FxIndexMap, RcStr, Upcast, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{emit, CollectiblesSource, FxIndexMap, Upcast, Vc}; #[turbo_tasks::value(serialization = "none")] #[derive(Clone, Debug)] diff --git a/turbopack/crates/turbopack-core/src/environment.rs b/turbopack/crates/turbopack-core/src/environment.rs index c4482100481227..6338c3b76c9cca 100644 --- a/turbopack/crates/turbopack-core/src/environment.rs +++ b/turbopack/crates/turbopack-core/src/environment.rs @@ -5,7 +5,8 @@ use std::{ use anyhow::{anyhow, Context, Result}; use swc_core::ecma::preset_env::{Version, Versions}; -use turbo_tasks::{RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Value, Vc}; use turbo_tasks_env::ProcessEnv; use crate::target::CompileTarget; diff --git a/turbopack/crates/turbopack-core/src/file_source.rs b/turbopack/crates/turbopack-core/src/file_source.rs index 5a3158d5415976..0b0a46c791443d 100644 --- a/turbopack/crates/turbopack-core/src/file_source.rs +++ b/turbopack/crates/turbopack-core/src/file_source.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbo_tasks_fs::{FileContent, FileSystemEntryType, FileSystemPath, LinkContent}; use crate::{ diff --git a/turbopack/crates/turbopack-core/src/ident.rs b/turbopack/crates/turbopack-core/src/ident.rs index 8ee70df4a68069..a0de9ae5337c62 100644 --- a/turbopack/crates/turbopack-core/src/ident.rs +++ b/turbopack/crates/turbopack-core/src/ident.rs @@ -1,7 +1,8 @@ use std::fmt::Write; use anyhow::Result; -use turbo_tasks::{RcStr, ResolvedVc, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Value, ValueToString, Vc}; use turbo_tasks_fs::FileSystemPath; use turbo_tasks_hash::{encode_hex, hash_xxh3_hash64, DeterministicHash, Xxh3Hash64Hasher}; diff --git a/turbopack/crates/turbopack-core/src/introspect/mod.rs b/turbopack/crates/turbopack-core/src/introspect/mod.rs index ab5f92e781254d..35d5308b68beb3 100644 --- a/turbopack/crates/turbopack-core/src/introspect/mod.rs +++ b/turbopack/crates/turbopack-core/src/introspect/mod.rs @@ -3,7 +3,8 @@ pub mod output_asset; pub mod source; pub mod utils; -use turbo_tasks::{FxIndexSet, RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexSet, Vc}; type VcDynIntrospectable = Vc>; diff --git a/turbopack/crates/turbopack-core/src/introspect/module.rs b/turbopack/crates/turbopack-core/src/introspect/module.rs index 073be94ab1aff0..752cd57c9fdc36 100644 --- a/turbopack/crates/turbopack-core/src/introspect/module.rs +++ b/turbopack/crates/turbopack-core/src/introspect/module.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ValueToString, Vc}; use super::{ utils::{children_from_module_references, content_to_details}, diff --git a/turbopack/crates/turbopack-core/src/introspect/output_asset.rs b/turbopack/crates/turbopack-core/src/introspect/output_asset.rs index f681e72689aa9e..e46dff52fa002f 100644 --- a/turbopack/crates/turbopack-core/src/introspect/output_asset.rs +++ b/turbopack/crates/turbopack-core/src/introspect/output_asset.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, ResolvedVc, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, ValueToString, Vc}; use super::{ utils::{children_from_output_assets, content_to_details}, diff --git a/turbopack/crates/turbopack-core/src/introspect/source.rs b/turbopack/crates/turbopack-core/src/introspect/source.rs index 38c98d2678d7da..5fa9e063af6fd0 100644 --- a/turbopack/crates/turbopack-core/src/introspect/source.rs +++ b/turbopack/crates/turbopack-core/src/introspect/source.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ValueToString, Vc}; use super::{utils::content_to_details, Introspectable}; use crate::{asset::Asset, source::Source}; diff --git a/turbopack/crates/turbopack-core/src/introspect/utils.rs b/turbopack/crates/turbopack-core/src/introspect/utils.rs index f86773d8d0fdd4..8d864812ee822d 100644 --- a/turbopack/crates/turbopack-core/src/introspect/utils.rs +++ b/turbopack/crates/turbopack-core/src/introspect/utils.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{FxIndexSet, RcStr, ResolvedVc, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexSet, ResolvedVc, Vc}; use turbo_tasks_fs::FileContent; use super::{ diff --git a/turbopack/crates/turbopack-core/src/issue/analyze.rs b/turbopack/crates/turbopack-core/src/issue/analyze.rs index 82354d06bcf6e1..890ef3ad56efac 100644 --- a/turbopack/crates/turbopack-core/src/issue/analyze.rs +++ b/turbopack/crates/turbopack-core/src/issue/analyze.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbo_tasks_fs::FileSystemPath; use super::{ diff --git a/turbopack/crates/turbopack-core/src/issue/mod.rs b/turbopack/crates/turbopack-core/src/issue/mod.rs index 46833dbfad2457..836ebf07e5e2b0 100644 --- a/turbopack/crates/turbopack-core/src/issue/mod.rs +++ b/turbopack/crates/turbopack-core/src/issue/mod.rs @@ -12,8 +12,9 @@ use anyhow::{anyhow, Result}; use async_trait::async_trait; use auto_hash_map::AutoSet; use serde::Serialize; +use turbo_rcstr::RcStr; use turbo_tasks::{ - emit, CollectiblesSource, RawVc, RcStr, ReadRef, ResolvedVc, TransientInstance, TransientValue, + emit, CollectiblesSource, RawVc, ReadRef, ResolvedVc, TransientInstance, TransientValue, TryJoinIterExt, Upcast, ValueToString, Vc, }; use turbo_tasks_fs::{FileContent, FileLine, FileLinesContent, FileSystemPath}; diff --git a/turbopack/crates/turbopack-core/src/issue/resolve.rs b/turbopack/crates/turbopack-core/src/issue/resolve.rs index e6f7061196935e..07c1346eeb601d 100644 --- a/turbopack/crates/turbopack-core/src/issue/resolve.rs +++ b/turbopack/crates/turbopack-core/src/issue/resolve.rs @@ -1,7 +1,8 @@ use std::fmt::Write; use anyhow::Result; -use turbo_tasks::{RcStr, ReadRef, ResolvedVc, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ReadRef, ResolvedVc, ValueToString, Vc}; use turbo_tasks_fs::FileSystemPath; use super::{Issue, IssueSource, IssueStage, OptionIssueSource, OptionStyledString, StyledString}; diff --git a/turbopack/crates/turbopack-core/src/package_json.rs b/turbopack/crates/turbopack-core/src/package_json.rs index e7c1011b29efff..f8c763218863b7 100644 --- a/turbopack/crates/turbopack-core/src/package_json.rs +++ b/turbopack/crates/turbopack-core/src/package_json.rs @@ -2,7 +2,8 @@ use std::{fmt::Write, ops::Deref}; use anyhow::Result; use serde_json::Value as JsonValue; -use turbo_tasks::{debug::ValueDebugFormat, trace::TraceRawVcs, RcStr, ReadRef, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{debug::ValueDebugFormat, trace::TraceRawVcs, ReadRef, Vc}; use turbo_tasks_fs::{FileContent, FileJsonContent, FileSystemPath}; use super::issue::Issue; diff --git a/turbopack/crates/turbopack-core/src/reference/mod.rs b/turbopack/crates/turbopack-core/src/reference/mod.rs index b43e2e43e8154a..7f47d085c02682 100644 --- a/turbopack/crates/turbopack-core/src/reference/mod.rs +++ b/turbopack/crates/turbopack-core/src/reference/mod.rs @@ -1,9 +1,10 @@ use std::collections::{HashSet, VecDeque}; use anyhow::Result; +use turbo_rcstr::RcStr; use turbo_tasks::{ graph::{AdjacencyMap, GraphTraversal}, - FxIndexSet, RcStr, ResolvedVc, TryJoinIterExt, ValueToString, Vc, + FxIndexSet, ResolvedVc, TryJoinIterExt, ValueToString, Vc, }; use crate::{ diff --git a/turbopack/crates/turbopack-core/src/reference/source_map.rs b/turbopack/crates/turbopack-core/src/reference/source_map.rs index 291711a2e05491..c85550ab6190fa 100644 --- a/turbopack/crates/turbopack-core/src/reference/source_map.rs +++ b/turbopack/crates/turbopack-core/src/reference/source_map.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, ResolvedVc, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, ValueToString, Vc}; use turbo_tasks_fs::{FileSystemEntryType, FileSystemPath}; use super::ModuleReference; diff --git a/turbopack/crates/turbopack-core/src/reference_type.rs b/turbopack/crates/turbopack-core/src/reference_type.rs index 4f777d99caee03..3c16d01e27357e 100644 --- a/turbopack/crates/turbopack-core/src/reference_type.rs +++ b/turbopack/crates/turbopack-core/src/reference_type.rs @@ -1,7 +1,8 @@ use std::fmt::Display; use anyhow::Result; -use turbo_tasks::{FxIndexMap, RcStr, ResolvedVc, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, ResolvedVc, Vc}; use crate::{module::Module, resolve::ModulePart}; diff --git a/turbopack/crates/turbopack-core/src/resolve/alias_map.rs b/turbopack/crates/turbopack-core/src/resolve/alias_map.rs index 4e01abf792c3cb..ab280cb8daf425 100644 --- a/turbopack/crates/turbopack-core/src/resolve/alias_map.rs +++ b/turbopack/crates/turbopack-core/src/resolve/alias_map.rs @@ -11,10 +11,10 @@ use serde::{ Deserialize, Deserializer, Serialize, Serializer, }; use serde_bytes::{ByteBuf, Bytes}; +use turbo_rcstr::RcStr; use turbo_tasks::{ debug::{internal::PassthroughDebug, ValueDebugFormat, ValueDebugFormatString}, trace::{TraceRawVcs, TraceRawVcsContext}, - RcStr, }; use super::pattern::Pattern; diff --git a/turbopack/crates/turbopack-core/src/resolve/mod.rs b/turbopack/crates/turbopack-core/src/resolve/mod.rs index 335380d79aa182..d18e9158e5fc6c 100644 --- a/turbopack/crates/turbopack-core/src/resolve/mod.rs +++ b/turbopack/crates/turbopack-core/src/resolve/mod.rs @@ -9,9 +9,10 @@ use std::{ use anyhow::{bail, Result}; use serde::{Deserialize, Serialize}; use tracing::{Instrument, Level}; +use turbo_rcstr::RcStr; use turbo_tasks::{ - fxindexmap, trace::TraceRawVcs, FxIndexMap, FxIndexSet, RcStr, ResolvedVc, TaskInput, - TryJoinIterExt, Value, ValueToString, Vc, + fxindexmap, trace::TraceRawVcs, FxIndexMap, FxIndexSet, ResolvedVc, TaskInput, TryJoinIterExt, + Value, ValueToString, Vc, }; use turbo_tasks_fs::{ util::normalize_request, FileSystemEntryType, FileSystemPath, RealPathResult, diff --git a/turbopack/crates/turbopack-core/src/resolve/options.rs b/turbopack/crates/turbopack-core/src/resolve/options.rs index 695cc75812a11d..b175179dbf1a34 100644 --- a/turbopack/crates/turbopack-core/src/resolve/options.rs +++ b/turbopack/crates/turbopack-core/src/resolve/options.rs @@ -2,9 +2,10 @@ use std::{collections::BTreeMap, future::Future, pin::Pin}; use anyhow::{bail, Result}; use serde::{Deserialize, Serialize}; +use turbo_rcstr::RcStr; use turbo_tasks::{ - debug::ValueDebugFormat, trace::TraceRawVcs, FxIndexSet, RcStr, ResolvedVc, TryJoinIterExt, - Value, ValueToString, Vc, + debug::ValueDebugFormat, trace::TraceRawVcs, FxIndexSet, ResolvedVc, TryJoinIterExt, Value, + ValueToString, Vc, }; use turbo_tasks_fs::{glob::Glob, FileSystemPath}; diff --git a/turbopack/crates/turbopack-core/src/resolve/origin.rs b/turbopack/crates/turbopack-core/src/resolve/origin.rs index ca292c03e76812..f2681655338c50 100644 --- a/turbopack/crates/turbopack-core/src/resolve/origin.rs +++ b/turbopack/crates/turbopack-core/src/resolve/origin.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, Upcast, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Upcast, Value, Vc}; use turbo_tasks_fs::FileSystemPath; use super::{options::ResolveOptions, parse::Request, ModuleResolveResult}; diff --git a/turbopack/crates/turbopack-core/src/resolve/parse.rs b/turbopack/crates/turbopack-core/src/resolve/parse.rs index 8e4e9aa365f646..5ffe17926849e3 100644 --- a/turbopack/crates/turbopack-core/src/resolve/parse.rs +++ b/turbopack/crates/turbopack-core/src/resolve/parse.rs @@ -1,7 +1,8 @@ use anyhow::Result; use lazy_static::lazy_static; use regex::Regex; -use turbo_tasks::{RcStr, TryJoinIterExt, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{TryJoinIterExt, Value, ValueToString, Vc}; use super::pattern::Pattern; diff --git a/turbopack/crates/turbopack-core/src/resolve/pattern.rs b/turbopack/crates/turbopack-core/src/resolve/pattern.rs index 8e8824a0b7ef98..3b19b83fd9a433 100644 --- a/turbopack/crates/turbopack-core/src/resolve/pattern.rs +++ b/turbopack/crates/turbopack-core/src/resolve/pattern.rs @@ -9,7 +9,8 @@ use lazy_static::lazy_static; use regex::Regex; use serde::{Deserialize, Serialize}; use tracing::Instrument; -use turbo_tasks::{trace::TraceRawVcs, RcStr, ResolvedVc, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{trace::TraceRawVcs, ResolvedVc, Value, ValueToString, Vc}; use turbo_tasks_fs::{ util::normalize_path, DirectoryContent, DirectoryEntry, FileSystemEntryType, FileSystemPath, LinkContent, LinkType, @@ -1647,7 +1648,7 @@ pub async fn read_matches( #[cfg(test)] mod tests { use rstest::*; - use turbo_tasks::RcStr; + use turbo_rcstr::RcStr; use super::{longest_common_prefix, longest_common_suffix, Pattern}; diff --git a/turbopack/crates/turbopack-core/src/resolve/plugin.rs b/turbopack/crates/turbopack-core/src/resolve/plugin.rs index e3b2ad1661f076..0b943c4d0a6145 100644 --- a/turbopack/crates/turbopack-core/src/resolve/plugin.rs +++ b/turbopack/crates/turbopack-core/src/resolve/plugin.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Value, Vc}; use turbo_tasks_fs::{glob::Glob, FileSystemPath}; use crate::{ diff --git a/turbopack/crates/turbopack-core/src/resolve/remap.rs b/turbopack/crates/turbopack-core/src/resolve/remap.rs index 87eef35c7d8103..eb6fc9a1edfe3c 100644 --- a/turbopack/crates/turbopack-core/src/resolve/remap.rs +++ b/turbopack/crates/turbopack-core/src/resolve/remap.rs @@ -7,7 +7,8 @@ use std::{ use anyhow::{bail, Result}; use serde::{Deserialize, Serialize}; use serde_json::Value; -use turbo_tasks::{FxIndexMap, RcStr}; +use turbo_rcstr::RcStr; +use turbo_tasks::FxIndexMap; use super::{ alias_map::{AliasMap, AliasMapIter, AliasPattern, AliasTemplate}, diff --git a/turbopack/crates/turbopack-core/src/server_fs.rs b/turbopack/crates/turbopack-core/src/server_fs.rs index 0cae12d1e2fdef..c923a2051cbaa9 100644 --- a/turbopack/crates/turbopack-core/src/server_fs.rs +++ b/turbopack/crates/turbopack-core/src/server_fs.rs @@ -1,5 +1,6 @@ use anyhow::{bail, Result}; -use turbo_tasks::{Completion, RcStr, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Completion, ValueToString, Vc}; use turbo_tasks_fs::{ DirectoryContent, FileContent, FileMeta, FileSystem, FileSystemPath, LinkContent, }; diff --git a/turbopack/crates/turbopack-core/src/source_map/mod.rs b/turbopack/crates/turbopack-core/src/source_map/mod.rs index 0dfa6c811a7246..d77973d8a60032 100644 --- a/turbopack/crates/turbopack-core/src/source_map/mod.rs +++ b/turbopack/crates/turbopack-core/src/source_map/mod.rs @@ -7,7 +7,8 @@ use ref_cast::RefCast; use regex::Regex; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use sourcemap::{DecodedMap, SourceMap as RegularMap, SourceMapBuilder, SourceMapIndex}; -use turbo_tasks::{RcStr, TryJoinIterExt, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{TryJoinIterExt, ValueToString, Vc}; use turbo_tasks_fs::{ rope::{Rope, RopeBuilder}, File, FileContent, FileSystem, FileSystemPath, VirtualFileSystem, diff --git a/turbopack/crates/turbopack-core/src/source_map/source_map_asset.rs b/turbopack/crates/turbopack-core/src/source_map/source_map_asset.rs index 18661239ce6394..6ba9c669732d89 100644 --- a/turbopack/crates/turbopack-core/src/source_map/source_map_asset.rs +++ b/turbopack/crates/turbopack-core/src/source_map/source_map_asset.rs @@ -1,5 +1,6 @@ use anyhow::{bail, Result}; -use turbo_tasks::{FxIndexSet, RcStr, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexSet, ValueToString, Vc}; use turbo_tasks_fs::File; use crate::{ diff --git a/turbopack/crates/turbopack-core/src/version.rs b/turbopack/crates/turbopack-core/src/version.rs index 1ce5b79d3cf8d9..c72df0ffd39bbf 100644 --- a/turbopack/crates/turbopack-core/src/version.rs +++ b/turbopack/crates/turbopack-core/src/version.rs @@ -1,8 +1,9 @@ use std::sync::Arc; use anyhow::{anyhow, Result}; +use turbo_rcstr::RcStr; use turbo_tasks::{ - debug::ValueDebugFormat, trace::TraceRawVcs, IntoTraitRef, RcStr, ReadRef, State, TraitRef, Vc, + debug::ValueDebugFormat, trace::TraceRawVcs, IntoTraitRef, ReadRef, State, TraitRef, Vc, }; use turbo_tasks_fs::{FileContent, LinkType}; use turbo_tasks_hash::{encode_hex, hash_xxh3_hash64}; diff --git a/turbopack/crates/turbopack-css/Cargo.toml b/turbopack/crates/turbopack-css/Cargo.toml index b2105b84460263..33582156f6403e 100644 --- a/turbopack/crates/turbopack-css/Cargo.toml +++ b/turbopack/crates/turbopack-css/Cargo.toml @@ -24,6 +24,7 @@ serde = { workspace = true } urlencoding = { workspace = true } tracing = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-fs = { workspace = true } turbo-tasks-hash = { workspace = true } diff --git a/turbopack/crates/turbopack-css/src/asset.rs b/turbopack/crates/turbopack-css/src/asset.rs index 08f504f2d4708b..aaecc657a2f2c1 100644 --- a/turbopack/crates/turbopack-css/src/asset.rs +++ b/turbopack/crates/turbopack-css/src/asset.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, ResolvedVc, TryJoinIterExt, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, TryJoinIterExt, ValueToString, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/turbopack/crates/turbopack-css/src/chunk/mod.rs b/turbopack/crates/turbopack-css/src/chunk/mod.rs index e59305d0e138b8..207ed2fcedfb7c 100644 --- a/turbopack/crates/turbopack-css/src/chunk/mod.rs +++ b/turbopack/crates/turbopack-css/src/chunk/mod.rs @@ -4,9 +4,8 @@ pub mod source_map; use std::fmt::Write; use anyhow::{bail, Result}; -use turbo_tasks::{ - FxIndexSet, RcStr, ResolvedVc, TryJoinIterExt, Value, ValueDefault, ValueToString, Vc, -}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexSet, ResolvedVc, TryJoinIterExt, Value, ValueDefault, ValueToString, Vc}; use turbo_tasks_fs::{rope::Rope, File, FileSystem}; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/turbopack/crates/turbopack-css/src/chunk/single_item_chunk/chunk.rs b/turbopack/crates/turbopack-css/src/chunk/single_item_chunk/chunk.rs index b46b2cf0c2ad9d..fbb400adabae13 100644 --- a/turbopack/crates/turbopack-css/src/chunk/single_item_chunk/chunk.rs +++ b/turbopack/crates/turbopack-css/src/chunk/single_item_chunk/chunk.rs @@ -1,7 +1,8 @@ use std::fmt::Write; use anyhow::Result; -use turbo_tasks::{RcStr, ResolvedVc, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, ValueToString, Vc}; use turbo_tasks_fs::File; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/turbopack/crates/turbopack-css/src/module_asset.rs b/turbopack/crates/turbopack-css/src/module_asset.rs index 59483a82345187..564f5a0f6adce8 100644 --- a/turbopack/crates/turbopack-css/src/module_asset.rs +++ b/turbopack/crates/turbopack-css/src/module_asset.rs @@ -4,7 +4,8 @@ use anyhow::{bail, Context, Result}; use indoc::formatdoc; use lightningcss::css_modules::CssModuleReference; use swc_core::common::{BytePos, FileName, LineCol, SourceMap}; -use turbo_tasks::{FxIndexMap, RcStr, ResolvedVc, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, ResolvedVc, Value, ValueToString, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/turbopack/crates/turbopack-css/src/process.rs b/turbopack/crates/turbopack-css/src/process.rs index ab0a335ec48848..8c2b3b88b36232 100644 --- a/turbopack/crates/turbopack-css/src/process.rs +++ b/turbopack/crates/turbopack-css/src/process.rs @@ -18,7 +18,8 @@ use swc_core::{ common::{BytePos, LineCol}, }; use tracing::Instrument; -use turbo_tasks::{FxIndexMap, RcStr, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, ValueToString, Vc}; use turbo_tasks_fs::{FileContent, FileSystemPath}; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/turbopack/crates/turbopack-css/src/references/compose.rs b/turbopack/crates/turbopack-css/src/references/compose.rs index d605d1599cef03..360ae2d5238b46 100644 --- a/turbopack/crates/turbopack-css/src/references/compose.rs +++ b/turbopack/crates/turbopack-css/src/references/compose.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Value, ValueToString, Vc}; use turbopack_core::{ chunk::ChunkableModuleReference, reference::ModuleReference, diff --git a/turbopack/crates/turbopack-css/src/references/import.rs b/turbopack/crates/turbopack-css/src/references/import.rs index d247f6968a8915..5ecb363fba4e34 100644 --- a/turbopack/crates/turbopack-css/src/references/import.rs +++ b/turbopack/crates/turbopack-css/src/references/import.rs @@ -4,7 +4,8 @@ use lightningcss::{ rules::{import::ImportRule, layer::LayerName, supports::SupportsCondition}, traits::ToCss, }; -use turbo_tasks::{RcStr, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Value, ValueToString, Vc}; use turbopack_core::{ chunk::{ChunkableModuleReference, ChunkingContext}, issue::IssueSource, diff --git a/turbopack/crates/turbopack-css/src/references/internal.rs b/turbopack/crates/turbopack-css/src/references/internal.rs index 95fb22139200d2..9c79ccccd2a605 100644 --- a/turbopack/crates/turbopack-css/src/references/internal.rs +++ b/turbopack/crates/turbopack-css/src/references/internal.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, ResolvedVc, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, ValueToString, Vc}; use turbopack_core::{ chunk::ChunkableModuleReference, module::Module, reference::ModuleReference, resolve::ModuleResolveResult, diff --git a/turbopack/crates/turbopack-css/src/references/mod.rs b/turbopack/crates/turbopack-css/src/references/mod.rs index 645675e9024896..7f5e45d9935c30 100644 --- a/turbopack/crates/turbopack-css/src/references/mod.rs +++ b/turbopack/crates/turbopack-css/src/references/mod.rs @@ -7,7 +7,8 @@ use lightningcss::{ values::url::Url, visitor::{Visit, Visitor}, }; -use turbo_tasks::{RcStr, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Value, Vc}; use turbopack_core::{ issue::IssueSource, reference::ModuleReference, diff --git a/turbopack/crates/turbopack-css/src/references/url.rs b/turbopack/crates/turbopack-css/src/references/url.rs index e2a3a2fb6e57a4..f2ce855e11ec75 100644 --- a/turbopack/crates/turbopack-css/src/references/url.rs +++ b/turbopack/crates/turbopack-css/src/references/url.rs @@ -6,7 +6,8 @@ use lightningcss::{ visit_types, visitor::{Visit, Visitor}, }; -use turbo_tasks::{debug::ValueDebug, RcStr, ResolvedVc, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{debug::ValueDebug, ResolvedVc, Value, ValueToString, Vc}; use turbopack_core::{ chunk::{ ChunkableModule, ChunkableModuleReference, ChunkingContext, ChunkingType, diff --git a/turbopack/crates/turbopack-dev-server/Cargo.toml b/turbopack/crates/turbopack-dev-server/Cargo.toml index 99d581864d1920..19448e34e11f6f 100644 --- a/turbopack/crates/turbopack-dev-server/Cargo.toml +++ b/turbopack/crates/turbopack-dev-server/Cargo.toml @@ -37,6 +37,7 @@ tokio-util = { workspace = true } tracing = { workspace = true } urlencoding = "2.1.2" +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-bytes = { workspace = true } turbo-tasks-fs = { workspace = true } diff --git a/turbopack/crates/turbopack-dev-server/src/html.rs b/turbopack/crates/turbopack-dev-server/src/html.rs index f13e66e146684c..3688a31c6e256f 100644 --- a/turbopack/crates/turbopack-dev-server/src/html.rs +++ b/turbopack/crates/turbopack-dev-server/src/html.rs @@ -1,6 +1,7 @@ use anyhow::Result; use mime_guess::mime::TEXT_HTML_UTF_8; -use turbo_tasks::{RcStr, ReadRef, ResolvedVc, TryJoinIterExt, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ReadRef, ResolvedVc, TryJoinIterExt, Value, Vc}; use turbo_tasks_fs::{File, FileSystemPath}; use turbo_tasks_hash::{encode_hex, Xxh3Hash64Hasher}; use turbopack_core::{ diff --git a/turbopack/crates/turbopack-dev-server/src/introspect/mod.rs b/turbopack/crates/turbopack-dev-server/src/introspect/mod.rs index 49ed924a4b4542..e675d44fae666f 100644 --- a/turbopack/crates/turbopack-dev-server/src/introspect/mod.rs +++ b/turbopack/crates/turbopack-dev-server/src/introspect/mod.rs @@ -1,7 +1,8 @@ use std::{borrow::Cow, collections::HashSet, fmt::Display}; use anyhow::Result; -use turbo_tasks::{RcStr, ReadRef, TryJoinIterExt, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ReadRef, TryJoinIterExt, Vc}; use turbo_tasks_fs::{json::parse_json_with_source_context, File}; use turbopack_core::{ asset::AssetContent, diff --git a/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs b/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs index 6034c508e9ef76..cd257fb8d30e7c 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/asset_graph.rs @@ -4,9 +4,10 @@ use std::{ }; use anyhow::Result; +use turbo_rcstr::RcStr; use turbo_tasks::{ - fxindexset, Completion, FxIndexMap, FxIndexSet, RcStr, ResolvedVc, State, TryJoinIterExt, - Value, ValueToString, Vc, + fxindexset, Completion, FxIndexMap, FxIndexSet, ResolvedVc, State, TryJoinIterExt, Value, + ValueToString, Vc, }; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ diff --git a/turbopack/crates/turbopack-dev-server/src/source/combined.rs b/turbopack/crates/turbopack-dev-server/src/source/combined.rs index 56236001e17bda..4ae58f8834e507 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/combined.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/combined.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, TryJoinIterExt, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{TryJoinIterExt, Vc}; use turbopack_core::introspect::{Introspectable, IntrospectableChildren}; use super::{ diff --git a/turbopack/crates/turbopack-dev-server/src/source/conditional.rs b/turbopack/crates/turbopack-dev-server/src/source/conditional.rs index 9734b4d96d92f5..26b64bf7884a47 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/conditional.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/conditional.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{Completion, RcStr, State, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Completion, State, Value, Vc}; use turbopack_core::introspect::{Introspectable, IntrospectableChildren}; use super::{ diff --git a/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs b/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs index e127955c19c738..23ea78abe06282 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/issue_context.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Value, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ introspect::{Introspectable, IntrospectableChildren}, diff --git a/turbopack/crates/turbopack-dev-server/src/source/lazy_instantiated.rs b/turbopack/crates/turbopack-dev-server/src/source/lazy_instantiated.rs index 4841da72aa9c87..22ec8c51fa0cf2 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/lazy_instantiated.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/lazy_instantiated.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbopack_core::introspect::{Introspectable, IntrospectableChildren}; use super::{route_tree::RouteTree, ContentSource}; diff --git a/turbopack/crates/turbopack-dev-server/src/source/mod.rs b/turbopack/crates/turbopack-dev-server/src/source/mod.rs index be9b1abbf3a357..670cdd3301ec1b 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/mod.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/mod.rs @@ -17,9 +17,9 @@ use std::collections::BTreeSet; use anyhow::Result; use futures::{stream::Stream as StreamTrait, TryStreamExt}; use serde::{Deserialize, Serialize}; +use turbo_rcstr::RcStr; use turbo_tasks::{ - trace::TraceRawVcs, util::SharedError, Completion, RcStr, ResolvedVc, Upcast, Value, - ValueDefault, Vc, + trace::TraceRawVcs, util::SharedError, Completion, ResolvedVc, Upcast, Value, ValueDefault, Vc, }; use turbo_tasks_bytes::{Bytes, Stream, StreamRead}; use turbo_tasks_fs::FileSystemPath; diff --git a/turbopack/crates/turbopack-dev-server/src/source/resolve.rs b/turbopack/crates/turbopack-dev-server/src/source/resolve.rs index 82328f500121df..33c0ee65f4f991 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/resolve.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/resolve.rs @@ -8,7 +8,8 @@ use hyper::{ header::{HeaderName as HyperHeaderName, HeaderValue as HyperHeaderValue}, Uri, }; -use turbo_tasks::{RcStr, ResolvedVc, TransientInstance, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, TransientInstance, Value, Vc}; use super::{ headers::{HeaderValue, Headers}, diff --git a/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs b/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs index 742a3f9e65861c..9d1bb93b18122f 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/route_tree.rs @@ -2,8 +2,9 @@ use std::{fmt::Write, mem::replace}; use anyhow::Result; use serde::{Deserialize, Serialize}; +use turbo_rcstr::RcStr; use turbo_tasks::{ - fxindexmap, trace::TraceRawVcs, FxIndexMap, RcStr, ResolvedVc, TaskInput, TryJoinIterExt, + fxindexmap, trace::TraceRawVcs, FxIndexMap, ResolvedVc, TaskInput, TryJoinIterExt, ValueToString, Vc, }; diff --git a/turbopack/crates/turbopack-dev-server/src/source/router.rs b/turbopack/crates/turbopack-dev-server/src/source/router.rs index 76d00233a014f7..80fe13c5ce17a4 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/router.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/router.rs @@ -1,7 +1,8 @@ use std::iter::once; use anyhow::Result; -use turbo_tasks::{RcStr, TryJoinIterExt, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{TryJoinIterExt, Value, Vc}; use turbopack_core::introspect::{Introspectable, IntrospectableChildren}; use super::{ diff --git a/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs b/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs index 8e113c1e3d198b..443b35fd81c3e0 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/static_assets.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Value, Vc}; use turbo_tasks_fs::{DirectoryContent, DirectoryEntry, FileSystemPath}; use turbopack_core::{ asset::Asset, diff --git a/turbopack/crates/turbopack-dev-server/src/source/wrapping_source.rs b/turbopack/crates/turbopack-dev-server/src/source/wrapping_source.rs index d0e906d5fc5a87..e32c4d6ba733f2 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/wrapping_source.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/wrapping_source.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Value, Vc}; use super::{ ContentSourceContent, ContentSourceData, ContentSourceDataVary, GetContentSourceContent, diff --git a/turbopack/crates/turbopack-dev-server/src/update/stream.rs b/turbopack/crates/turbopack-dev-server/src/update/stream.rs index ff502a8d564621..165236598b9538 100644 --- a/turbopack/crates/turbopack-dev-server/src/update/stream.rs +++ b/turbopack/crates/turbopack-dev-server/src/update/stream.rs @@ -5,7 +5,8 @@ use futures::prelude::*; use tokio::sync::mpsc::Sender; use tokio_stream::wrappers::ReceiverStream; use tracing::Instrument; -use turbo_tasks::{IntoTraitRef, RcStr, ReadRef, TransientInstance, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{IntoTraitRef, ReadRef, TransientInstance, Vc}; use turbo_tasks_fs::{FileSystem, FileSystemPath}; use turbopack_core::{ error::PrettyPrintError, diff --git a/turbopack/crates/turbopack-ecmascript-plugins/Cargo.toml b/turbopack/crates/turbopack-ecmascript-plugins/Cargo.toml index 9b7c1771bfbbf4..78f8634db51a91 100644 --- a/turbopack/crates/turbopack-ecmascript-plugins/Cargo.toml +++ b/turbopack/crates/turbopack-ecmascript-plugins/Cargo.toml @@ -30,6 +30,7 @@ serde = { workspace = true } serde_json = { workspace = true } tracing = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-fs = { workspace = true } turbopack-core = { workspace = true } diff --git a/turbopack/crates/turbopack-ecmascript-plugins/src/transform/directives/client.rs b/turbopack/crates/turbopack-ecmascript-plugins/src/transform/directives/client.rs index 3b9432cb48caaa..d209eb8ee17c8c 100644 --- a/turbopack/crates/turbopack-ecmascript-plugins/src/transform/directives/client.rs +++ b/turbopack/crates/turbopack-ecmascript-plugins/src/transform/directives/client.rs @@ -1,7 +1,8 @@ use anyhow::Result; use async_trait::async_trait; use swc_core::ecma::{ast::Program, transforms::base::resolver, visit::VisitMutWith}; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbopack_ecmascript::{CustomTransformer, TransformContext}; use super::{is_client_module, server_to_client_proxy::create_proxy_module}; diff --git a/turbopack/crates/turbopack-ecmascript-plugins/src/transform/directives/server.rs b/turbopack/crates/turbopack-ecmascript-plugins/src/transform/directives/server.rs index dac7afad1bab25..fcc5e0131abcfd 100644 --- a/turbopack/crates/turbopack-ecmascript-plugins/src/transform/directives/server.rs +++ b/turbopack/crates/turbopack-ecmascript-plugins/src/transform/directives/server.rs @@ -4,7 +4,8 @@ use swc_core::{ ecma::ast::{ModuleItem, Program}, quote, }; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbopack_core::issue::IssueExt; use turbopack_ecmascript::{CustomTransformer, TransformContext, UnsupportedServerActionIssue}; diff --git a/turbopack/crates/turbopack-ecmascript-runtime/Cargo.toml b/turbopack/crates/turbopack-ecmascript-runtime/Cargo.toml index a9899deabda2c1..6d99659ab9a045 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/Cargo.toml +++ b/turbopack/crates/turbopack-ecmascript-runtime/Cargo.toml @@ -23,6 +23,7 @@ anyhow = { workspace = true } indoc = { workspace = true } serde = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-fs = { workspace = true } turbopack = { workspace = true } diff --git a/turbopack/crates/turbopack-ecmascript-runtime/src/browser_runtime.rs b/turbopack/crates/turbopack-ecmascript-runtime/src/browser_runtime.rs index 4ffbb5f7f2ba8d..f7061cd0892aff 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/src/browser_runtime.rs +++ b/turbopack/crates/turbopack-ecmascript-runtime/src/browser_runtime.rs @@ -2,7 +2,8 @@ use std::io::Write; use anyhow::Result; use indoc::writedoc; -use turbo_tasks::{RcStr, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Value, Vc}; use turbopack_core::{ code_builder::{Code, CodeBuilder}, context::AssetContext, diff --git a/turbopack/crates/turbopack-ecmascript-runtime/src/embed_js.rs b/turbopack/crates/turbopack-ecmascript-runtime/src/embed_js.rs index fda4e89341c62c..f1c2f60bbbfab1 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/src/embed_js.rs +++ b/turbopack/crates/turbopack-ecmascript-runtime/src/embed_js.rs @@ -1,4 +1,5 @@ -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbo_tasks_fs::{embed_directory, FileContent, FileSystem, FileSystemPath}; use turbopack_core::{code_builder::Code, context::AssetContext}; use turbopack_ecmascript::StaticEcmascriptCode; diff --git a/turbopack/crates/turbopack-ecmascript/Cargo.toml b/turbopack/crates/turbopack-ecmascript/Cargo.toml index 38529b94deac64..4d0402b3391e71 100644 --- a/turbopack/crates/turbopack-ecmascript/Cargo.toml +++ b/turbopack/crates/turbopack-ecmascript/Cargo.toml @@ -32,6 +32,7 @@ sourcemap = { workspace = true } strsim = { workspace = true } tokio = { workspace = true } tracing = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-fs = { workspace = true } turbo-tasks-hash = { workspace = true } diff --git a/turbopack/crates/turbopack-ecmascript/src/analyzer/graph.rs b/turbopack/crates/turbopack-ecmascript/src/analyzer/graph.rs index 2cad48363f344c..7d3bc58036cfb6 100644 --- a/turbopack/crates/turbopack-ecmascript/src/analyzer/graph.rs +++ b/turbopack/crates/turbopack-ecmascript/src/analyzer/graph.rs @@ -13,7 +13,8 @@ use swc_core::{ visit::{fields::*, *}, }, }; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbopack_core::source::Source; use super::{ diff --git a/turbopack/crates/turbopack-ecmascript/src/analyzer/imports.rs b/turbopack/crates/turbopack-ecmascript/src/analyzer/imports.rs index 3f77bd707e0e9f..243e3358eb5c51 100644 --- a/turbopack/crates/turbopack-ecmascript/src/analyzer/imports.rs +++ b/turbopack/crates/turbopack-ecmascript/src/analyzer/imports.rs @@ -12,7 +12,8 @@ use swc_core::{ visit::{Visit, VisitWith}, }, }; -use turbo_tasks::{FxIndexMap, FxIndexSet, RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, FxIndexSet, Vc}; use turbopack_core::{issue::IssueSource, source::Source}; use super::{top_level_await::has_top_level_await, JsValue, ModuleValue}; diff --git a/turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs b/turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs index aad69ae7b75b99..41f3ed57f05b10 100644 --- a/turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/src/analyzer/mod.rs @@ -25,7 +25,8 @@ use swc_core::{ atoms::{Atom, JsWord}, }, }; -use turbo_tasks::{FxIndexMap, FxIndexSet, RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, FxIndexSet, Vc}; use turbopack_core::compile_time_info::{ CompileTimeDefineValue, DefineableNameSegment, FreeVarReference, }; diff --git a/turbopack/crates/turbopack-ecmascript/src/async_chunk/chunk_item.rs b/turbopack/crates/turbopack-ecmascript/src/async_chunk/chunk_item.rs index d4db4f5723abef..6fe0df7a471422 100644 --- a/turbopack/crates/turbopack-ecmascript/src/async_chunk/chunk_item.rs +++ b/turbopack/crates/turbopack-ecmascript/src/async_chunk/chunk_item.rs @@ -1,6 +1,7 @@ use anyhow::Result; use indoc::formatdoc; -use turbo_tasks::{RcStr, TryJoinIterExt, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{TryJoinIterExt, Value, Vc}; use turbopack_core::{ chunk::{ ChunkData, ChunkItem, ChunkItemExt, ChunkType, ChunkableModule, ChunkingContext, diff --git a/turbopack/crates/turbopack-ecmascript/src/async_chunk/module.rs b/turbopack/crates/turbopack-ecmascript/src/async_chunk/module.rs index b0600289fbca81..f68e63b3e76eb7 100644 --- a/turbopack/crates/turbopack-ecmascript/src/async_chunk/module.rs +++ b/turbopack/crates/turbopack-ecmascript/src/async_chunk/module.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Value, Vc}; use turbopack_core::{ asset::{Asset, AssetContent}, chunk::{availability_info::AvailabilityInfo, ChunkableModule, ChunkingContext}, diff --git a/turbopack/crates/turbopack-ecmascript/src/chunk/chunk_type.rs b/turbopack/crates/turbopack-ecmascript/src/chunk/chunk_type.rs index 68b03ecfc56acb..8b8cf9f12bf8ed 100644 --- a/turbopack/crates/turbopack-ecmascript/src/chunk/chunk_type.rs +++ b/turbopack/crates/turbopack-ecmascript/src/chunk/chunk_type.rs @@ -1,5 +1,6 @@ use anyhow::{bail, Result}; -use turbo_tasks::{RcStr, TryJoinIterExt, ValueDefault, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{TryJoinIterExt, ValueDefault, ValueToString, Vc}; use turbopack_core::{ chunk::{ round_chunk_item_size, AsyncModuleInfo, Chunk, ChunkItem, ChunkItemWithAsyncModuleInfo, diff --git a/turbopack/crates/turbopack-ecmascript/src/chunk/mod.rs b/turbopack/crates/turbopack-ecmascript/src/chunk/mod.rs index 0d24f25a93569b..d721739f0fdb3c 100644 --- a/turbopack/crates/turbopack-ecmascript/src/chunk/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/src/chunk/mod.rs @@ -7,7 +7,8 @@ pub(crate) mod placeable; use std::fmt::Write; use anyhow::{bail, Result}; -use turbo_tasks::{RcStr, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Value, ValueToString, Vc}; use turbo_tasks_fs::FileSystem; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/turbopack/crates/turbopack-ecmascript/src/chunk_group_files_asset.rs b/turbopack/crates/turbopack-ecmascript/src/chunk_group_files_asset.rs index dbb9e1dfd6093f..02d291b7024b0e 100644 --- a/turbopack/crates/turbopack-ecmascript/src/chunk_group_files_asset.rs +++ b/turbopack/crates/turbopack-ecmascript/src/chunk_group_files_asset.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{FxIndexSet, RcStr, ResolvedVc, TryJoinIterExt, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexSet, ResolvedVc, TryJoinIterExt, Value, ValueToString, Vc}; use turbo_tasks_fs::{File, FileSystemPath}; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/turbopack/crates/turbopack-ecmascript/src/code_gen.rs b/turbopack/crates/turbopack-ecmascript/src/code_gen.rs index 6d4eb65bfd9fd2..0deabb17c4fc95 100644 --- a/turbopack/crates/turbopack-ecmascript/src/code_gen.rs +++ b/turbopack/crates/turbopack-ecmascript/src/code_gen.rs @@ -3,7 +3,8 @@ use swc_core::ecma::{ ast::Stmt, visit::{AstParentKind, VisitMut}, }; -use turbo_tasks::{debug::ValueDebugFormat, trace::TraceRawVcs, RcStr, ResolvedVc, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{debug::ValueDebugFormat, trace::TraceRawVcs, ResolvedVc, Vc}; use turbopack_core::chunk::{AsyncModuleInfo, ChunkingContext}; /// impl of code generation inferred from a ModuleReference. diff --git a/turbopack/crates/turbopack-ecmascript/src/global_module_id_strategy.rs b/turbopack/crates/turbopack-ecmascript/src/global_module_id_strategy.rs index bedec6ee755a64..3892a7987e36c2 100644 --- a/turbopack/crates/turbopack-ecmascript/src/global_module_id_strategy.rs +++ b/turbopack/crates/turbopack-ecmascript/src/global_module_id_strategy.rs @@ -1,7 +1,8 @@ use anyhow::Result; +use turbo_rcstr::RcStr; use turbo_tasks::{ graph::{AdjacencyMap, GraphTraversal}, - FxIndexMap, FxIndexSet, RcStr, ResolvedVc, TryJoinIterExt, ValueToString, Vc, + FxIndexMap, FxIndexSet, ResolvedVc, TryJoinIterExt, ValueToString, Vc, }; use turbo_tasks_hash::hash_xxh3_hash64; use turbopack_core::{ diff --git a/turbopack/crates/turbopack-ecmascript/src/lib.rs b/turbopack/crates/turbopack-ecmascript/src/lib.rs index 6b6b37f17709f7..8c809fb31a72de 100644 --- a/turbopack/crates/turbopack-ecmascript/src/lib.rs +++ b/turbopack/crates/turbopack-ecmascript/src/lib.rs @@ -58,8 +58,9 @@ pub use transform::{ CustomTransformer, EcmascriptInputTransform, EcmascriptInputTransforms, TransformContext, TransformPlugin, UnsupportedServerActionIssue, }; +use turbo_rcstr::RcStr; use turbo_tasks::{ - trace::TraceRawVcs, FxIndexMap, RcStr, ReadRef, ResolvedVc, TaskInput, TryJoinIterExt, Value, + trace::TraceRawVcs, FxIndexMap, ReadRef, ResolvedVc, TaskInput, TryJoinIterExt, Value, ValueToString, Vc, }; use turbo_tasks_fs::{rope::Rope, FileJsonContent, FileSystemPath}; diff --git a/turbopack/crates/turbopack-ecmascript/src/manifest/chunk_asset.rs b/turbopack/crates/turbopack-ecmascript/src/manifest/chunk_asset.rs index f69a0a92148bab..2b80d98db3bcfd 100644 --- a/turbopack/crates/turbopack-ecmascript/src/manifest/chunk_asset.rs +++ b/turbopack/crates/turbopack-ecmascript/src/manifest/chunk_asset.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Value, Vc}; use turbopack_core::{ asset::{Asset, AssetContent}, chunk::{ diff --git a/turbopack/crates/turbopack-ecmascript/src/manifest/loader_item.rs b/turbopack/crates/turbopack-ecmascript/src/manifest/loader_item.rs index 04f7c5b229b46b..3c3d9c3e87fd59 100644 --- a/turbopack/crates/turbopack-ecmascript/src/manifest/loader_item.rs +++ b/turbopack/crates/turbopack-ecmascript/src/manifest/loader_item.rs @@ -2,7 +2,8 @@ use std::io::Write as _; use anyhow::{anyhow, Result}; use indoc::writedoc; -use turbo_tasks::{RcStr, TryJoinIterExt, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{TryJoinIterExt, Vc}; use turbopack_core::{ chunk::{ ChunkData, ChunkItem, ChunkItemExt, ChunkType, ChunkableModule, ChunkingContext, ChunksData, diff --git a/turbopack/crates/turbopack-ecmascript/src/parse.rs b/turbopack/crates/turbopack-ecmascript/src/parse.rs index 255d369c335b0b..a56884b5473e87 100644 --- a/turbopack/crates/turbopack-ecmascript/src/parse.rs +++ b/turbopack/crates/turbopack-ecmascript/src/parse.rs @@ -21,7 +21,8 @@ use swc_core::{ }, }; use tracing::Instrument; -use turbo_tasks::{util::WrapFuture, RcStr, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{util::WrapFuture, Value, ValueToString, Vc}; use turbo_tasks_fs::{FileContent, FileSystemPath}; use turbo_tasks_hash::hash_xxh3_hash64; use turbopack_core::{ diff --git a/turbopack/crates/turbopack-ecmascript/src/references/amd.rs b/turbopack/crates/turbopack-ecmascript/src/references/amd.rs index fa8aa44008b5ae..bfe7b2d84a11b1 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/amd.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/amd.rs @@ -10,9 +10,9 @@ use swc_core::{ }, quote, quote_expr, }; +use turbo_rcstr::RcStr; use turbo_tasks::{ - debug::ValueDebugFormat, trace::TraceRawVcs, RcStr, ReadRef, TryJoinIterExt, Value, - ValueToString, Vc, + debug::ValueDebugFormat, trace::TraceRawVcs, ReadRef, TryJoinIterExt, Value, ValueToString, Vc, }; use turbopack_core::{ chunk::{ChunkableModuleReference, ChunkingContext}, diff --git a/turbopack/crates/turbopack-ecmascript/src/references/cjs.rs b/turbopack/crates/turbopack-ecmascript/src/references/cjs.rs index a7bc3b52fe4dca..22f671935044eb 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/cjs.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/cjs.rs @@ -4,7 +4,8 @@ use swc_core::{ ecma::ast::{CallExpr, Expr, ExprOrSpread, Ident, Lit}, quote, }; -use turbo_tasks::{RcStr, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Value, ValueToString, Vc}; use turbopack_core::{ chunk::{ChunkableModuleReference, ChunkingContext}, issue::IssueSource, diff --git a/turbopack/crates/turbopack-ecmascript/src/references/esm/base.rs b/turbopack/crates/turbopack-ecmascript/src/references/esm/base.rs index 32b491374d081a..3569fd2d6cf625 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/esm/base.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/esm/base.rs @@ -5,7 +5,8 @@ use swc_core::{ ecma::ast::{Decl, Expr, ExprStmt, Ident, Stmt}, quote, }; -use turbo_tasks::{RcStr, ResolvedVc, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Value, ValueToString, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ chunk::{ diff --git a/turbopack/crates/turbopack-ecmascript/src/references/esm/binding.rs b/turbopack/crates/turbopack-ecmascript/src/references/esm/binding.rs index 813170ec655df8..72db76eaa6dc8a 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/esm/binding.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/esm/binding.rs @@ -13,7 +13,8 @@ use swc_core::{ }, }, }; -use turbo_tasks::{trace::TraceRawVcs, RcStr, TaskInput, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{trace::TraceRawVcs, TaskInput, Vc}; use turbopack_core::chunk::ChunkingContext; use super::EsmAssetReference; diff --git a/turbopack/crates/turbopack-ecmascript/src/references/esm/dynamic.rs b/turbopack/crates/turbopack-ecmascript/src/references/esm/dynamic.rs index cc0690cd7ac5b0..583558df814796 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/esm/dynamic.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/esm/dynamic.rs @@ -4,7 +4,8 @@ use swc_core::{ ecma::ast::{CallExpr, Callee, Expr, ExprOrSpread, Lit}, quote_expr, }; -use turbo_tasks::{RcStr, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Value, ValueToString, Vc}; use turbopack_core::{ chunk::{ChunkableModuleReference, ChunkingContext, ChunkingType, ChunkingTypeOption}, environment::ChunkLoading, diff --git a/turbopack/crates/turbopack-ecmascript/src/references/esm/export.rs b/turbopack/crates/turbopack-ecmascript/src/references/esm/export.rs index 30beabbc7a3119..0ecd7779bb7c7a 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/esm/export.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/esm/export.rs @@ -14,8 +14,9 @@ use swc_core::{ }, quote, quote_expr, }; +use turbo_rcstr::RcStr; use turbo_tasks::{ - trace::TraceRawVcs, FxIndexMap, RcStr, ResolvedVc, TryFlatJoinIterExt, ValueToString, Vc, + trace::TraceRawVcs, FxIndexMap, ResolvedVc, TryFlatJoinIterExt, ValueToString, Vc, }; use turbo_tasks_fs::glob::Glob; use turbopack_core::{ diff --git a/turbopack/crates/turbopack-ecmascript/src/references/esm/module_id.rs b/turbopack/crates/turbopack-ecmascript/src/references/esm/module_id.rs index 0e221967a734c2..2599a9fd14ab07 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/esm/module_id.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/esm/module_id.rs @@ -1,6 +1,7 @@ use anyhow::Result; use swc_core::quote; -use turbo_tasks::{RcStr, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ValueToString, Vc}; use turbopack_core::{ chunk::{ ChunkItemExt, ChunkableModule, ChunkableModuleReference, ChunkingContext, diff --git a/turbopack/crates/turbopack-ecmascript/src/references/esm/url.rs b/turbopack/crates/turbopack-ecmascript/src/references/esm/url.rs index 47d111e1fcf557..3afbd26b18f555 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/esm/url.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/esm/url.rs @@ -3,7 +3,8 @@ use swc_core::{ ecma::ast::{Expr, ExprOrSpread, NewExpr}, quote, }; -use turbo_tasks::{RcStr, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Value, ValueToString, Vc}; use turbopack_core::{ chunk::{ ChunkItemExt, ChunkableModule, ChunkableModuleReference, ChunkingContext, ChunkingType, diff --git a/turbopack/crates/turbopack-ecmascript/src/references/external_module.rs b/turbopack/crates/turbopack-ecmascript/src/references/external_module.rs index 214710cc5f4042..27a3d7b3e27a2a 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/external_module.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/external_module.rs @@ -2,7 +2,8 @@ use std::{fmt::Display, io::Write}; use anyhow::Result; use serde::{Deserialize, Serialize}; -use turbo_tasks::{trace::TraceRawVcs, RcStr, TaskInput, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{trace::TraceRawVcs, TaskInput, Vc}; use turbo_tasks_fs::{glob::Glob, rope::RopeBuilder, FileContent, FileSystem, VirtualFileSystem}; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/turbopack/crates/turbopack-ecmascript/src/references/mod.rs b/turbopack/crates/turbopack-ecmascript/src/references/mod.rs index 9fb3867d53c7c2..41b79fe22af59f 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/mod.rs @@ -50,9 +50,8 @@ use swc_core::{ }, }; use tracing::Instrument; -use turbo_tasks::{ - FxIndexSet, RcStr, ResolvedVc, TryJoinIterExt, Upcast, Value, ValueToString, Vc, -}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexSet, ResolvedVc, TryJoinIterExt, Upcast, Value, ValueToString, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ compile_time_info::{ diff --git a/turbopack/crates/turbopack-ecmascript/src/references/node.rs b/turbopack/crates/turbopack-ecmascript/src/references/node.rs index cf65fca169f068..1986ea3acbaeef 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/node.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/node.rs @@ -1,6 +1,7 @@ use anyhow::Result; use either::Either; -use turbo_tasks::{RcStr, ResolvedVc, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, ValueToString, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ file_source::FileSource, diff --git a/turbopack/crates/turbopack-ecmascript/src/references/pattern_mapping.rs b/turbopack/crates/turbopack-ecmascript/src/references/pattern_mapping.rs index dd88d92bbcdb5e..5e110ef470fa84 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/pattern_mapping.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/pattern_mapping.rs @@ -10,9 +10,9 @@ use swc_core::{ }, quote, quote_expr, }; +use turbo_rcstr::RcStr; use turbo_tasks::{ - debug::ValueDebugFormat, trace::TraceRawVcs, FxIndexMap, RcStr, ResolvedVc, TryJoinIterExt, - Value, Vc, + debug::ValueDebugFormat, trace::TraceRawVcs, FxIndexMap, ResolvedVc, TryJoinIterExt, Value, Vc, }; use turbopack_core::{ chunk::{ChunkItemExt, ChunkableModule, ChunkingContext, ModuleId}, diff --git a/turbopack/crates/turbopack-ecmascript/src/references/raw.rs b/turbopack/crates/turbopack-ecmascript/src/references/raw.rs index be2878a4830c10..62583d912159f8 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/raw.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/raw.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ValueToString, Vc}; use turbopack_core::{ reference::ModuleReference, resolve::{pattern::Pattern, resolve_raw, ModuleResolveResult}, diff --git a/turbopack/crates/turbopack-ecmascript/src/references/require_context.rs b/turbopack/crates/turbopack-ecmascript/src/references/require_context.rs index 8601c5c914fcd4..78009c9c409fbd 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/require_context.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/require_context.rs @@ -12,7 +12,8 @@ use swc_core::{ }, quote, quote_expr, }; -use turbo_tasks::{primitives::Regex, FxIndexMap, RcStr, ResolvedVc, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{primitives::Regex, FxIndexMap, ResolvedVc, Value, ValueToString, Vc}; use turbo_tasks_fs::{DirectoryContent, DirectoryEntry, FileSystemPath}; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/turbopack/crates/turbopack-ecmascript/src/references/typescript.rs b/turbopack/crates/turbopack-ecmascript/src/references/typescript.rs index 84e8c64b56ebe1..fedd41189772be 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/typescript.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/typescript.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, ResolvedVc, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Value, ValueToString, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ context::AssetContext, diff --git a/turbopack/crates/turbopack-ecmascript/src/references/util.rs b/turbopack/crates/turbopack-ecmascript/src/references/util.rs index a464c8ff099a08..da8333852a1bff 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/util.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/util.rs @@ -1,6 +1,7 @@ use anyhow::Result; use swc_core::{ecma::ast::Expr, quote}; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbopack_core::resolve::parse::Request; /// Creates a IIFE expression that throws a "Cannot find module" error for the diff --git a/turbopack/crates/turbopack-ecmascript/src/references/worker.rs b/turbopack/crates/turbopack-ecmascript/src/references/worker.rs index fd4d0213ffc2f0..f951f7748da900 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/worker.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/worker.rs @@ -3,7 +3,8 @@ use swc_core::{ ecma::ast::{Expr, ExprOrSpread, Lit, NewExpr}, quote_expr, }; -use turbo_tasks::{RcStr, ResolvedVc, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Value, ValueToString, Vc}; use turbopack_core::{ chunk::{ChunkableModule, ChunkableModuleReference, ChunkingContext}, issue::{code_gen::CodeGenerationIssue, IssueExt, IssueSeverity, IssueSource, StyledString}, diff --git a/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/reference.rs b/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/reference.rs index 3cddb483be9642..8db4d396c37613 100644 --- a/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/reference.rs +++ b/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/reference.rs @@ -1,6 +1,7 @@ use anyhow::{bail, Context, Result}; use swc_core::{common::DUMMY_SP, ecma::ast::Ident, quote}; -use turbo_tasks::{RcStr, ResolvedVc, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, ValueToString, Vc}; use turbopack_core::{ chunk::{ ChunkItemExt, ChunkableModule, ChunkableModuleReference, ChunkingContext, ChunkingType, diff --git a/turbopack/crates/turbopack-ecmascript/src/text/mod.rs b/turbopack/crates/turbopack-ecmascript/src/text/mod.rs index d5d44f0be16e11..3dfc4dd7a3c4cb 100644 --- a/turbopack/crates/turbopack-ecmascript/src/text/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/src/text/mod.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbo_tasks_fs::FileContent; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/turbopack/crates/turbopack-ecmascript/src/transform/mod.rs b/turbopack/crates/turbopack-ecmascript/src/transform/mod.rs index d456498856dfef..e58c43409350c9 100644 --- a/turbopack/crates/turbopack-ecmascript/src/transform/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/src/transform/mod.rs @@ -17,7 +17,8 @@ use swc_core::{ }, quote, }; -use turbo_tasks::{RcStr, ResolvedVc, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ environment::Environment, diff --git a/turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs b/turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs index e82d6d41cc3b05..45c49c55c3f34f 100644 --- a/turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs +++ b/turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs @@ -20,7 +20,8 @@ use swc_core::{ utils::{find_pat_ids, private_ident, quote_ident, ExprCtx, ExprExt}, }, }; -use turbo_tasks::{FxIndexSet, RcStr}; +use turbo_rcstr::RcStr; +use turbo_tasks::FxIndexSet; use super::{ util::{ diff --git a/turbopack/crates/turbopack-ecmascript/src/tree_shake/mod.rs b/turbopack/crates/turbopack-ecmascript/src/tree_shake/mod.rs index 04cdf243461bf3..0c8bbf9aaf92b9 100644 --- a/turbopack/crates/turbopack-ecmascript/src/tree_shake/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/src/tree_shake/mod.rs @@ -12,7 +12,8 @@ use swc_core::{ codegen::to_code, }, }; -use turbo_tasks::{FxIndexSet, RcStr, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexSet, ValueToString, Vc}; use turbopack_core::{ident::AssetIdent, resolve::ModulePart, source::Source}; pub(crate) use self::graph::{ diff --git a/turbopack/crates/turbopack-ecmascript/src/typescript/mod.rs b/turbopack/crates/turbopack-ecmascript/src/typescript/mod.rs index 6bc1e28e6d842e..88385cd21077fe 100644 --- a/turbopack/crates/turbopack-ecmascript/src/typescript/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/src/typescript/mod.rs @@ -1,6 +1,7 @@ use anyhow::Result; use serde_json::Value as JsonValue; -use turbo_tasks::{RcStr, ResolvedVc, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Value, ValueToString, Vc}; use turbo_tasks_fs::DirectoryContent; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/turbopack/crates/turbopack-ecmascript/src/webpack/mod.rs b/turbopack/crates/turbopack-ecmascript/src/webpack/mod.rs index 4fd9082682a0bc..e70b3122305bcc 100644 --- a/turbopack/crates/turbopack-ecmascript/src/webpack/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/src/webpack/mod.rs @@ -1,6 +1,7 @@ use anyhow::Result; use swc_core::ecma::ast::Lit; -use turbo_tasks::{RcStr, ResolvedVc, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Value, ValueToString, Vc}; use turbopack_core::{ asset::{Asset, AssetContent}, file_source::FileSource, diff --git a/turbopack/crates/turbopack-ecmascript/src/worker_chunk/chunk_item.rs b/turbopack/crates/turbopack-ecmascript/src/worker_chunk/chunk_item.rs index 6f619256595b68..09f522e3d2b064 100644 --- a/turbopack/crates/turbopack-ecmascript/src/worker_chunk/chunk_item.rs +++ b/turbopack/crates/turbopack-ecmascript/src/worker_chunk/chunk_item.rs @@ -1,6 +1,7 @@ use anyhow::{bail, Result}; use indoc::formatdoc; -use turbo_tasks::{RcStr, TryJoinIterExt, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{TryJoinIterExt, Value, ValueToString, Vc}; use turbopack_core::{ chunk::{ availability_info::AvailabilityInfo, ChunkData, ChunkItem, ChunkType, ChunkingContext, diff --git a/turbopack/crates/turbopack-ecmascript/src/worker_chunk/module.rs b/turbopack/crates/turbopack-ecmascript/src/worker_chunk/module.rs index 9867ace428afad..65909800b95336 100644 --- a/turbopack/crates/turbopack-ecmascript/src/worker_chunk/module.rs +++ b/turbopack/crates/turbopack-ecmascript/src/worker_chunk/module.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbopack_core::{ asset::{Asset, AssetContent}, chunk::{ChunkableModule, ChunkingContext}, diff --git a/turbopack/crates/turbopack-env/Cargo.toml b/turbopack/crates/turbopack-env/Cargo.toml index 3287e316df4730..732250a1e127b4 100644 --- a/turbopack/crates/turbopack-env/Cargo.toml +++ b/turbopack/crates/turbopack-env/Cargo.toml @@ -16,6 +16,7 @@ workspace = true anyhow = { workspace = true } indexmap = { workspace = true } serde = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-env = { workspace = true } turbo-tasks-fs = { workspace = true } diff --git a/turbopack/crates/turbopack-env/src/embeddable.rs b/turbopack/crates/turbopack-env/src/embeddable.rs index 0f7cebce1e1196..b9d8494765c22c 100644 --- a/turbopack/crates/turbopack-env/src/embeddable.rs +++ b/turbopack/crates/turbopack-env/src/embeddable.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbo_tasks_env::{EnvMap, ProcessEnv}; use turbopack_ecmascript::utils::StringifyJs; diff --git a/turbopack/crates/turbopack-json/Cargo.toml b/turbopack/crates/turbopack-json/Cargo.toml index 69a788ae4fb52c..72632e5414ac42 100644 --- a/turbopack/crates/turbopack-json/Cargo.toml +++ b/turbopack/crates/turbopack-json/Cargo.toml @@ -15,6 +15,7 @@ workspace = true [dependencies] anyhow = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-fs = { workspace = true } turbopack-core = { workspace = true } diff --git a/turbopack/crates/turbopack-json/src/lib.rs b/turbopack/crates/turbopack-json/src/lib.rs index 548733341b31b3..8b15248eb7fbac 100644 --- a/turbopack/crates/turbopack-json/src/lib.rs +++ b/turbopack/crates/turbopack-json/src/lib.rs @@ -12,7 +12,8 @@ use std::fmt::Write; use anyhow::{bail, Error, Result}; -use turbo_tasks::{RcStr, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ValueToString, Vc}; use turbo_tasks_fs::{FileContent, FileJsonContent}; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/turbopack/crates/turbopack-mdx/Cargo.toml b/turbopack/crates/turbopack-mdx/Cargo.toml index 0805d282771711..0235457fef17d5 100644 --- a/turbopack/crates/turbopack-mdx/Cargo.toml +++ b/turbopack/crates/turbopack-mdx/Cargo.toml @@ -19,6 +19,7 @@ serde = { workspace = true } markdown = { workspace = true } mdxjs = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-fs = { workspace = true } turbopack-core = { workspace = true } diff --git a/turbopack/crates/turbopack-mdx/src/lib.rs b/turbopack/crates/turbopack-mdx/src/lib.rs index f4d545f02e97eb..3a6d112c9fe78a 100644 --- a/turbopack/crates/turbopack-mdx/src/lib.rs +++ b/turbopack/crates/turbopack-mdx/src/lib.rs @@ -4,7 +4,8 @@ use anyhow::Result; use mdxjs::{compile, MdxParseOptions, Options}; -use turbo_tasks::{RcStr, ValueDefault, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ValueDefault, Vc}; use turbo_tasks_fs::{rope::Rope, File, FileContent, FileSystemPath}; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/turbopack/crates/turbopack-node/Cargo.toml b/turbopack/crates/turbopack-node/Cargo.toml index 0b7ea08e374a34..d60575d01ea996 100644 --- a/turbopack/crates/turbopack-node/Cargo.toml +++ b/turbopack/crates/turbopack-node/Cargo.toml @@ -33,10 +33,10 @@ parking_lot = { workspace = true } regex = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -#serde_qs = { workspace = true } serde_with = { workspace = true, features = ["base64"] } tokio = { workspace = true, features = ["full"] } tracing = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-bytes = { workspace = true } turbo-tasks-env = { workspace = true } @@ -46,8 +46,6 @@ turbopack-core = { workspace = true } turbopack-dev-server = { workspace = true } turbopack-ecmascript = { workspace = true } turbopack-resolve = { workspace = true } -#url = { workspace = true } -#urlencoding = { workspace = true } [build-dependencies] turbo-tasks-build = { workspace = true } diff --git a/turbopack/crates/turbopack-node/src/embed_js.rs b/turbopack/crates/turbopack-node/src/embed_js.rs index 93f31eb503dd1d..15cc67cf2a6323 100644 --- a/turbopack/crates/turbopack-node/src/embed_js.rs +++ b/turbopack/crates/turbopack-node/src/embed_js.rs @@ -1,4 +1,5 @@ -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbo_tasks_fs::{embed_directory, FileContent, FileSystem, FileSystemPath}; #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-node/src/lib.rs b/turbopack/crates/turbopack-node/src/lib.rs index 00298bc5264fb6..11bd2293c5f298 100644 --- a/turbopack/crates/turbopack-node/src/lib.rs +++ b/turbopack/crates/turbopack-node/src/lib.rs @@ -8,9 +8,10 @@ use std::{collections::HashMap, iter::once, thread::available_parallelism}; use anyhow::{bail, Result}; pub use node_entry::{NodeEntry, NodeRenderingEntries, NodeRenderingEntry}; +use turbo_rcstr::RcStr; use turbo_tasks::{ graph::{AdjacencyMap, GraphTraversal}, - Completion, Completions, FxIndexSet, RcStr, ResolvedVc, TryJoinIterExt, ValueToString, Vc, + Completion, Completions, FxIndexSet, ResolvedVc, TryJoinIterExt, ValueToString, Vc, }; use turbo_tasks_env::ProcessEnv; use turbo_tasks_fs::{to_sys_path, File, FileSystemPath}; diff --git a/turbopack/crates/turbopack-node/src/pool.rs b/turbopack/crates/turbopack-node/src/pool.rs index 8fcac7c4466d60..be3585a46df518 100644 --- a/turbopack/crates/turbopack-node/src/pool.rs +++ b/turbopack/crates/turbopack-node/src/pool.rs @@ -27,7 +27,8 @@ use tokio::{ sync::{OwnedSemaphorePermit, Semaphore}, time::{sleep, timeout}, }; -use turbo_tasks::{duration_span, FxIndexSet, RcStr, ResolvedVc, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{duration_span, FxIndexSet, ResolvedVc, Vc}; use turbo_tasks_fs::{json::parse_json_with_source_context, FileSystemPath}; use turbopack_ecmascript::magic_identifier::unmangle_identifiers; diff --git a/turbopack/crates/turbopack-node/src/render/error_page.rs b/turbopack/crates/turbopack-node/src/render/error_page.rs index cb8737e28239ad..9fb62071d05e05 100644 --- a/turbopack/crates/turbopack-node/src/render/error_page.rs +++ b/turbopack/crates/turbopack-node/src/render/error_page.rs @@ -1,5 +1,6 @@ use anyhow::{Context, Result}; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbo_tasks_fs::embed_file; #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-node/src/render/mod.rs b/turbopack/crates/turbopack-node/src/render/mod.rs index 7b78d03aefe33e..5734c0ffa35c17 100644 --- a/turbopack/crates/turbopack-node/src/render/mod.rs +++ b/turbopack/crates/turbopack-node/src/render/mod.rs @@ -1,6 +1,7 @@ use serde::{Deserialize, Serialize}; use serde_json::Value as JsonValue; -use turbo_tasks::{FxIndexMap, RcStr, ReadRef}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, ReadRef}; use crate::{route_matcher::Param, ResponseHeaders, StructuredError}; diff --git a/turbopack/crates/turbopack-node/src/render/node_api_source.rs b/turbopack/crates/turbopack-node/src/render/node_api_source.rs index f6cde8eda4c5c1..1ef5dd0cacbca1 100644 --- a/turbopack/crates/turbopack-node/src/render/node_api_source.rs +++ b/turbopack/crates/turbopack-node/src/render/node_api_source.rs @@ -1,6 +1,7 @@ use anyhow::Result; use serde_json::Value as JsonValue; -use turbo_tasks::{FxIndexSet, RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexSet, ResolvedVc, Value, Vc}; use turbo_tasks_env::ProcessEnv; use turbo_tasks_fs::FileSystemPath; use turbopack_core::introspect::{ diff --git a/turbopack/crates/turbopack-node/src/render/render_proxy.rs b/turbopack/crates/turbopack-node/src/render/render_proxy.rs index 90fff30e5e8189..5efc6033238991 100644 --- a/turbopack/crates/turbopack-node/src/render/render_proxy.rs +++ b/turbopack/crates/turbopack-node/src/render/render_proxy.rs @@ -6,9 +6,10 @@ use futures::{ }; use parking_lot::Mutex; use serde::{Deserialize, Serialize}; +use turbo_rcstr::RcStr; use turbo_tasks::{ - duration_span, mark_finished, prevent_gc, util::SharedError, RawVc, RcStr, ResolvedVc, - TaskInput, ValueToString, Vc, + duration_span, mark_finished, prevent_gc, util::SharedError, RawVc, ResolvedVc, TaskInput, + ValueToString, Vc, }; use turbo_tasks_bytes::{Bytes, Stream}; use turbo_tasks_env::ProcessEnv; diff --git a/turbopack/crates/turbopack-node/src/render/rendered_source.rs b/turbopack/crates/turbopack-node/src/render/rendered_source.rs index ba24cb769b7144..b05ce9d12abfd2 100644 --- a/turbopack/crates/turbopack-node/src/render/rendered_source.rs +++ b/turbopack/crates/turbopack-node/src/render/rendered_source.rs @@ -1,6 +1,7 @@ use anyhow::Result; use serde_json::Value as JsonValue; -use turbo_tasks::{FxIndexSet, RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexSet, ResolvedVc, Value, Vc}; use turbo_tasks_env::ProcessEnv; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ diff --git a/turbopack/crates/turbopack-node/src/route_matcher.rs b/turbopack/crates/turbopack-node/src/route_matcher.rs index 81c87bee6ac797..7e973d43d13cb6 100644 --- a/turbopack/crates/turbopack-node/src/route_matcher.rs +++ b/turbopack/crates/turbopack-node/src/route_matcher.rs @@ -1,4 +1,5 @@ -use turbo_tasks::{FxIndexMap, RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, Vc}; #[turbo_tasks::value] #[derive(Debug, Clone)] diff --git a/turbopack/crates/turbopack-node/src/source_map/trace.rs b/turbopack/crates/turbopack-node/src/source_map/trace.rs index 389f978612458b..f70bab66c6e30a 100644 --- a/turbopack/crates/turbopack-node/src/source_map/trace.rs +++ b/turbopack/crates/turbopack-node/src/source_map/trace.rs @@ -4,7 +4,8 @@ use anyhow::Result; use mime::APPLICATION_JSON; use serde::{Deserialize, Serialize}; use serde_json::json; -use turbo_tasks::{RcStr, ResolvedVc, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Vc}; use turbo_tasks_fs::File; use turbopack_core::{ asset::AssetContent, diff --git a/turbopack/crates/turbopack-node/src/transforms/postcss.rs b/turbopack/crates/turbopack-node/src/transforms/postcss.rs index 3e4d5461e5b13f..9537c0c3010bd5 100644 --- a/turbopack/crates/turbopack-node/src/transforms/postcss.rs +++ b/turbopack/crates/turbopack-node/src/transforms/postcss.rs @@ -1,8 +1,9 @@ use anyhow::{bail, Context, Result}; use indoc::formatdoc; use serde::{Deserialize, Serialize}; +use turbo_rcstr::RcStr; use turbo_tasks::{ - fxindexmap, trace::TraceRawVcs, Completion, Completions, RcStr, ResolvedVc, TaskInput, + fxindexmap, trace::TraceRawVcs, Completion, Completions, ResolvedVc, TaskInput, TryFlatJoinIterExt, Value, Vc, }; use turbo_tasks_bytes::stream::SingleValue; diff --git a/turbopack/crates/turbopack-node/src/transforms/util.rs b/turbopack/crates/turbopack-node/src/transforms/util.rs index 303f7512ccc2d3..bb25c0444b7f00 100644 --- a/turbopack/crates/turbopack-node/src/transforms/util.rs +++ b/turbopack/crates/turbopack-node/src/transforms/util.rs @@ -3,7 +3,8 @@ use std::collections::BTreeMap; use anyhow::Result; use serde::{Deserialize, Serialize}; use serde_json::Value as JsonValue; -use turbo_tasks::{RcStr, ResolvedVc, TryJoinIterExt}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, TryJoinIterExt}; use turbo_tasks_fs::{File, FileContent, FileSystem}; use turbopack_core::{ asset::AssetContent, server_fs::ServerFileSystem, virtual_source::VirtualSource, diff --git a/turbopack/crates/turbopack-node/src/transforms/webpack.rs b/turbopack/crates/turbopack-node/src/transforms/webpack.rs index 4b54c36a59920f..f75aa0b84df2a1 100644 --- a/turbopack/crates/turbopack-node/src/transforms/webpack.rs +++ b/turbopack/crates/turbopack-node/src/transforms/webpack.rs @@ -6,9 +6,9 @@ use either::Either; use serde::{Deserialize, Serialize}; use serde_json::{json, Value as JsonValue}; use serde_with::serde_as; +use turbo_rcstr::RcStr; use turbo_tasks::{ - trace::TraceRawVcs, Completion, RcStr, ResolvedVc, TaskInput, TryJoinIterExt, Value, - ValueToString, Vc, + trace::TraceRawVcs, Completion, ResolvedVc, TaskInput, TryJoinIterExt, Value, ValueToString, Vc, }; use turbo_tasks_bytes::stream::SingleValue; use turbo_tasks_env::ProcessEnv; diff --git a/turbopack/crates/turbopack-nodejs/Cargo.toml b/turbopack/crates/turbopack-nodejs/Cargo.toml index d49dec0df36059..7e83a94d64facc 100644 --- a/turbopack/crates/turbopack-nodejs/Cargo.toml +++ b/turbopack/crates/turbopack-nodejs/Cargo.toml @@ -26,6 +26,7 @@ serde = { workspace = true } tracing = { workspace = true } urlencoding = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-fs = { workspace = true } turbo-tasks-hash = { workspace = true } diff --git a/turbopack/crates/turbopack-nodejs/src/chunking_context.rs b/turbopack/crates/turbopack-nodejs/src/chunking_context.rs index 10777e07865c9c..f75b384d006107 100644 --- a/turbopack/crates/turbopack-nodejs/src/chunking_context.rs +++ b/turbopack/crates/turbopack-nodejs/src/chunking_context.rs @@ -2,7 +2,8 @@ use std::iter::once; use anyhow::{bail, Context, Result}; use tracing::Instrument; -use turbo_tasks::{RcStr, ResolvedVc, TryJoinIterExt, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, TryJoinIterExt, Value, ValueToString, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ chunk::{ diff --git a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/chunk.rs b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/chunk.rs index 68ec5e255df99b..cdcca061ae2747 100644 --- a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/chunk.rs +++ b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/chunk.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{FxIndexSet, RcStr, ResolvedVc, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexSet, ResolvedVc, ValueToString, Vc}; use turbopack_core::{ asset::{Asset, AssetContent}, chunk::{Chunk, ChunkingContext}, diff --git a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/chunk.rs b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/chunk.rs index 9043bd3c55c4ff..d1f4e9ab3d6c38 100644 --- a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/chunk.rs +++ b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/chunk.rs @@ -2,7 +2,8 @@ use std::io::Write; use anyhow::{bail, Result}; use indoc::writedoc; -use turbo_tasks::{RcStr, ResolvedVc, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, ValueToString, Vc}; use turbo_tasks_fs::{File, FileSystemPath}; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/runtime.rs b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/runtime.rs index 2ccb59c624c105..c2540e617a3535 100644 --- a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/runtime.rs +++ b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/runtime.rs @@ -2,7 +2,8 @@ use std::io::Write; use anyhow::{bail, Result}; use indoc::writedoc; -use turbo_tasks::{RcStr, ResolvedVc, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, ValueToString, Vc}; use turbo_tasks_fs::{File, FileSystem}; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/version.rs b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/version.rs index be165f3757c7db..fd3e691dda7fc9 100644 --- a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/version.rs +++ b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/version.rs @@ -1,5 +1,6 @@ use anyhow::{bail, Result}; -use turbo_tasks::{RcStr, ReadRef, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ReadRef, Vc}; use turbo_tasks_fs::FileSystemPath; use turbo_tasks_hash::{encode_hex, Xxh3Hash64Hasher}; use turbopack_core::{ diff --git a/turbopack/crates/turbopack-resolve/Cargo.toml b/turbopack/crates/turbopack-resolve/Cargo.toml index 8c26ee81ff2d93..3ba25a4f2ba2be 100644 --- a/turbopack/crates/turbopack-resolve/Cargo.toml +++ b/turbopack/crates/turbopack-resolve/Cargo.toml @@ -20,6 +20,7 @@ regex = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } tracing = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-fs = { workspace = true } turbopack-core = { workspace = true } diff --git a/turbopack/crates/turbopack-resolve/src/node_native_binding.rs b/turbopack/crates/turbopack-resolve/src/node_native_binding.rs index 8dfe9cd3db081f..ee023696e27214 100644 --- a/turbopack/crates/turbopack-resolve/src/node_native_binding.rs +++ b/turbopack/crates/turbopack-resolve/src/node_native_binding.rs @@ -2,9 +2,8 @@ use anyhow::Result; use lazy_static::lazy_static; use regex::Regex; use serde::{Deserialize, Serialize}; -use turbo_tasks::{ - FxIndexMap, RcStr, ResolvedVc, TryFlatJoinIterExt, TryJoinIterExt, ValueToString, Vc, -}; +use turbo_rcstr::RcStr; +use turbo_tasks::{FxIndexMap, ResolvedVc, TryFlatJoinIterExt, TryJoinIterExt, ValueToString, Vc}; use turbo_tasks_fs::{ glob::Glob, json::parse_json_rope_with_source_context, DirectoryEntry, FileContent, FileSystemEntryType, FileSystemPath, diff --git a/turbopack/crates/turbopack-resolve/src/resolve_options_context.rs b/turbopack/crates/turbopack-resolve/src/resolve_options_context.rs index 979b1e099e1677..b7e009fab215f6 100644 --- a/turbopack/crates/turbopack-resolve/src/resolve_options_context.rs +++ b/turbopack/crates/turbopack-resolve/src/resolve_options_context.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, ResolvedVc, ValueDefault, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, ValueDefault, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ condition::ContextCondition, diff --git a/turbopack/crates/turbopack-resolve/src/typescript.rs b/turbopack/crates/turbopack-resolve/src/typescript.rs index bc7dee90559996..934be4a2539ad1 100644 --- a/turbopack/crates/turbopack-resolve/src/typescript.rs +++ b/turbopack/crates/turbopack-resolve/src/typescript.rs @@ -2,7 +2,8 @@ use std::{collections::HashMap, fmt::Write, mem::take}; use anyhow::Result; use serde_json::Value as JsonValue; -use turbo_tasks::{fxindexset, RcStr, ResolvedVc, Value, ValueDefault, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{fxindexset, ResolvedVc, Value, ValueDefault, Vc}; use turbo_tasks_fs::{FileContent, FileJsonContent, FileSystemPath}; use turbopack_core::{ asset::Asset, diff --git a/turbopack/crates/turbopack-static/Cargo.toml b/turbopack/crates/turbopack-static/Cargo.toml index 4d0f18a899f2f4..f0ffd9a9d95d6e 100644 --- a/turbopack/crates/turbopack-static/Cargo.toml +++ b/turbopack/crates/turbopack-static/Cargo.toml @@ -15,6 +15,7 @@ workspace = true [dependencies] anyhow = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-fs = { workspace = true } turbo-tasks-hash = { workspace = true } diff --git a/turbopack/crates/turbopack-static/src/lib.rs b/turbopack/crates/turbopack-static/src/lib.rs index 549d916ad846bc..355d85385ac2dd 100644 --- a/turbopack/crates/turbopack-static/src/lib.rs +++ b/turbopack/crates/turbopack-static/src/lib.rs @@ -16,7 +16,8 @@ pub mod fixed; pub mod output_asset; use anyhow::Result; -use turbo_tasks::{RcStr, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ValueToString, Vc}; use turbopack_core::{ asset::{Asset, AssetContent}, chunk::{ChunkItem, ChunkType, ChunkableModule, ChunkingContext}, diff --git a/turbopack/crates/turbopack-swc-utils/Cargo.toml b/turbopack/crates/turbopack-swc-utils/Cargo.toml index 71dc4e0730eb7a..aa8afc4798c759 100644 --- a/turbopack/crates/turbopack-swc-utils/Cargo.toml +++ b/turbopack/crates/turbopack-swc-utils/Cargo.toml @@ -13,6 +13,7 @@ bench = false workspace = true [dependencies] +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbopack-core = { workspace = true } diff --git a/turbopack/crates/turbopack-swc-utils/src/emitter.rs b/turbopack/crates/turbopack-swc-utils/src/emitter.rs index 6babef05608ae9..c89b38a30f18b6 100644 --- a/turbopack/crates/turbopack-swc-utils/src/emitter.rs +++ b/turbopack/crates/turbopack-swc-utils/src/emitter.rs @@ -5,7 +5,8 @@ use swc_core::common::{ source_map::SmallPos, SourceMap, }; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbopack_core::{ issue::{analyze::AnalyzeIssue, IssueExt, IssueSeverity, IssueSource, StyledString}, source::Source, diff --git a/turbopack/crates/turbopack-test-utils/Cargo.toml b/turbopack/crates/turbopack-test-utils/Cargo.toml index d6a6a108611f7f..ed15eb0a6f6fd6 100644 --- a/turbopack/crates/turbopack-test-utils/Cargo.toml +++ b/turbopack/crates/turbopack-test-utils/Cargo.toml @@ -18,6 +18,7 @@ once_cell = { workspace = true } regex = { workspace = true, features = ["pattern"] } serde = { workspace = true } similar = "2.2.0" +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-fs = { workspace = true } turbo-tasks-hash = { workspace = true } diff --git a/turbopack/crates/turbopack-test-utils/src/snapshot.rs b/turbopack/crates/turbopack-test-utils/src/snapshot.rs index 2c73d5bd7e53f6..d4a2ab4836b235 100644 --- a/turbopack/crates/turbopack-test-utils/src/snapshot.rs +++ b/turbopack/crates/turbopack-test-utils/src/snapshot.rs @@ -8,7 +8,8 @@ use anyhow::{anyhow, bail, Context, Result}; use once_cell::sync::Lazy; use regex::Regex; use similar::TextDiff; -use turbo_tasks::{RcStr, ReadRef, TryJoinIterExt, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ReadRef, TryJoinIterExt, ValueToString, Vc}; use turbo_tasks_fs::{ DirectoryContent, DirectoryEntry, DiskFileSystem, File, FileContent, FileSystemEntryType, FileSystemPath, diff --git a/turbopack/crates/turbopack-tests/Cargo.toml b/turbopack/crates/turbopack-tests/Cargo.toml index 9c1d21604bab0b..a5345623dd36b3 100644 --- a/turbopack/crates/turbopack-tests/Cargo.toml +++ b/turbopack/crates/turbopack-tests/Cargo.toml @@ -25,6 +25,7 @@ serde = { workspace = true } serde_json = { workspace = true } testing = { workspace = true } tokio = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-bytes = { workspace = true } turbo-tasks-env = { workspace = true } diff --git a/turbopack/crates/turbopack-tests/tests/execution.rs b/turbopack/crates/turbopack-tests/tests/execution.rs index 88c7b06cfd8799..c3ee0598d21ca4 100644 --- a/turbopack/crates/turbopack-tests/tests/execution.rs +++ b/turbopack/crates/turbopack-tests/tests/execution.rs @@ -10,8 +10,9 @@ use std::path::PathBuf; use anyhow::{Context, Result}; use dunce::canonicalize; use serde::{Deserialize, Serialize}; +use turbo_rcstr::RcStr; use turbo_tasks::{ - debug::ValueDebugFormat, fxindexmap, trace::TraceRawVcs, Completion, RcStr, ResolvedVc, + debug::ValueDebugFormat, fxindexmap, trace::TraceRawVcs, Completion, ResolvedVc, TryJoinIterExt, TurboTasks, Value, Vc, }; use turbo_tasks_bytes::stream::SingleValue; diff --git a/turbopack/crates/turbopack-tests/tests/snapshot.rs b/turbopack/crates/turbopack-tests/tests/snapshot.rs index abc4622c808da4..078c22e4cc244b 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot.rs +++ b/turbopack/crates/turbopack-tests/tests/snapshot.rs @@ -13,9 +13,9 @@ use anyhow::{bail, Context, Result}; use dunce::canonicalize; use serde::Deserialize; use serde_json::json; +use turbo_rcstr::RcStr; use turbo_tasks::{ - RcStr, ReadConsistency, ReadRef, ResolvedVc, TryJoinIterExt, TurboTasks, Value, ValueToString, - Vc, + ReadConsistency, ReadRef, ResolvedVc, TryJoinIterExt, TurboTasks, Value, ValueToString, Vc, }; use turbo_tasks_env::DotenvProcessEnv; use turbo_tasks_fs::{ diff --git a/turbopack/crates/turbopack-tests/tests/util.rs b/turbopack/crates/turbopack-tests/tests/util.rs index d256f375ba71f0..3758d6edef0596 100644 --- a/turbopack/crates/turbopack-tests/tests/util.rs +++ b/turbopack/crates/turbopack-tests/tests/util.rs @@ -2,7 +2,7 @@ use std::path::PathBuf; use dunce::canonicalize; use once_cell::sync::Lazy; -use turbo_tasks::RcStr; +use turbo_rcstr::RcStr; /// The turbo repo root. Should be used as the root when building with turbopack /// against fixtures in this crate. diff --git a/turbopack/crates/turbopack-wasm/Cargo.toml b/turbopack/crates/turbopack-wasm/Cargo.toml index 5628920ad32cba..f5920f57f0a14a 100644 --- a/turbopack/crates/turbopack-wasm/Cargo.toml +++ b/turbopack/crates/turbopack-wasm/Cargo.toml @@ -17,6 +17,7 @@ anyhow = { workspace = true } indexmap = { workspace = true } indoc = { workspace = true } serde = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-fs = { workspace = true } turbopack-core = { workspace = true } diff --git a/turbopack/crates/turbopack-wasm/src/loader.rs b/turbopack/crates/turbopack-wasm/src/loader.rs index e7f5594b4ad3e0..76861f5f199048 100644 --- a/turbopack/crates/turbopack-wasm/src/loader.rs +++ b/turbopack/crates/turbopack-wasm/src/loader.rs @@ -2,7 +2,8 @@ use std::fmt::Write; use anyhow::Result; use indoc::{formatdoc, writedoc}; -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbo_tasks_fs::File; use turbopack_core::{asset::AssetContent, source::Source, virtual_source::VirtualSource}; use turbopack_ecmascript::utils::StringifyJs; diff --git a/turbopack/crates/turbopack-wasm/src/module_asset.rs b/turbopack/crates/turbopack-wasm/src/module_asset.rs index 3c85cd8b717068..c9317d3a5621dc 100644 --- a/turbopack/crates/turbopack-wasm/src/module_asset.rs +++ b/turbopack/crates/turbopack-wasm/src/module_asset.rs @@ -1,5 +1,6 @@ use anyhow::{bail, Context, Result}; -use turbo_tasks::{fxindexmap, RcStr, ResolvedVc, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{fxindexmap, ResolvedVc, Value, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ asset::{Asset, AssetContent}, diff --git a/turbopack/crates/turbopack-wasm/src/output_asset.rs b/turbopack/crates/turbopack-wasm/src/output_asset.rs index 31453ec89893a0..23c405bcd6780d 100644 --- a/turbopack/crates/turbopack-wasm/src/output_asset.rs +++ b/turbopack/crates/turbopack-wasm/src/output_asset.rs @@ -1,4 +1,5 @@ -use turbo_tasks::{RcStr, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::Vc; use turbopack_core::{ asset::{Asset, AssetContent}, chunk::ChunkingContext, diff --git a/turbopack/crates/turbopack-wasm/src/raw.rs b/turbopack/crates/turbopack-wasm/src/raw.rs index d5004c0950e462..0151306606650b 100644 --- a/turbopack/crates/turbopack-wasm/src/raw.rs +++ b/turbopack/crates/turbopack-wasm/src/raw.rs @@ -1,5 +1,6 @@ use anyhow::{bail, Result}; -use turbo_tasks::{RcStr, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ValueToString, Vc}; use turbopack_core::{ asset::{Asset, AssetContent}, chunk::{ChunkItem, ChunkType, ChunkableModule, ChunkingContext}, diff --git a/turbopack/crates/turbopack/Cargo.toml b/turbopack/crates/turbopack/Cargo.toml index 55cad6b5d54d5d..ecb9d46e6b0349 100644 --- a/turbopack/crates/turbopack/Cargo.toml +++ b/turbopack/crates/turbopack/Cargo.toml @@ -26,6 +26,7 @@ serde_json = { workspace = true } tokio = { workspace = true } tracing = { workspace = true } +turbo-rcstr = { workspace = true } turbo-tasks = { workspace = true } turbo-tasks-env = { workspace = true } turbo-tasks-fs = { workspace = true } diff --git a/turbopack/crates/turbopack/benches/node_file_trace.rs b/turbopack/crates/turbopack/benches/node_file_trace.rs index d2a23ebd06cffd..ce1b769558d844 100644 --- a/turbopack/crates/turbopack/benches/node_file_trace.rs +++ b/turbopack/crates/turbopack/benches/node_file_trace.rs @@ -2,7 +2,8 @@ use std::{fs, path::PathBuf}; use criterion::{Bencher, BenchmarkId, Criterion}; use regex::Regex; -use turbo_tasks::{RcStr, ReadConsistency, TurboTasks, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ReadConsistency, TurboTasks, Value, Vc}; use turbo_tasks_fs::{DiskFileSystem, FileSystem, NullFileSystem}; use turbo_tasks_memory::MemoryBackend; use turbopack::{ diff --git a/turbopack/crates/turbopack/examples/turbopack.rs b/turbopack/crates/turbopack/examples/turbopack.rs index 611fc9e5fddc22..397488ef595992 100644 --- a/turbopack/crates/turbopack/examples/turbopack.rs +++ b/turbopack/crates/turbopack/examples/turbopack.rs @@ -8,9 +8,8 @@ use std::{ use anyhow::Result; use tokio::{spawn, time::sleep}; -use turbo_tasks::{ - util::FormatDuration, RcStr, ReadConsistency, TurboTasks, UpdateInfo, Value, Vc, -}; +use turbo_rcstr::RcStr; +use turbo_tasks::{util::FormatDuration, ReadConsistency, TurboTasks, UpdateInfo, Value, Vc}; use turbo_tasks_fs::{DiskFileSystem, FileSystem}; use turbo_tasks_memory::MemoryBackend; use turbopack::{emit_with_completion, rebase::RebasedAsset, register}; diff --git a/turbopack/crates/turbopack/src/evaluate_context.rs b/turbopack/crates/turbopack/src/evaluate_context.rs index 927d95a4421aff..e932acec05f861 100644 --- a/turbopack/crates/turbopack/src/evaluate_context.rs +++ b/turbopack/crates/turbopack/src/evaluate_context.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_tasks::{RcStr, Value, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Value, Vc}; use turbo_tasks_env::ProcessEnv; use turbo_tasks_fs::FileSystem; use turbopack_core::{ diff --git a/turbopack/crates/turbopack/src/lib.rs b/turbopack/crates/turbopack/src/lib.rs index 5af7ce5fa0ca79..60e2b3f85c6cc5 100644 --- a/turbopack/crates/turbopack/src/lib.rs +++ b/turbopack/crates/turbopack/src/lib.rs @@ -30,7 +30,8 @@ use ecmascript::{ use graph::{aggregate, AggregatedGraph, AggregatedGraphNodeContent}; use module_options::{ModuleOptions, ModuleOptionsContext, ModuleRuleEffect, ModuleType}; use tracing::Instrument; -use turbo_tasks::{Completion, RcStr, ResolvedVc, Value, ValueToString, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{Completion, ResolvedVc, Value, ValueToString, Vc}; use turbo_tasks_fs::{glob::Glob, FileSystemPath}; pub use turbopack_core::condition; use turbopack_core::{ diff --git a/turbopack/crates/turbopack/src/module_options/mod.rs b/turbopack/crates/turbopack/src/module_options/mod.rs index 115c913ac1d1a1..4ad6d427aafdc9 100644 --- a/turbopack/crates/turbopack/src/module_options/mod.rs +++ b/turbopack/crates/turbopack/src/module_options/mod.rs @@ -10,7 +10,8 @@ pub use custom_module_type::CustomModuleType; pub use module_options_context::*; pub use module_rule::*; pub use rule_condition::*; -use turbo_tasks::{RcStr, ResolvedVc, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Vc}; use turbo_tasks_fs::{glob::Glob, FileSystemPath}; use turbopack_core::{ reference_type::{CssReferenceSubType, ReferenceType, UrlReferenceSubType}, diff --git a/turbopack/crates/turbopack/src/module_options/module_options_context.rs b/turbopack/crates/turbopack/src/module_options/module_options_context.rs index a92f8d77129ff0..884f6f0cdb2149 100644 --- a/turbopack/crates/turbopack/src/module_options/module_options_context.rs +++ b/turbopack/crates/turbopack/src/module_options/module_options_context.rs @@ -1,5 +1,6 @@ use serde::{Deserialize, Serialize}; -use turbo_tasks::{trace::TraceRawVcs, FxIndexMap, RcStr, ResolvedVc, ValueDefault, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{trace::TraceRawVcs, FxIndexMap, ResolvedVc, ValueDefault, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ chunk::MinifyType, condition::ContextCondition, environment::Environment, diff --git a/turbopack/crates/turbopack/src/transition/context_transition.rs b/turbopack/crates/turbopack/src/transition/context_transition.rs index 3fc3a0ba82553a..a245218de7d5f3 100644 --- a/turbopack/crates/turbopack/src/transition/context_transition.rs +++ b/turbopack/crates/turbopack/src/transition/context_transition.rs @@ -1,4 +1,5 @@ -use turbo_tasks::{RcStr, ResolvedVc, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Vc}; use turbopack_core::compile_time_info::CompileTimeInfo; use turbopack_resolve::resolve_options_context::ResolveOptionsContext; diff --git a/turbopack/crates/turbopack/src/transition/mod.rs b/turbopack/crates/turbopack/src/transition/mod.rs index 3aef90ec891330..fccd0879a8e82a 100644 --- a/turbopack/crates/turbopack/src/transition/mod.rs +++ b/turbopack/crates/turbopack/src/transition/mod.rs @@ -6,7 +6,8 @@ use std::collections::HashMap; use anyhow::Result; pub use context_transition::ContextTransition; pub use full_context_transition::FullContextTransition; -use turbo_tasks::{RcStr, ResolvedVc, Value, ValueDefault, Vc}; +use turbo_rcstr::RcStr; +use turbo_tasks::{ResolvedVc, Value, ValueDefault, Vc}; use turbopack_core::{ compile_time_info::CompileTimeInfo, context::ProcessResult, module::Module, reference_type::ReferenceType, source::Source, diff --git a/turbopack/crates/turbopack/tests/node-file-trace.rs b/turbopack/crates/turbopack/tests/node-file-trace.rs index fad297966c66dd..7e908c9e0b62e7 100644 --- a/turbopack/crates/turbopack/tests/node-file-trace.rs +++ b/turbopack/crates/turbopack/tests/node-file-trace.rs @@ -29,9 +29,8 @@ use rstest_reuse::{ }; use serde::{Deserialize, Serialize}; use tokio::{process::Command, time::timeout}; -use turbo_tasks::{ - backend::Backend, RcStr, ReadRef, ResolvedVc, TurboTasks, Value, ValueToString, Vc, -}; +use turbo_rcstr::RcStr; +use turbo_tasks::{backend::Backend, ReadRef, ResolvedVc, TurboTasks, Value, ValueToString, Vc}; use turbo_tasks_fs::{DiskFileSystem, FileSystem, FileSystemPath}; use turbo_tasks_memory::MemoryBackend; use turbopack::{