-
-
Notifications
You must be signed in to change notification settings - Fork 115
refactor: caching #1154
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
refactor: caching #1154
Conversation
svelteRequest, | ||
code, | ||
options, | ||
this.getCombinedSourcemap() |
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.
instead of passing in sourcemap from preprocessed that could be outdated because another transform changed the code in between the 2 plugins, use getCombinedSourceMap() this has the added benefit that we don't have to pass preprocessed around in meta
return { | ||
...compileData.compiled.js, | ||
moduleType: 'js', | ||
meta: { | ||
vite: { | ||
lang: compileData.lang | ||
}, | ||
svelte: { | ||
css: compileData.compiled.css |
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.
instead of caching the css in a separate cache structure, attach it to the meta of the js module
} | ||
} | ||
const hasSelfDependency = selfIdx.length > 0; | ||
if (hasSelfDependency) { |
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 was an issue with svelte-preprocess and has been fixed in 2023, we don't need it anymore
}); | ||
} | ||
|
||
if (dependencies.length > 10) { |
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 was an issue when users put tailwind base rules into svelte style blocks, but that is no longer a thing with tailwind@4.
existing projects have seen this warning plenty of times and either dealt with it or accepted the penalty. new projects are unlikely to use tailwind@3 in this fashion.
so we don't need this anymore either
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.
Thank you!
changes: