Skip to content

Commit 2466996

Browse files
committed
merge main
2 parents a5bce2b + 5dbae29 commit 2466996

File tree

490 files changed

+11082
-5040
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

490 files changed

+11082
-5040
lines changed
Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,40 @@
11
name: Docs preview create
22

33
on:
4-
repository_dispatch:
5-
types: [docs-preview-create]
4+
workflow_dispatch:
5+
inputs:
6+
repo:
7+
description: 'Repository name (not fully-qualified, eg. `svelte` or `kit`)'
8+
required: true
9+
type: string
10+
pr:
11+
description: 'PR number'
12+
required: true
13+
type: string
14+
owner:
15+
description: 'Owner (eg. sveltejs)'
16+
required: true
17+
type: string
18+
branch:
19+
description: 'Branch (eg. my-feature-branch)'
20+
required: true
21+
type: string
22+
23+
permissions:
24+
contents: write
625

726
env:
8-
BRANCH: preview-${{ github.event.client_payload.package }}-${{ github.event.client_payload.pr }}
27+
BRANCH: preview-${{ inputs.repo }}-${{ inputs.pr }}
928

1029
jobs:
1130
Sync:
31+
name: Sync
1232
runs-on: ubuntu-latest
33+
34+
concurrency:
35+
group: preview-${{ inputs.repo }}-${{ inputs.pr }} # can't reference env here
36+
cancel-in-progress: true
37+
1338
steps:
1439
- uses: actions/checkout@v4
1540
with:
@@ -25,7 +50,7 @@ jobs:
2550
run: git fetch origin ${{ env.BRANCH }} && git checkout ${{ env.BRANCH }} || git checkout -b ${{ env.BRANCH }}
2651

2752
- name: Sync
28-
run: cd apps/svelte.dev && pnpm sync-docs --owner="${{ github.event.client_payload.owner }}" -p "${{ github.event.client_payload.package }}#${{ github.event.client_payload.branch }}"
53+
run: cd apps/svelte.dev && pnpm sync-docs --owner="${{ inputs.owner }}" -p "${{ inputs.repo }}#${{ inputs.branch }}"
2954

3055
- name: Configure Git
3156
run: |
@@ -36,25 +61,12 @@ jobs:
3661
id: push
3762
run: git add -A && git commit -m "sync docs" && git push -u origin ${{ env.BRANCH }}
3863

39-
- name: Find comment
40-
id: fc
41-
uses: peter-evans/find-comment@v3
42-
with:
43-
token: ${{ secrets.COMMENTER_TOKEN }}
44-
repository: ${{ github.event.client_payload.repo }}
45-
issue-number: ${{ github.event.client_payload.pr }}
46-
comment-author: 'Rich-Harris' # it's using my personal access token, not sure if there's a way to comment as a bot instead
47-
body-includes: _this is an automated message_
48-
49-
- name: Create comment
50-
if: steps.fc.outputs.comment-id == ''
51-
uses: peter-evans/create-or-update-comment@v4
64+
- name: Request preview comment
65+
uses: peter-evans/repository-dispatch@v3
5266
with:
53-
token: ${{ secrets.COMMENTER_TOKEN }}
54-
repository: ${{ github.event.client_payload.repo }}
55-
issue-number: ${{ github.event.client_payload.pr }}
56-
body: |
57-
preview: https://svelte-dev-git-${{ env.BRANCH }}-svelte.vercel.app/
58-
59-
_this is an automated message_
60-
edit-mode: replace
67+
event-type: 'request-preview-comment'
68+
client-payload: |-
69+
{
70+
"repo": "${{ inputs.repo }}",
71+
"pr": "${{ inputs.pr }}"
72+
}

.github/workflows/docs-preview-delete.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
name: Docs preview delete
22

33
on:
4-
repository_dispatch:
5-
types: [docs-preview-delete]
4+
workflow_dispatch:
5+
inputs:
6+
repo:
7+
description: 'Repository name (not fully-qualified, eg. `svelte` or `kit`)'
8+
required: true
9+
type: string
10+
pr:
11+
description: 'PR number'
12+
required: true
13+
type: string
614

