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): Split docs #8435

Merged
merged 54 commits into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
92830b0
Update links
PuruVJ Feb 16, 2023
67e3f85
Move blog to site/content
PuruVJ Feb 16, 2023
3a7c72a
Update site/content/docs/02-component-format.md
Rich-Harris Feb 20, 2023
f035690
Merge remote-tracking branch 'origin/sites' into feat/update-content
PuruVJ Mar 8, 2023
661a1dd
Fix docs links
PuruVJ Mar 8, 2023
7efb26b
Add global prettierrc
PuruVJ Mar 18, 2023
90539fe
Auto format
PuruVJ Mar 18, 2023
e3873e8
Merge remote-tracking branch 'origin/sites' into feat/update-content
PuruVJ Mar 18, 2023
938c6f9
Fix git merge artifact
PuruVJ Mar 18, 2023
2227f73
Fix errors
PuruVJ Mar 18, 2023
11a0b47
Merge branch 'sites' into feat/update-content
PuruVJ Mar 28, 2023
d7c1a95
Update html to svelte(remaining ones)
PuruVJ Mar 28, 2023
ed377c6
Add 2 blog posts
PuruVJ Mar 28, 2023
a2df8fe
Merge remote-tracking branch 'origin/sites' into feat/update-content
PuruVJ Mar 28, 2023
1a4d484
Merge branch 'sites' into feat/update-content
PuruVJ Mar 28, 2023
19f79c3
Modify prettierrc
PuruVJ Mar 28, 2023
58293a1
Minor design fix
PuruVJ Mar 29, 2023
b8c0722
Switch package lock to spaces, prettier ignore
PuruVJ Mar 29, 2023
2e2bacb
Merge remote-tracking branch 'origin/sites' into feat/update-content
PuruVJ Mar 30, 2023
5da78e3
Regenerate package lock
PuruVJ Mar 30, 2023
47709f0
prettier format
PuruVJ Mar 30, 2023
bde4331
Push
PuruVJ Mar 30, 2023
3a9afad
Remove console.logs
PuruVJ Mar 30, 2023
9ed6d09
Minor fixes
PuruVJ Mar 30, 2023
302bae7
Fix search
PuruVJ Mar 30, 2023
c286bda
Fix heading <code> style
PuruVJ Mar 30, 2023
a2fd898
Fix search some more
PuruVJ Mar 30, 2023
63d3066
Code cleanup
PuruVJ Mar 30, 2023
fef232f
Update deps
PuruVJ Mar 31, 2023
8bc13fb
Merge branch 'feat/update-content' into feat/split-docs
PuruVJ Mar 31, 2023
113b8b8
Move content around
PuruVJ Mar 31, 2023
2f9feb6
Allow drafts
PuruVJ Mar 31, 2023
1f0f6d7
Redirect logic
PuruVJ Mar 31, 2023
2ad6029
Don't render anything on docs if /docs
PuruVJ Mar 31, 2023
629e8b5
Shorten the regex patterns
PuruVJ Mar 31, 2023
4f5abfb
Fix some more
PuruVJ Mar 31, 2023
2bf6449
Hack the build into working
PuruVJ Mar 31, 2023
f490f74
Merge branch 'feat/update-content' into feat/split-docs
PuruVJ Mar 31, 2023
1e5b7f6
Modernize docs links
PuruVJ Mar 31, 2023
7cd7425
Add content to introduction
PuruVJ Apr 1, 2023
ebd9567
Modify the content
PuruVJ Apr 1, 2023
8f7824c
fix content links
PuruVJ Apr 1, 2023
9ad06b6
Reduce duplication in redirect regex
PuruVJ Apr 1, 2023
0cc449b
Differences from Kit page
PuruVJ Apr 1, 2023
4d22c89
Fix link
PuruVJ Apr 1, 2023
9672783
Make OnThisPage visible on all docs
PuruVJ Apr 1, 2023
0ecac6b
Misc changes
PuruVJ Apr 1, 2023
b0538f0
Move differences page to introduction
PuruVJ Apr 2, 2023
79f83db
Merge branch 'sites' into feat/split-docs
PuruVJ Apr 2, 2023
cddd765
Run prettier
PuruVJ Apr 2, 2023
8a885bf
Prerender examples api routes
PuruVJ Apr 3, 2023
910cff9
Modify introdution page
PuruVJ Apr 3, 2023
98f5feb
replace positions of readonly and get
PuruVJ Apr 3, 2023
a9c076b
Minor blog style enhancement
PuruVJ Apr 3, 2023
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
15 changes: 11 additions & 4 deletions site/content/blog/2023-04-01-whats-new-in-svelte-april-2023.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "What's new in Svelte: April 2023"
description: "Loads of new Svelte compiler features, plus Svelte Summit and SvelteHack"
description: 'Loads of new Svelte compiler features, plus Svelte Summit and SvelteHack'
author: Dani Sandoval
authorURL: https://dreamindani.com
---
Expand All @@ -14,6 +14,7 @@ Don't forget! Svelte Summit Spring, Svelte's 6th virtual conference, will be hap
Now let's jump into this month's changes...

