-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
codemod(turbopack): Rewrite a few instances of Vc as ResolvedVc #70927
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ use std::{env, sync::MutexGuard}; | |
|
||
use anyhow::{anyhow, Context, Result}; | ||
use indexmap::IndexMap; | ||
use turbo_tasks::{RcStr, ValueToString, Vc}; | ||
use turbo_tasks::{RcStr, ResolvedVc, ValueToString, Vc}; | ||
use turbo_tasks_fs::{FileContent, FileSystemPath}; | ||
|
||
use crate::{sorted_env_vars, EnvMap, ProcessEnv, GLOBAL_ENV_LOCK}; | ||
|
@@ -12,14 +12,17 @@ use crate::{sorted_env_vars, EnvMap, ProcessEnv, GLOBAL_ENV_LOCK}; | |
/// from. | ||
#[turbo_tasks::value] | ||
pub struct DotenvProcessEnv { | ||
prior: Option<Vc<Box<dyn ProcessEnv>>>, | ||
prior: Option<ResolvedVc<Box<dyn ProcessEnv>>>, | ||
path: Vc<FileSystemPath>, | ||
} | ||
|
||
#[turbo_tasks::value_impl] | ||
impl DotenvProcessEnv { | ||
#[turbo_tasks::function] | ||
pub fn new(prior: Option<Vc<Box<dyn ProcessEnv>>>, path: Vc<FileSystemPath>) -> Vc<Self> { | ||
pub fn new( | ||
prior: Option<ResolvedVc<Box<dyn ProcessEnv>>>, | ||
path: Vc<FileSystemPath>, | ||
) -> Vc<Self> { | ||
Comment on lines
+22
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the only "fix" that the codemod script currently knows how to apply: rewriting function arguments. |
||
DotenvProcessEnv { prior, path }.cell() | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,12 +92,14 @@ impl Issue for UnsupportedSwcEcmaTransformPluginsIssue { | |
#[derive(Debug)] | ||
pub struct SwcEcmaTransformPluginsTransformer { | ||
#[cfg(feature = "swc_ecma_transform_plugin")] | ||
plugins: Vec<(Vc<SwcPluginModule>, serde_json::Value)>, | ||
plugins: Vec<(turbo_tasks::ResolvedVc<SwcPluginModule>, serde_json::Value)>, | ||
} | ||
|
||
impl SwcEcmaTransformPluginsTransformer { | ||
#[cfg(feature = "swc_ecma_transform_plugin")] | ||
pub fn new(plugins: Vec<(Vc<SwcPluginModule>, serde_json::Value)>) -> Self { | ||
pub fn new( | ||
plugins: Vec<(turbo_tasks::ResolvedVc<SwcPluginModule>, serde_json::Value)>, | ||
) -> Self { | ||
Comment on lines
+95
to
+102
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another manual fix due to conditional compilation: When this feature isn't enabled (on some platforms?) the import was seen as unused, so we have to use the fully qualified name instead to avoid the lint warning. |
||
Self { plugins } | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to hand-fix this. The script incorrectly thought it's modification was correct because this function is gated behind
#[cfg(feature = "plugin")]
.