Skip to content

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

Merged
merged 10 commits into from
Oct 21, 2020
Merged

break: remove old-compiler interop #142

merged 10 commits into from
Oct 21, 2020

Conversation

lukeed
Copy link
Member

@lukeed lukeed commented Oct 20, 2020

Removed roughly ~100 lines of code 🙌

  • removes all non-[email protected] code branches~!
  • light rewrites/refactors (eg, uses async/await inside transform hook)

Questions:

  • Drop .html default extension?
    We strongly(?) discourage this now.
  • What's going on with svelte.root stuff?

Holding this in "Draft" state until we decide on these answers.

@Conduitry
Copy link
Member

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.

@lukeed
Copy link
Member Author

lukeed commented Oct 20, 2020

Thanks, means we can dump both of those :D

Also, third question: remove shared option? See no reference to it in here and I believe it's not a compiler option (anymore). I think there's an argument to be made for keeping onwarn though

@Conduitry
Copy link
Member

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.

@lukeed lukeed marked this pull request as ready for review October 20, 2020 15:36
Copy link
Member

@benmccann benmccann left a 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 };
Copy link
Member

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

Copy link
Member Author

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 };

:neckbeard:

Copy link
Member

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' };

Copy link
Member Author

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

Copy link
Member

@Rich-Harris Rich-Harris left a 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)

@lukeed
Copy link
Member Author

lukeed commented Oct 21, 2020

Merging with 2 approvals, ty

@lukeed lukeed merged commit a765821 into master Oct 21, 2020
@lukeed lukeed deleted the break/cruft branch October 21, 2020 19:26
@lukeed lukeed mentioned this pull request Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants