-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Turbopack: Implement structured styled text and use it in issue descriptions #6388
Conversation
…iptions This implements a basic structure representing styled text and uses it in issue descriptions. This can be used by the cli and web-based error reporting. Tested with an upcoming Next.js PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
7 Ignored Deployments
|
Requires vercel/turborepo#6388 This uses the structure implemented in vercel/turborepo#6388 to support formatted text when reporting. Right now only the `Line` and basic `String` cases are handled.
@@ -73,6 +73,41 @@ impl Display for IssueSeverity { | |||
} | |||
} | |||
|
|||
#[derive(Clone, Debug)] | |||
#[turbo_tasks::value(shared)] | |||
pub enum StyledString { |
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.
not going to suggest to make any changes, just random thoughts that if we could just pass raw markdown or formatted text and consumer (next-swc) can transparently renders it'd be cool
✅ This change can build |
🟢 CI successful 🟢Thanks |
Linux Benchmark for 225461cClick to view benchmark
|
🟢 Turbopack Benchmark CI successful 🟢Thanks |
@@ -55,7 +56,7 @@ async fn get_update_stream_item( | |||
plain_issues.push( | |||
FatalStreamIssue { | |||
resource: resource.to_string(), | |||
description: Vc::cell(format!("{}", PrettyPrintError(&e))), | |||
description: StyledString::String(format!("{}", PrettyPrintError(&e))).cell(), |
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 might want a helper to pretty print an error directly into a styled string, so we can use formatting during pretty printing. But that's something for a follow-up PR
fn description(&self) -> Vc<String> { | ||
Vc::cell( | ||
fn description(&self) -> Vc<StyledString> { | ||
StyledString::String( | ||
"React Refresh will be disabled.\nTo enable React Refresh, install the \ | ||
`react-refresh` and `@next/react-refresh-utils` modules." |
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.
Code
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 would be nice to have a styled!
macro that converts markdown to styled string. But that's probably a lot work...
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Linux Benchmark for 1a33186Click to view benchmark
|
Linux Benchmark for 1ac43b8Click to view benchmark
|
Linux Benchmark for 5a8c66dClick to view benchmark
|
Linux Benchmark for ab7a6daClick to view benchmark
|
Linux Benchmark for 680691cClick to view benchmark
|
Requires vercel/turborepo#6388 This uses the structure implemented in vercel/turborepo#6388 to support formatted text when reporting. Right now only the `Line` and basic `String` cases are handled.
…iptions (vercel/turborepo#6388) This implements a basic structure representing styled text and uses it in issue descriptions. This can be used by the cli and web-based error reporting. Tested with an upcoming Next.js PR --------- Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
…iptions (vercel/turborepo#6388) This implements a basic structure representing styled text and uses it in issue descriptions. This can be used by the cli and web-based error reporting. Tested with an upcoming Next.js PR --------- Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
…iptions (vercel/turborepo#6388) This implements a basic structure representing styled text and uses it in issue descriptions. This can be used by the cli and web-based error reporting. Tested with an upcoming Next.js PR --------- Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
This implements a basic structure representing styled text and uses it in issue descriptions. This can be used by the cli and web-based error reporting.
Tested with an upcoming Next.js PR