-
-
Notifications
You must be signed in to change notification settings - Fork 81
break: remove old-compiler interop #142
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
Conversation
I vote yes on removing .html from the default extensions. svelte.root was part of an old feature to export multiple components from one package. This was later discouraged in favor of just having pkg.svelte point at a .js file that reexports multiple components. |
Thanks, means we can dump both of those :D Also, third question: remove |
shared should also be removed, yeah, as that was a Svelte 1+2 thing, and Svelte only returns things that use the shared helpers and that need to be run through a bundler. There needs to remain some mechanism for handling and displaying compiler warnings, as the compiler just returns them in an array in v3 and doesn't print them. |
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.
great to get rid of so much code!
fixed_options.shared = require.resolve(options.shared || 'svelte/shared.js'); | ||
} | ||
/** @type {import('svelte/types/compiler/interfaces').ModuleFormat} */ | ||
const format = 'esm', config = { format }; |
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 wonder if eslint would allow this. We should probably set that up at some point too
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 already have ESLint running. It's fine with it. TBH I only did this because this irks me:
/** @type {import('svelte/types/compiler/interfaces').ModuleFormat} */
const format = 'esm';
const config = { format };
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.
Why isn’t this just
const config = { format: 'esm' };
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.
Because intellisense complains about it at the compiler(code, { ...config, })
spot, saying that format: string
does not align with format: ModuleFormat
type.
There's no technical reason or anything – it's just so that there are no red squiggles on the page
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.
my review is marked 'request changes' but it's really more a discussion point than anything, about whether we should align with svelte.config.js. (It would probably make sense if config files were automatically loaded, though that can happen later)
Merging with 2 approvals, ty |
Removed roughly ~100 lines of code 🙌
[email protected]
code branches~!async
/await
inside transform hook)Questions:
.html
default extension?We strongly(?) discourage this now.
svelte.root
stuff?Holding this in "Draft" state until we decide on these answers.