715
env:
8-
BRANCH: preview-${{ github.event.client_payload.package }}-${{ github.event.client_payload.pr }}
16+
BRANCH: preview-${{ inputs.repo }}-${{ inputs.pr }}
917

1018
jobs:
1119
Sync:

.github/workflows/sync-docs.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
name: Sync docs
22

33
on:
4-
repository_dispatch:
5-
types: [sync-request]
4+
workflow_dispatch:
5+
inputs:
6+
repo:
7+
description: 'Repository name (not fully-qualified, eg. `svelte` or `kit`)'
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: write
13+
pull-requests: write
614

715
jobs:
816
Sync:
@@ -17,13 +25,13 @@ jobs:
1725
- run: pnpm install --frozen-lockfile
1826

1927
- name: Sync
20-
run: cd apps/svelte.dev && pnpm sync-docs -p ${{ github.event.client_payload.package }}
28+
run: cd apps/svelte.dev && pnpm sync-docs -p ${{ inputs.repo }}
2129

2230
- name: Create or update pull request
2331
uses: peter-evans/create-pull-request@v7
2432
with:
25-
commit-message: sync ${{ github.event.client_payload.package }} docs
26-
title: Sync `${{ github.event.client_payload.package }}` docs
33+
commit-message: sync ${{ inputs.repo }} docs
34+
title: Sync `${{ inputs.repo }}` docs
2735
body: This is an automated pull request. See the [README](../tree/main/apps/svelte.dev/scripts/sync-docs/README.md) for more information
28-
branch: sync-${{ github.event.client_payload.package }}
36+
branch: sync-${{ inputs.repo }}
2937
base: main

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,11 @@ When writing content for the tutorial, you need to be aware of the differences o
3939
## Dependencies
4040

4141
If you look in the site's package.json you'll notice several dependencies that don't appear to be used, such as `@testing-library/svelte`. These are present because they're referenced in the docs, and Twoslash needs to be able to find type definitions in order to typecheck snippets. Installing the dependencies was deemed preferable to faking it with `declare module`, since we're liable to end up with fictional types that way.
42+
43+
## Prerendering
44+
45+
Most of the site is prerendered. Since that involves some fairly expensive work, it can take a while. To build the site _without_ prerendering — for example, because you need to debug an issue that's affecting production builds — set the `PRERENDER` environment variable to `false`:
46+
47+
```bash
48+
PRERENDER=false pnpm build
49+
```

apps/svelte.dev/.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ SUPABASE_KEY=
33

44
GITHUB_CLIENT_ID=
55
GITHUB_CLIENT_SECRET=
6+
7+
# disable prerendering with `PRERENDER=false pnpm build` — this is useful for speeding up builds when previewing locally
8+
PRERENDER=true

apps/svelte.dev/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
/src/routes/_home/Supporters/contributors.js
77
/src/routes/_home/Supporters/donors.jpg
88
/src/routes/_home/Supporters/donors.js
9+
/scripts/svelte-template
10+
/static/svelte-template.json
911

1012
# git-repositories of synced docs go here
1113
/repos/

apps/svelte.dev/content/blog/2016-11-26-frameworks-without-the-framework.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Frameworks without the framework: why didn't we think of this sooner?"
33
description: You can't write serious applications in vanilla JavaScript without hitting a complexity wall. But a compiler can do it for you.
44
author: Rich Harris
5-
authorURL: https://twitter.com/Rich_Harris
5+
authorURL: https://bsky.app/profile/rich-harris.dev
66
---
77

88
> Wait, this new framework has a _runtime_? Ugh. Thanks, I'll pass.
@@ -12,7 +12,7 @@ We're shipping too much code to our users. Like a lot of front end developers, I
1212

1313
But I was wrong. 100kb of .js isn't equivalent to 100kb of .jpg. It's not just the network time that'll kill your app's startup performance, but the time spent parsing and evaluating your script, during which time the browser becomes completely unresponsive. On mobile, those milliseconds rack up very quickly.
1414

