Skip to content

REPL now defaults to trying to use Svelte v3 #406

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

Closed
Conduitry opened this issue Apr 21, 2019 · 5 comments
Closed

REPL now defaults to trying to use Svelte v3 #406

Conduitry opened this issue Apr 21, 2019 · 5 comments
Assignees

Comments

@Conduitry
Copy link
Member

Now that svelte@latest is v3, people visiting the v2 REPL without a version in their URL will get v3, which breaks everything. We should be explicit about fetching version 2 from unpkg.

@Conduitry
Copy link
Member Author

And then while we're at it, we should update the github oauth app to use v2.svelte.dev instead of svelte.technology.

@Conduitry
Copy link
Member Author

I think this takes care of the issue with what version of the compiler the REPL gets from unpkg:

diff --git a/src/routes/repl/index.html b/src/routes/repl/index.html
index 4975e83..de5a0a3 100644
--- a/src/routes/repl/index.html
+++ b/src/routes/repl/index.html
@@ -248,7 +248,7 @@
 			return {
 				examples,
 
-				version: query.version || 'latest',
+				version: query.version || '2',
 
 				components: [],
 				data: {},
@@ -277,7 +277,7 @@
 
 			url: ({ version, gist, query, demo }) => {
 				const params = [];
-				if (version !== 'latest') params.push(`version=${version}`);
+				if (version !== '2') params.push(`version=${version}`);
 				if (gist) params.push(`gist=${gist.id}`);
 				else if (demo) params.push(`demo=${demo}`);
 				else if (query.gist) params.push(`gist=${query.gist}`);

@Conduitry
Copy link
Member Author

Eesh we're also going to have to do something about the template that's used in the REPL for downloaded zips. Right now, update_template.sh is going to get the latest v3 template.

@Conduitry
Copy link
Member Author

It might actually be best to just check an old v2 version of the template into this repo, because that's not really going to be getting updated any more.

@Conduitry Conduitry self-assigned this Apr 22, 2019
Rich-Harris added a commit that referenced this issue Apr 22, 2019
@Conduitry
Copy link
Member Author

Fixed.

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

No branches or pull requests

1 participant