Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

[WIP] Support Svelte 3 #538

Merged
merged 38 commits into from Feb 3, 2019
Merged

[WIP] Support Svelte 3 #538

merged 38 commits into from Feb 3, 2019

Conversation

Rich-Harris
Copy link
Member

This doesn't represent much work — basically the minimum required to get an app working. A particular annoyance is that we can no longer check for the existence of Component.preload, because in Svelte 3 things like preload are separate named imports:

import Component, { preload } from './Component.html';

Rollup doesn't like that — it chokes when you try to import a name that the module doesn't export. We have to jump through some unpleasant hoops to get it to work, and even then it gives us a bunch of warnings. The solution, I think, is to precompile page/layout components so that we can see which ones have preload, and add the imports more selectively.

Anyway, I'll release an alpha version so that I can deploy the new (also very WIP) site.

@Rich-Harris
Copy link
Member Author

Bringing this back on track... all tests now passing except the ones relating to Store


if (/preload/.test(source)) {
try {
const { stats } = svelte.compile(source, { generate: false });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use an empty warning handler here to suppress the display of any warnings while we're determining whether there's a preload. They'll be getting displayed during the main compilation anyway.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch — added locally

@Rich-Harris
Copy link
Member Author

There are some failing tests related to rollup/rollup#2677, but I think this is probably good to merge into master — I'm not anticipating a new release before Svelte 3 is ready.

This PR incorporates the ideas in #546, #551, #552 and #554.

@Rich-Harris Rich-Harris merged commit ca034d0 into master Feb 3, 2019
@Rich-Harris Rich-Harris deleted the svelte-3 branch February 3, 2019 19:41
@antonheryanto antonheryanto mentioned this pull request Feb 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants