-
Notifications
You must be signed in to change notification settings - Fork 1.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
fix(mfe): build internal package if present in graph #9383
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
8 Skipped Deployments
|
@@ -57,6 +57,11 @@ impl From<UnescapedString> for String { | |||
} | |||
} | |||
|
|||
impl From<String> for UnescapedString { |
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.
Required since there isn't any other way to construct an UnescapedString
@@ -184,7 +186,10 @@ impl TurboJsonLoader { | |||
Error::NoTurboJSON => Ok(TurboJson::default()), | |||
err => Err(err), | |||
})?; | |||
turbo_json.with_proxy(); | |||
let needs_proxy_build = packages |
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.
We only want to add this if the internal package is in the graph meaning there's a valid build task
@@ -619,6 +620,11 @@ impl TurboJson { | |||
TaskName::from("proxy"), | |||
Spanned::new(RawTaskDefinition { | |||
cache: Some(Spanned::new(false)), | |||
depends_on: needs_proxy_build.then(|| { | |||
Spanned::new(vec![Spanned::new(UnescapedString::from(format!( | |||
"{MICRO_FRONTENDS_PACKAGE_INTERNAL}#build" |
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.
Don't love that we have to hardcode this task, but we can iterate on it.
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 also don't love this, but for all other uses of the MFE package that don't have it as a workspace package this will be unnecessary.
Description
Previously we were relying on the proxy already being built, for non-internal use cases this will be true, but for the internal case we need to make sure it is built before we try to start the proxy.
Testing Instructions
packages/micro-frontends/dist/bin/cli.cjs
and add athrow new Error("oops")
to the topturbo vercel-docs#dev
should fail due to the proxy script failingturbo
:turbo_dev --skip-infer vercel-docs#dev
, you will see the MFE package being built before the proxy is started.