-
Notifications
You must be signed in to change notification settings - Fork 233
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
feat: complete format support #4818
Conversation
WASM Query Engine file Size
|
✅ WASM query-engine performance won't change substantially (1.005x)Full benchmark report
After changes in be1faff |
@@ -1,6 +1,6 @@ | |||
mod actions; | |||
mod format; | |||
mod lint; | |||
// mod lint; |
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.
Changes to main.rs
are necessary to let prisma-fmt
compile.
I commented out the prisma-fmt lint
command keeping in mind that, with https://github.com/prisma/team-orm/issues/1100, we will soon get rid of prisma-fmt
's binary anyway
impl<'de> Deserialize<'de> for SourceFile { | ||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> | ||
where | ||
D: Deserializer<'de>, | ||
{ | ||
let s: String = serde::de::Deserialize::deserialize(deserializer)?; | ||
Ok(s.into()) | ||
} | ||
} |
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.
This allows deriving Multiple(Vec<(String, SourceFile)>)
from Vec<(String, String)>
within the following:
#[derive(Deserialize, Debug)]
#[serde(untagged)]
pub(crate) enum SchemaFileInput {
Single(String),
Multiple(Vec<(String, SourceFile)>),
}
It also highlights that SourceFile
is created from a String
.
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.
Nice!
Wouldn't putting #[serde(transparent)]
over SourceFile
do the same?
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.
Afaik it wouldn't be the same, as SourceFile
is essentially a newtype over a Contents
field, not a String
field
CodSpeed Performance ReportMerging #4818 will not alter performanceComparing Summary
|
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.
Looks good to me! (after CI goes green)
This PR closes https://github.com/prisma/team-orm/issues/1097. It enables https://github.com/prisma/team-orm/issues/1096.
/integration