sveltejs / v2.svelte.dev

The Svelte v2 website
https://v2.svelte.dev
MIT License
210 stars 78 forks source link

REPL now defaults to trying to use Svelte v3 #406

Closed Conduitry closed 5 years ago

Conduitry commented 5 years ago

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 commented 5 years ago

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

Conduitry commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

Fixed.