0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-28 16:12:17 +01:00
Commit Graph

32 Commits

Author SHA1 Message Date
Ben McCann
15246dc612
chore: slim down devDependencies (#12155) 2024-06-23 17:02:43 -04:00
Rich Harris
3da2646b10
feat: more accurate render/mount/hydrate options (#12111)
make the props parameter optional only when there are no or only optional props

---------

Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
2024-06-21 16:57:10 +02:00
Dominic Gannaway
7272b650d6
chore: remoev setTimeout (#12009) 2024-06-12 11:27:24 +01:00
Dominic Gannaway
0d51dbae32
fix: ensure bound input content is resumed on hydration (#11986)
* fix: ensure bound input content is resumed on hydration

* fix: ensure bound input content is resumed on hydration

* Update packages/svelte/src/internal/client/dom/elements/bindings/input.js

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>

* fix: ensure bound input content is resumed on hydration

* fix: ensure bound input content is resumed on hydration

* Update packages/svelte/src/internal/client/dom/elements/bindings/input.js

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>

* add test

* add test

* add test

* add test

* Update packages/svelte/src/internal/client/dom/elements/bindings/input.js

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>

* add test

* add test

* newlines between multi-line blocks, let the code breathe

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2024-06-11 09:19:22 -04:00
Rich Harris
69d2480f4d fix playground prod script 2024-06-07 10:22:41 -04:00
Dominic Gannaway
7714c934fe
chore: deprecate html in favour of body for render() (#11927)
Closes #11281
2024-06-06 12:28:40 +02:00
Ben McCann
ca6e9b5745
chore: validate promise handling (#11842)
* chore: don't swallow rejected promise errors

* ignore rules rather than adding catch blocks. add async to functions returning promises

* remove redundant asyncs

* remove extremely pointless rule

* remove another daft rule

* this is what typescript is for

* again, typescript already has this covered, we don't need it

* simplify

* this rule is harmless

---------

Co-authored-by: Rich Harris <rich.harris@vercel.com>
2024-06-04 15:26:59 -04:00
Ben McCann
9a86e3b5e6
chore: linting and formatting on a per-package basis (#11834) 2024-05-30 14:37:17 +01:00
Rich Harris
506f9d2892
add pnpm prod command to playground (#11697) 2024-05-20 22:14:48 +01:00
Dominic Gannaway
f6b800414d
chore: update run.js to include dev mode on compileModule (#11601) 2024-05-14 01:30:50 +01:00
Rich Harris
61bf97210b
chore: improve local playground (#11575) 2024-05-13 11:36:17 +02:00
Dominic Gannaway
b4968584df
fix: improve html escaping of element attributes (#11411)
escape `<` because there's an edge case scenario where a script inside an attribute of a noscript is parsed differently
2024-05-02 17:40:22 +02:00
Simon H
cd798077b4
feat: provide migration function (#11334)
Provides a migration function, exported as `migrate` from `svelte/compiler`, which tries its best to automatically migrate towards runes, render tags (instead of slots) and event attributes (instead of event handlers)

The preview REPL was updated with a migrate button so people can try it out in the playground.

closes #9239
2024-04-26 20:56:40 +02:00
Rich Harris
2cefd785a4
fix: make ownership validation work with HMR (#11171)
* fix: make ownership validation work with HMR

* bump vite-plugin-svelte in playground

* missed a spot
2024-04-14 15:14:46 -04:00
Jeremiasz Major
0cf2e98322
chore: upgrade eslint to v9 (#11108) 2024-04-10 16:02:03 -07:00
Dominic Gannaway
afe1d11a5b
feat: hot module reloading support for Svelte 5 (#11106)
* feat: hot module reloading support for Svelte 5

* fix lockfile

* tweaks

* types

* lint

* lint

* tweaks

* add hmr flag

* tweak

* tweaks

* move HMR logic into its own module

* simplify

* tidy up types

* fix test

* lint

* need some indirection here or references break

* prevent transitions during HMR update

---------

Co-authored-by: Rich Harris <rich.harris@vercel.com>
2024-04-10 16:00:37 -04:00
dependabot[bot]
b2892b02e1
chore(deps-dev): bump vite from 5.0.12 to 5.0.13 (#11054)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.0.12 to 5.0.13.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.0.13/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.0.13/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 14:07:26 -04:00
dependabot[bot]
dbd111762d
chore(deps-dev): bump express from 4.18.2 to 4.19.2 (#10932)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-25 19:00:47 -04:00
Rich Harris
7a17e21f8a
chore: remove managed_effect (#10926)
* chore: remove managed_effect

* remove managed_pre_effect
2024-03-25 16:55:01 -04:00
Simon H
2755401034
breaking: remove createRoot, adjust mount/hydrate APIs, introduce unmount (#10516)
* breaking: remove `createRoot`, adjust `mount`/`hydrate` APIs, introduce `unmount`

closes #9827

* Update packages/svelte/src/internal/client/runtime.js

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>

---------

Co-authored-by: Rich Harris <richard.a.harris@gmail.com>
2024-02-18 07:52:56 -05:00
Rich Harris
5605e8cf49
feat: implement support for :is(...) and :where(...) (#10490)
* failing test for :is(...)

* simplify

* trim

* factor out truncate function

* pass stylesheet around

* recurse into :is and :where

* fix types

* fix types

* almost there

* gah so close

* tada

* changeset

* simplify

* feat: nested CSS support (#10491)

* parse nested CSS

* tests

* track parent rules

* some progress

* switch it up

* pruning

* works

* changeset

* lint

* error early on invalid nesting selector

* tidy

* note to self

* fix some specificity stuff

* failing test

* note to self

* fix: correctly scope CSS selectors with descendant combinators (#10502)

* fix traversal, but break some other stuff

* man this is fucken hard

* fixes

* getting closer

* be conservative for now

* tidy

* invert

* invert

* simplify

* switch

* for now

* progress

* i think it works?

* fix

* tidy up

* revert some stuff

* remove some junk

* handle weird cases

* update

* tweak

* shrink

* changeset

---------

Co-authored-by: Rich Harris <rich.harris@vercel.com>

---------

Co-authored-by: Rich Harris <rich.harris@vercel.com>

* Update playgrounds/sandbox/run.js

* changeset

---------

Co-authored-by: Rich Harris <rich.harris@vercel.com>
2024-02-17 16:56:03 -05:00
Simon H
72ff5366de
feat: add hydrate method, make hydration treeshakeable (#10497)
* feat: add hydrate method, make hydration treeshakeable

Introduces a new `hydrate` method which does hydration. Refactors code so that hydration-related code is treeshaken out when not using that method.
closes #9533
part of #9827

* get docs building

* ugh

* one more

* Update packages/svelte/scripts/check-treeshakeability.js

Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>

* warn

* Update sites/svelte-5-preview/src/routes/docs/content/01-api/05-functions.md

---------

Co-authored-by: Rich Harris <richard.a.harris@gmail.com>
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2024-02-17 11:25:18 -05:00
Rich Harris
7c70c346f8
Update deps (#10245)
* bump deps

* migrate

* fix

* downgrade jsdom/playwright

* fix a type error

* downgrade svelte

* prettier

* downgrade rollup

* downgrade other deps

* gah

---------

Co-authored-by: Rich Harris <rich.harris@vercel.com>
2024-01-19 19:16:18 -05:00
dependabot[bot]
9babce9105
chore(deps-dev): bump vite from 4.5.0 to 4.5.1 (#9800)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v4.5.1/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.1/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-05 21:01:24 -05:00
Rich Harris
bde42d5676
$inspect rune (#9705)
* feat: add $log rune

* fix issues

* fix issues

* tune

* avoid static state reference validation

* work around unfortunate browser behavior

* call it ExpectedError

* cleanup

* Fix docs

* tweaks

* tweaks

* lint

* repl, dev: true

* repl dev mode

* Update sites/svelte-5-preview/src/lib/Repl.svelte

* squelch static-state-reference warning

* simplify

* remove redundant code

* Update packages/svelte/src/main/ambient.d.ts

Co-authored-by: Rich Harris <richard.a.harris@gmail.com>

* Update packages/svelte/src/main/ambient.d.ts

Co-authored-by: Rich Harris <richard.a.harris@gmail.com>

* Update packages/svelte/src/main/ambient.d.ts

Co-authored-by: Rich Harris <richard.a.harris@gmail.com>

* only pause/trace on change

* Update packages/svelte/src/main/ambient.d.ts

* Update .changeset/chatty-hotels-grin.md

* Update sites/svelte-5-preview/src/routes/docs/content/01-api/02-runes.md

Co-authored-by: Rich Harris <richard.a.harris@gmail.com>

* $log.break and $log.trace no-op during SSR

* Update sites/svelte-5-preview/src/routes/docs/content/01-api/02-runes.md

Co-authored-by: Rich Harris <richard.a.harris@gmail.com>

* update test

* improve break experience

* fix ts

* remove unnecessary if (DEV) checks - log runes are removed in prod

* ensure hoisting doesnt mess up source maps

* check visited for cyclical values

* rename $log to $inspect, remove children

* custom inspect function

* implement custom inspect functions

* changeset

* update docs

* only fire on change

* lint

* make inspect take a single argument

* ugh eslint

* document console.trace trick

* demos

* fix site

---------

Co-authored-by: Dominic Gannaway <dg@domgan.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Dominic Gannaway <trueadm@users.noreply.github.com>
2023-11-29 14:31:38 -05:00
Dominik G
5619cd9bfc
chore: update playgrounds/demo (#9666)
* chore: update playgrounds/demo to exclude svelte from being optimized and generate an App.svelte so first run doesn't throw

* chore: fix format
2023-11-27 08:34:06 -05:00
Rich Harris
d57eff76ed
generate AST first (#9587)
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2023-11-21 11:42:22 -05:00
Rich Harris
755fe33a57
chore: add AST output to sandbox (#9488)
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2023-11-16 09:00:45 -05:00
Simon Holthausen
fe8a9ce31d breaking: init Svelte 5
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
Co-authored-by: Dominic Gannaway <dg@domgan.com>
2023-11-10 15:48:23 +01:00
gtmnayan
fe47621874
chore: fix another playground path (#9144) 2023-08-26 13:51:32 +02:00
Ben McCann
3c9e661f4a
fix: update paths for playground (#9139) 2023-08-24 12:46:20 +05:45
Ben McCann
3d3680cd11
chore: move playground (#9131) 2023-08-22 15:00:33 -07:00