15-
If you're not convinced that this is a problem, follow [Alex Russell](https://twitter.com/slightlylate) on Twitter. Alex [hasn't been making many friends in the framework community lately](https://twitter.com/slightlylate/status/728355959022587905), but he's not wrong. But the proposed alternative to using frameworks like Angular, React and Ember – [Polymer](https://www.polymer-project.org/1.0/) – hasn't yet gained traction in the front end world, and it's certainly not for a lack of marketing.
15+
If you're not convinced that this is a problem, follow [Alex Russell](https://bsky.app/profile/infrequently.org) on BlueSky. Alex [hasn't been making many friends in the framework community lately](https://twitter.com/slightlylate/status/728355959022587905), but he's not wrong. But the proposed alternative to using frameworks like Angular, React and Ember – [Polymer](https://www.polymer-project.org/1.0/) – hasn't yet gained traction in the front end world, and it's certainly not for a lack of marketing.
1616

1717
Perhaps we need to rethink the whole thing.
1818

@@ -30,7 +30,7 @@ Svelte is a new framework that does exactly that. You write your components usin
3030

3131
The [Svelte implementation of TodoMVC](https://svelte-todomvc.surge.sh/) weighs 3.6kb zipped. For comparison, React plus ReactDOM _without any app code_ weighs about 45kb zipped. It takes about 10x as long for the browser just to evaluate React as it does for Svelte to be up and running with an interactive TodoMVC.
3232

33-
And once your app _is_ up and running, according to [js-framework-benchmark](https://github.com/krausest/js-framework-benchmark) **Svelte is fast as heck**. It's faster than React. It's faster than Vue. It's faster than Angular, or Ember, or Ractive, or Preact, or Riot, or Mithril. It's competitive with Inferno, which is probably the fastest UI framework in the world, for now, because [Dominic Gannaway](https://twitter.com/trueadm) is a wizard. (Svelte is slower at removing elements. We're [working on it](https://github.com/sveltejs/svelte/issues/26).)
33+
And once your app _is_ up and running, according to [js-framework-benchmark](https://github.com/krausest/js-framework-benchmark) **Svelte is fast as heck**. It's faster than React. It's faster than Vue. It's faster than Angular, or Ember, or Ractive, or Preact, or Riot, or Mithril. It's competitive with Inferno, which is probably the fastest UI framework in the world, for now, because [Dominic Gannaway](https://bsky.app/profile/trueadm.dev) is a wizard. (Svelte is slower at removing elements. We're [working on it](https://github.com/sveltejs/svelte/issues/26).)
3434

3535
It's basically as fast as vanilla JS, which makes sense because it _is_ vanilla JS – just vanilla JS that you didn't have to write.
3636

apps/svelte.dev/content/blog/2017-09-06-the-zen-of-just-writing-css.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: The zen of Just Writing CSS
33
description: I would say this is the future, but we're already doing it.
44
author: Rich Harris
5-
authorURL: https://twitter.com/Rich_Harris
5+
authorURL: https://bsky.app/profile/rich-harris.dev
66
---
77

88
It's fashionable to dislike CSS. There are lots of reasons why that's the case, but it boils down to this: CSS is _unpredictable_. If you've never had the experience of tweaking a style rule and accidentally breaking some layout that you thought was completely unrelated — usually when you're trying to ship — then you're either new at this or you're a much better programmer than the rest of us.

apps/svelte.dev/content/blog/2017-12-31-sapper-towards-the-ideal-web-app-framework.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: 'Sapper: Towards the ideal web app framework'
33
description: Taking the next-plus-one step
44
author: Rich Harris
5-
authorURL: https://twitter.com/Rich_Harris
5+
authorURL: https://bsky.app/profile/rich-harris.dev
66
---
77

88
> Quickstart for the impatient: [the Sapper docs](https://sapper.svelte.dev), and the [starter template](https://github.com/sveltejs/sapper-template)

apps/svelte.dev/content/blog/2018-04-18-version-2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Svelte v2 is out!
33
description: Here's what you need to know
44
author: Rich Harris
5-
authorURL: https://twitter.com/Rich_Harris
5+
authorURL: https://bsky.app/profile/rich-harris.dev
66
---
77

88
<aside>Our motto is 'move slowly and break things'. No, wait, that came out wrong...</aside>

0 commit comments

Comments
 (0)