## What's new in Svelte

- A bunch of new features are now available as of **3.56.0**!
- Add `|stopImmediatePropagation` event modifier for `on:eventname` ([#5085](https://github.com/sveltejs/svelte/issues/5085), [Docs](https://svelte.dev/docs#template-syntax-element-directives-on-eventname))
- Add `axis` parameter to `slide` transition ([#6182](https://github.com/sveltejs/svelte/issues/6182), [Docs](https://svelte.dev/docs#run-time-svelte-transition-slide))
Expand All @@ -31,15 +32,18 @@ Now let's jump into this month's changes...
For all the changes to the Svelte compiler, including unreleased changes, check out the [CHANGELOG](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md).

## What's new in SvelteKit

- You can now get all cookies for a request with `cookies.getAll` (**1.10.0**, [#9287](https://github.com/sveltejs/kit/pull/9287), [Docs](https://kit.svelte.dev/docs/types#public-types-cookies))
- Easily manage the submission status of (multiple) forms with the new exposed `submitter` parameter in `use:enhance` (**1.12.0**, [#9425](https://github.com/sveltejs/kit/pull/9425), [Docs](https://kit.svelte.dev/docs/types#public-types-submitfunction))
- The default error page now has dark mode styles (**1.13.0**, [#9460](https://github.com/sveltejs/kit/pull/9460))
- You can now omit types on all methods and variables with special meaning to SvelteKit and still benefit from full type safety! Read more about it in the [announcement blog post](https://svelte.dev/blog/zero-config-type-safety)

---

## Community Showcase

**Apps & Sites built with Svelte**

- [Peerbeer](https://peer.beer/) lets you share files peer-to-peer (p2p) without any third parties or data limits
- [unplaneted](https://unplaneted.com/) is an interface for exploring very large space images
- [PokeBook](https://github.com/pokegh0st/pokebook) is a digital notebook for writing poetry that provides a beautiful distraction-free environment and autosave
Expand All @@ -55,6 +59,7 @@ For all the changes to the Svelte compiler, including unreleased changes, check
**Learning Resources**

_Featuring Svelte Contributors and Ambassadors_

- [Streaming, snapshots, and other new features since SvelteKit 1.0](https://svelte.dev/blog/streaming-snapshots-sveltekit) by Geoff Rich on the svelte.dev Blog
- [Dev Vlog: Rich Harris shows us what's new in Svelte and Kit, March 2023](https://www.youtube.com/watch?v=vgXgex5E-8g) from Svelte Society
- If you missed this one live, check out [the next one](https://www.youtube.com/watch?v=MJHO6FSioPI) - scheduled for April 5th
Expand All @@ -71,13 +76,14 @@ _Featuring Svelte Contributors and Ambassadors_
- [2023 March 23 - SvelteKit 1.13.0, Vitest and Playwright overview](https://www.youtube.com/watch?v=vpbhsbg2otg)

_To Watch or Hear_

- [Full Stack SvelteKit App Deployment Using Vercel And Supabase For $0](https://www.youtube.com/watch?v=uAF4Yd-gddo) by Joy of Code
- [Why Is Svelte.js so Popular?](https://www.youtube.com/watch?v=73Y8Yyg54zc) by Prismic
- [Interactive Tables in SvelteKit with TanStack Table](https://www.youtube.com/watch?v=-Zuo3UWjjI8) by hartenfellerdev
- [SvelteKit + GraphQL with Houdini](https://www.youtube.com/watch?v=ADnaRwQZfqw&list=PLm0ILX0LGQk_220vvpsbyXH2VesRlCm-E) by Aftab Alam


_To Read_

- [Thoughts on Svelte](https://tyhopp.com/notes/thoughts-on-svelte) by Ty Hopp
- [Storybook](https://storybook.js.org/blog/storybook-for-sveltekit/) on why (and how) it supports SvelteKit
- [Svelte Authentication Tutorial with Authorizer](https://thethinks.vercel.app/blog/svelte-authorizer) by The Thinks
Expand All @@ -89,18 +95,19 @@ _To Read_
- [Secure Authentication in Svelte using Hooks](https://dev.to/brewhousedigital/secure-authentication-in-svelte-using-hooks-k5j) by Brewhouse Digital

**Libraries, Tools & Components**

- [@vavite/node-loader](https://github.com/cyco130/vavite/tree/main/packages/node-loader) is a Node ESM loader that uses Vite to transpile modules to enable sourcemap and breakpoints support in SvelteKit (or any Vite) project
- [Inlang](https://github.com/inlang/inlang) is building i18n for SvelteKit and is [looking for feedback](https://www.reddit.com/r/sveltejs/comments/11ydtui/sveltekit_and_i18n_lets_finally_solve_this_never/)
- [Skeleton](https://www.skeleton.dev/) - the UI toolkit for Svelte and Tailwind - is now 1.0 🎉
- [SvelteKit-integrated-WebSocket](https://github.com/suhaildawood/SvelteKit-integrated-WebSocket) provides first-class support for WebSockets within SvelteKit by attaching a WebSocket server to the global state
- [Svelte Legos](https://github.com/ankurrsinghal/svelte-legos) is a collection of essential Svelte Composition Utilities
- [Svelte Legos](https://github.com/ankurrsinghal/svelte-legos) is a collection of essential Svelte Composition Utilities
- [svelte-stored-writable](https://github.com/efstajas/svelte-stored-writable) is a drop-in extension of Svelte's writable that additionally stores and restores its contents using localStorage.
- [svelte-virtual](https://github.com/ghostebony/svelte-virtual) provides Svelte components for efficiently rendering large lists.
- ChatGPT Clones and Starters
- [chatwithme.chat](https://github.com/kierangilliam/chatwithme.chat) is an open source ChatGPT UI
- [SlickGPT](https://github.com/ShipBit/slickgpt) is a light-weight "use-your-own-API-key" web client for the OpenAI API written in Svelte
- [AI Chat Bestie](https://github.com/KTruong008/aichatbestie) is an unofficial ChatGPT app
- [chatgpt-svelte](https://github.com/ichbtrv/chatgpt-svelte) is a simple UI for the ChatGPT Open AI API
- [chatgpt-svelte](https://github.com/ichbtrv/chatgpt-svelte) is a simple UI for the ChatGPT Open AI API

Thanks for reading! And don't forget to try your hand at the [Svelte Hackathon](https://hack.sveltesociety.dev/) 🧑‍💻

Expand Down
11 changes: 0 additions & 11 deletions site/content/docs/00-introduction.md

This file was deleted.

24 changes: 0 additions & 24 deletions site/content/docs/01-getting-started.md

This file was deleted.

49 changes: 49 additions & 0 deletions site/content/docs/01-getting-started/01-introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: Introduction
---

Welcome to Svelte docs. These are for folks who are already familiar with Svelte and want to learn more about the details of how it works.

If that's not you (yet), you may prefer to visit the [interactive tutorial](/tutorial) or the [examples](/examples) before consulting this reference.

Don't be shy about asking for help in the [Discord chatroom](https://svelte.dev/chat).

Using an older version of Svelte? Have a look at the [v2 docs](https://v2.svelte.dev).

## Start a new project

To try Svelte in an interactive online environment you can try [the REPL](https://svelte.dev/repl) or [StackBlitz](https://node.new/svelte).

To create a project locally we recommend using [SvelteKit](https://kit.svelte.dev/), the official application framework from the Svelte team:

```
npm create svelte@latest myapp
cd myapp
npm install
npm run dev
```

SvelteKit will handle calling [the Svelte compiler](https://www.npmjs.com/package/svelte) to convert your `.svelte` files into `.js` files that create the DOM and `.css` files that style it. It also provides all the other pieces you need to build a web application such as a development server, routing, and deployment. [SvelteKit](https://kit.svelte.dev/) utilizes [Vite](https://vitejs.dev/) to build your code and handle server-side rendering (SSR). There are [plugins for all the major web bundlers](https://sveltesociety.dev/tools#bundling) to handle Svelte compilation, which will output `.js` and `.css` that you can insert into your HTML, but most others won't handle SSR.

### Alternatives to SvelteKit

If you don't need a full-fledged app framework and instead want to build a simple frontend-only site/app, you can also use Svelte (without Kit) with Vite by running `npm init vite` and selecting the `svelte` option. With this, `npm run build` will generate HTML, JS and CSS files inside the `dist` directory.

Notable Mentions:

- [Routify](https://www.routify.dev/)
- [Elder.js](https://elderjs.com/)

## Differences from SvelteKit

Svelte renders UI components. You can compose these components and render an entire page with just Svelte, but you need more than just Svelte to write an entire app.

SvelteKit provides basic functionality like a [router](https://kit.svelte.dev/glossary#routing) — which updates the UI when a link is clicked — and [server-side rendering (SSR)](https://kit.svelte.dev/glossary#ssr). But beyond that, building an app with all the modern best practices is fiendishly complicated. Those practices include [build optimizations](https://vitejs.dev/guide/features.html#build-optimizations), so that you load only the minimal required code; [offline support](https://kit.svelte.devservice-workers); [preloading](https://kit.svelte.dev/link-options#data-sveltekit-preload-data) pages before the user initiates navigation; [configurable rendering](https://kit.svelte.dev/page-options) that allows you to render different parts of your app on the server with [SSR](https://kit.svelte.dev/glossary#ssr), in the browser [client-side rendering](https://kit.svelte.dev/glossary#csr), or at build-time with [prerendering](https://kit.svelte.dev/glossary#prerendering); and many other things. SvelteKit does all the boring stuff for you so that you can get on with the creative part.

It reflects changes to your code in the browser instantly to provide a lightning-fast and feature-rich development experience by leveraging [Vite](https://vitejs.dev/) with a [Svelte plugin](https://github.com/sveltejs/vite-plugin-svelte) to do [Hot Module Replacement (HMR)](https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/config.md#hot).

## Editor tooling

The Svelte team maintains a [VS Code extension](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) and there are integrations with various other [editors](https://sveltesociety.dev/tools#editor-support) and tools as well.

If you're having trouble, get help on [Discord](https://svelte.dev/chat) or [StackOverflow](https://stackoverflow.com/questions/tagged/svelte).
3 changes: 3 additions & 0 deletions site/content/docs/01-getting-started/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"title": "Getting Started"
}
Loading