Skip to content
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

feat(site-2): Fully remove api.svelte.dev #8432

Merged
merged 25 commits into from
Apr 2, 2023
Merged

feat(site-2): Fully remove api.svelte.dev #8432

merged 25 commits into from
Apr 2, 2023

Conversation

PuruVJ
Copy link
Collaborator

@PuruVJ PuruVJ commented Mar 29, 2023

This makes FAQ and REPLWidget independent of api.svelte.dev. No more external API requests

@vercel
Copy link

vercel bot commented Mar 29, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
svelte-dev-2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 2, 2023 2:34pm

});
}
const components = process_example(
getContext('repl_widget_examples').find(({ id }) => id === example).files
Copy link
Member

Choose a reason for hiding this comment

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

getContext could be called outside of component initialization here, I suggest to move the context retrieval part out to the top level.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done!

@nazarepiedady
Copy link

I hope this pull request is applied or better saying merged because,
the current architecture is too complex for me who is working on the
localisation of the entire content to Portuguese.

To have to set up the backend and frontend to serve the official content
seems too much for me considering the fact that backend instructions
for individuals to serve themselves are not so clear.

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.

this is going to make life so much easier! left some comments inline

sites/svelte.dev/src/lib/components/ReplWidget.svelte Outdated Show resolved Hide resolved
sites/svelte.dev/src/lib/components/ReplWidget.svelte Outdated Show resolved Hide resolved
sites/svelte.dev/src/routes/+page.server.js Outdated Show resolved Hide resolved
sites/svelte.dev/src/routes/+page.svelte Outdated Show resolved Hide resolved
Comment on lines 18 to 32
/** @returns {('*' | `/${string}`)[]} */
function replJsonEntries() {
// @ts-ignore
return get_examples_list(
get_examples_data(new URL('../../site/content/examples', import.meta.url).pathname)
).flatMap(({ examples }) => examples.map(({ slug }) => `/repl/${slug}.json`));
}

/** @returns {('*' | `/${string}`)[]} */
function tutorialEntries() {
// @ts-ignore
return get_tutorial_list(
get_tutorial_data(new URL('../../site/content/tutorial', import.meta.url).pathname)
).flatMap(({ tutorials }) => tutorials.map(({ slug }) => `/tutorial/${slug}`));
}
Copy link
Member

Choose a reason for hiding this comment

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

note that elliott is working on a more idiomatic approach to this which we'll be able to use soon instead of this sveltejs/kit#9571

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That would make things so much easier 🤩! The second that feature is released I'll move the code to that

Choose a reason for hiding this comment

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

@Rich-Harris you're right, the approach used in sveltejs/kit#9571 is much easier to understand.

Co-authored-by: Rich Harris <richard.a.harris@gmail.com>
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.

4 participants