Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/svelte.dev/src/routes/(authed)/apps/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<ul class:selecting>
{#each data.gists as gist}
<li class:selected={selected.includes(gist.id)}>
<a href={selecting ? undefined : `/repl/${gist.id}`}>
<a href={selecting ? undefined : `/playground/${gist.id}`}>
<h2>{gist.name}</h2>
<span>updated {format(gist.updated_at || gist.created_at)}</span>
</a>
Expand Down Expand Up @@ -130,7 +130,7 @@
{/if}
</div>
{:else}
<p>No apps here. <a href="/repl">Go make one!</a></p>
<p>No apps here. <a href="/playground">Go make one!</a></p>
{/if}
{:else}
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export function load({ url }) {
const q = new URLSearchParams();
if (version) q.set('version', version);
if (vim) q.set('vim', vim);
redirect(301, `/repl/${id}?${q}`);
redirect(301, `/playground/${id}?${q}`);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { error } from '@sveltejs/kit';

export async function load({ fetch, params, url }) {
const res = await fetch(`/repl/api/${params.id}.json`);
const res = await fetch(`/playground/api/${params.id}.json`);

if (!res.ok) {
error(/** @type {import('@sveltejs/kit').NumericRange<400, 599>} */ (res.status));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
}

const url =
params.length > 0 ? `/repl/${data.gist.id}?${params.join('&')}` : `/repl/${data.gist.id}`;
params.length > 0
? `/playground/${data.gist.id}?${params.join('&')}`
: `/playground/${data.gist.id}`;

history.replaceState({}, 'x', url);
});
Expand All @@ -47,7 +49,7 @@

function handle_fork(event: CustomEvent) {
console.log('> handle_fork', event);
goto(`/repl/${event.detail.gist.id}?version=${version}`);
goto(`/playground/${event.detail.gist.id}?version=${version}`);
}

function handle_change(event: CustomEvent) {
Expand All @@ -56,17 +58,17 @@

const svelteUrl = $derived(
browser && version === 'local'
? `${location.origin}/repl/local`
? `${location.origin}/playground/local`
: `https://unpkg.com/svelte@${version}`
);

const relaxed = $derived(data.gist.relaxed || (data.user && data.user.id === data.gist.owner));
</script>

<svelte:head>
<title>{name} • REPL • Svelte</title>
<title>{name} • Playground • Svelte</title>

<meta name="twitter:title" content="{data.gist.name} • REPL • Svelte" />
<meta name="twitter:title" content="{data.gist.name} • Playground • Svelte" />
<meta name="twitter:description" content="Web development, but fun" />
<meta name="Description" content="Interactive Svelte playground" />
</svelte:head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
const { files } = repl.toJSON() as { files: File[] };

try {
const r = await fetch(`/repl/create.json`, {
const r = await fetch(`/playground/create.json`, {
method: 'POST',
credentials: 'include',
headers: {
Expand Down Expand Up @@ -121,7 +121,7 @@
// ~> Any missing files are considered deleted!
const { files } = repl.toJSON() as { files: File[] };

const r = await fetch(`/repl/save/${gist.id}.json`, {
const r = await fetch(`/playground/save/${gist.id}.json`, {
method: 'PUT',
credentials: 'include',
headers: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { error } from '@sveltejs/kit';

export async function load({ fetch, params, url }) {
const res = await fetch(`/repl/api/${params.id}.json`);
const res = await fetch(`/playground/api/${params.id}.json`);

if (!res.ok) {
throw error(res.status);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

const url =
params.length > 0
? `/repl/${data.gist.id}/embed?${params.join('&')}`
: `/repl/${data.gist.id}/embed`;
? `/playground/${data.gist.id}/embed?${params.join('&')}`
: `/playground/${data.gist.id}/embed`;

history.replaceState({}, 'x', url);
}
Expand All @@ -46,17 +46,17 @@

const svelteUrl = $derived(
browser && version === 'local'
? `${location.origin}/repl/local`
? `${location.origin}/playground/local`
: `https://unpkg.com/svelte@${version}`
);

const relaxed = $derived(data.gist.relaxed || (data.user && data.user.id === data.gist.owner));
</script>

<svelte:head>
<title>{data.gist.name} • REPL • Svelte</title>
<title>{data.gist.name} • Playground • Svelte</title>

<meta name="twitter:title" content="{data.gist.name} • REPL • Svelte" />
<meta name="twitter:title" content="{data.gist.name} • Playground • Svelte" />
<meta name="twitter:description" content="Web development, but fun" />
<meta name="Description" content="Interactive Svelte playground" />
</svelte:head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function munge(files) {

export async function GET({ params }) {
// Currently, these pages(that are in examples/) are prerendered. To avoid making any FS requests,
// We prerender examples pages during build time. That means, when something like `/repl/hello-world.json`
// We prerender examples pages during build time. That means, when something like `/playground/hello-world.json`
// is accessed, this function won't be run at all, as it will be served from the filesystem

const example = get_example(examples_data, params.id);
Expand All @@ -50,7 +50,7 @@ export async function GET({ params }) {
if (dev && !client) {
// in dev with no local Supabase configured, proxy to production
// this lets us at least load saved REPLs
const res = await fetch(`https://svelte.dev/repl/api/${params.id}.json`);
const res = await fetch(`https://svelte.dev/playground/api/${params.id}.json`);

// returning the response directly results in a bizarre
// content encoding error, so we create a new one
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { redirect } from '@sveltejs/kit';

export function load({ url }) {
if (!url.searchParams.has('gist')) {
throw redirect(301, '/repl/hello-world/embed');
throw redirect(301, '/playground/hello-world/embed');
} else {
const searchParamsWithoutGist = new URLSearchParams(url.searchParams);
searchParamsWithoutGist.delete('gist');
throw redirect(
301,
`/repl/${url.searchParams.get('gist')}/embed?${searchParamsWithoutGist.toString()}`
`/playground/${url.searchParams.get('gist')}/embed?${searchParamsWithoutGist.toString()}`
);
}
}
2 changes: 1 addition & 1 deletion apps/svelte.dev/src/routes/+layout.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const load = async ({ url, fetch }) => {
function get_nav_title(url) {
const list = new Map([
[/^docs/, 'Docs'],
[/^repl/, 'REPL'],
[/^playground/, 'Playground'],
[/^blog/, 'Blog'],
[/^faq/, 'FAQ'],
[/^tutorial/, 'Tutorial'],
Expand Down
2 changes: 1 addition & 1 deletion apps/svelte.dev/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{/if}
</svelte:head>

<Shell nav_visible={$page.route.id !== '/(authed)/repl/[id]/embed'}>
<Shell nav_visible={$page.route.id !== '/(authed)/playground/[id]/embed'}>
{#snippet top_nav()}
<Nav title={data.nav_title} links={data.nav_links}>
{#snippet search()}
Expand Down
4 changes: 2 additions & 2 deletions apps/svelte.dev/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
href: '/tutorial'
},
{
title: 'repl',
href: '/repl'
title: 'playground',
href: '/playground'
},
{
title: 'blog',
Expand Down
6 changes: 3 additions & 3 deletions apps/svelte.dev/src/routes/nav.json/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ async function get_nav_list(): Promise<NavigationLink[]> {
sections: tutorial
},
{
title: 'REPL',
prefix: 'repl',
pathname: '/repl'
title: 'Playground',
prefix: 'playground',
pathname: '/playground'
},
{
title: 'Blog',
Expand Down
5 changes: 5 additions & 0 deletions apps/svelte.dev/src/routes/repl/[...path]/+page.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { redirect } from '@sveltejs/kit';

export function load({ url }) {
throw redirect(308, url.href.replace('/repl', '/playground'));
}
Loading