Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a GlobalInformation struct #8912

Closed
wants to merge 1 commit into from
Closed

Conversation

LichuAcu
Copy link

@LichuAcu LichuAcu commented Aug 1, 2024

Description

A GlobalInformation struct is added, which is made available through the ChunkingContext trait. Constructing a new GlobalInformation takes a Project parameter, which gives the constructor access to global information. ChunkingContext builder methods now also take a GlobalInformation object.

Testing Instructions

Copy link

vercel bot commented Aug 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 6, 2024 9:10pm
rust-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 6, 2024 9:10pm
8 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Aug 6, 2024 9:10pm
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview Aug 6, 2024 9:10pm
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview Aug 6, 2024 9:10pm
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview Aug 6, 2024 9:10pm
examples-native-web ⬜️ Ignored (Inspect) Visit Preview Aug 6, 2024 9:10pm
examples-svelte-web ⬜️ Ignored (Inspect) Visit Preview Aug 6, 2024 9:10pm
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Aug 6, 2024 9:10pm
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview Aug 6, 2024 9:10pm

Copy link
Author

LichuAcu commented Aug 1, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @LichuAcu and the rest of your teammates on Graphite Graphite

@LichuAcu LichuAcu changed the title Added a GlobalInformation struct, which is made available through the ChunkingContext trait. Constructing a new GlobalInformation object takes a Project parameter, giving the constructor access to global information Add a GlobalInformation struct Aug 1, 2024
@LichuAcu LichuAcu marked this pull request as ready for review August 1, 2024 16:38
@LichuAcu LichuAcu requested a review from a team as a code owner August 1, 2024 16:38
@LichuAcu LichuAcu marked this pull request as draft August 1, 2024 16:48
@@ -122,6 +123,8 @@ pub struct BrowserChunkingContext {
minify_type: MinifyType,
/// Whether to use manifest chunks for lazy compilation
manifest_chunks: bool,
/// Global information
global_information: Vc<OptionGlobalInformation>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Option<Vc<GlobalInformation>>

@@ -133,6 +136,7 @@ impl BrowserChunkingContext {
asset_root_path: Vc<FileSystemPath>,
environment: Vc<Environment>,
runtime_type: RuntimeType,
global_information: Vc<OptionGlobalInformation>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That shouldn't be passed here (we don't want to force to always pass that).

Instead add a global_information() method to pass that, similar to the other optional fields

@@ -96,6 +99,7 @@ impl NodeJsChunkingContext {
asset_root_path: Vc<FileSystemPath>,
environment: Vc<Environment>,
runtime_type: RuntimeType,
global_information: Vc<OptionGlobalInformation>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

@sokra sokra closed this Aug 5, 2024
@sokra sokra reopened this Aug 5, 2024
@turbo-orchestrator turbo-orchestrator bot added needs: triage New issues get this label. Remove it after triage owned-by: turborepo labels Aug 5, 2024
… ChunkingContext trait.

Constructing a new GlobalInformation object takes a Project parameter, giving the constructor access to global information
LichuAcu pushed a commit to vercel/next.js that referenced this pull request Aug 23, 2024
### What?

Refactored module ID strategies implementation to walk modules graph individually for each endpoint.

Based on feedback from [next.js#68408](#68408) and [turbo#8912](vercel/turborepo#8912).

Comments marked with `NOTE(LichuAcu)` are intended to make reviewing easier and will be removed before merging.
@LichuAcu LichuAcu closed this Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants