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

Upgrade to Svelte 5 #490

Merged
merged 43 commits into from
Oct 28, 2024
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
1ed399b
chore: upgrade dependency to Svelte 5
josdejong Oct 14, 2024
96b2ff0
chore: use `mount`
josdejong Oct 14, 2024
ad8c573
chore: cleanup Svelte workaround for Vitest tests
josdejong Oct 14, 2024
9fbc4ca
chore: get tests running with Svelte 5
josdejong Oct 14, 2024
dc8f174
Merge branch 'refs/heads/main' into chore/svelte5
josdejong Oct 14, 2024
27c3e1e
Merge branch 'refs/heads/main' into chore/svelte5
josdejong Oct 14, 2024
516494f
Merge branch 'refs/heads/main' into chore/svelte5
josdejong Oct 14, 2024
8ba4d52
Merge branch 'refs/heads/main' into chore/svelte5
josdejong Oct 14, 2024
07896ea
Merge branch 'refs/heads/main' into chore/svelte5
josdejong Oct 14, 2024
e85f19b
chore: disable the compiler warnings "Properties of objects and array…
josdejong Oct 15, 2024
c8c5428
chore: fix the styling of selected or hovered recursive nodes
josdejong Oct 15, 2024
9504e12
Merge branch 'refs/heads/main' into chore/svelte5
josdejong Oct 15, 2024
896f055
Merge branch 'refs/heads/main' into chore/svelte5
josdejong Oct 15, 2024
777e11f
chore: add the warningFilter to the Rollup config too
josdejong Oct 15, 2024
6a9db92
chore: fix broken styling of the vanilla package
josdejong Oct 15, 2024
773fb55
feat: allow svelte@5 as peerDependency
josdejong Oct 18, 2024
009d193
chore: refine the peerDependencies versions
josdejong Oct 18, 2024
d3eca8c
chore: update to svelte@5.0.4, temporarily fix the versions of `svelt…
josdejong Oct 21, 2024
6f0422d
chore: replace the old destroy method with a new one attached to the …
josdejong Oct 22, 2024
3a2664c
chore: refactor `updateProps` to update every property one by one, an…
josdejong Oct 22, 2024
d2f2601
Merge branch 'refs/heads/main' into chore/svelte5
josdejong Oct 22, 2024
e1f35c2
chore: update package-lock.json
josdejong Oct 22, 2024
48fd6f3
Merge branch 'refs/heads/main' into chore/svelte5
josdejong Oct 22, 2024
8192c60
chore: update package-lock.json after solving merge conflicts
josdejong Oct 22, 2024
86a65e2
Merge branch 'refs/heads/main' into chore/svelte5
josdejong Oct 22, 2024
e3bd1b2
chore: upgrade svelte, fix (mostly invalid) svelte compiler warnings
josdejong Oct 22, 2024
660d0c4
fix: double click to edit a value not working
josdejong Oct 22, 2024
14c846c
chore: update test snapshots
josdejong Oct 22, 2024
864bf00
Merge branch 'refs/heads/main' into chore/svelte5
josdejong Oct 22, 2024
64782ee
chore: update to the latest version of `svelte-awesome`, and use inex…
josdejong Oct 22, 2024
ca1c707
Merge branch 'refs/heads/main' into chore/svelte5
josdejong Oct 22, 2024
cdb312a
chore: update package-lock.json
josdejong Oct 22, 2024
eb836a3
chore: suppress svelte compiler warnings inline, without using `warni…
josdejong Oct 22, 2024
1f28038
Merge branch 'refs/heads/main' into chore/svelte5
josdejong Oct 22, 2024
e640046
chore: pass all properties to the value renderers, simplifying the co…
josdejong Oct 23, 2024
1996002
chore: fix `JsonEditor` type export
josdejong Oct 24, 2024
8fded08
docs: explain how to disable the color picker and timestamp tag (see …
josdejong Oct 24, 2024
1e648a8
chore: replace `$set` with `updateProps`
josdejong Oct 24, 2024
219c2b4
Merge branch 'main' into chore/svelte5
josdejong Oct 25, 2024
65a3d4f
chore: update devDependencies
josdejong Oct 25, 2024
22e1fd0
fix: do not throw an error in case when passing an unknown property t…
josdejong Oct 25, 2024
df1c158
chore: fix the expand/collapse test examples
josdejong Oct 28, 2024
11b42e2
chore: update devDependencies
josdejong Oct 28, 2024
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
Prev Previous commit
Next Next commit
chore: suppress svelte compiler warnings inline, without using `warni…
…ngFilter`
josdejong committed Oct 22, 2024
commit eb836a3ce8d79bff1d1f6e76206199086ed685af
16 changes: 1 addition & 15 deletions rollup.config.vanilla-library.js
Original file line number Diff line number Diff line change
@@ -29,21 +29,7 @@ export default {
svelte({
compilerOptions: {
// enable run-time checks when not in production
dev: !production,

warningFilter: (warning) => {
if (warning.code === 'reactive_declaration_non_reactive_property') {
// Disable the warning:
// Properties of objects and arrays are not reactive unless in runes mode.
// Changes to this property will not cause the reactive statement to update (svelte)
// These warnings are wrongfully thrown when using TypeScript enums like Mode.tree
// TODO: find a solution and remove this warningFilter again (possibly this is a bug in Svelte 5)

return false
}

return true
}
dev: !production
},

emitCss: true,
2 changes: 2 additions & 0 deletions src/lib/components/modals/SortModal.svelte
Original file line number Diff line number Diff line change
@@ -45,6 +45,8 @@
$: {
// remember the selected values for the next time we open the SortModal
// just in memory, not persisted
// eslint-disable-next-line svelte/no-unused-svelte-ignore
// svelte-ignore reactive_declaration_non_reactive_property
// eslint-disable-next-line svelte/valid-compile
sortModalStates[stateId] = {
selectedProperty,
2 changes: 2 additions & 0 deletions src/lib/components/modals/TransformModal.svelte
Original file line number Diff line number Diff line change
@@ -154,6 +154,8 @@
$: {
// remember the selected values for the next time we open the SortModal
// just in memory, not persisted
// eslint-disable-next-line svelte/no-unused-svelte-ignore
// svelte-ignore reactive_declaration_non_reactive_property
// eslint-disable-next-line svelte/valid-compile
transformModalStates[stateId] = {
queryOptions,
6 changes: 6 additions & 0 deletions src/lib/components/modes/JSONEditorRoot.svelte
Original file line number Diff line number Diff line change
@@ -81,6 +81,8 @@
type: 'button',
text: 'text',
title: `Switch to text mode (current mode: ${mode})`,
// eslint-disable-next-line svelte/no-unused-svelte-ignore
// svelte-ignore reactive_declaration_non_reactive_property
// eslint-disable-next-line svelte/valid-compile
className: 'jse-group-button jse-first' + (mode === Mode.text ? ' jse-selected' : ''),
onClick: () => onChangeMode(Mode.text)
@@ -89,6 +91,8 @@
type: 'button',
text: 'tree',
title: `Switch to tree mode (current mode: ${mode})`,
// eslint-disable-next-line svelte/no-unused-svelte-ignore
// svelte-ignore reactive_declaration_non_reactive_property
// eslint-disable-next-line svelte/valid-compile
className: 'jse-group-button ' + (mode === Mode.tree ? ' jse-selected' : ''),
onClick: () => onChangeMode(Mode.tree)
@@ -97,6 +101,8 @@
type: 'button',
text: 'table',
title: `Switch to table mode (current mode: ${mode})`,
// eslint-disable-next-line svelte/no-unused-svelte-ignore
// svelte-ignore reactive_declaration_non_reactive_property
// eslint-disable-next-line svelte/valid-compile
className: 'jse-group-button jse-last' + (mode === Mode.table ? ' jse-selected' : ''),
onClick: () => onChangeMode(Mode.table)
2 changes: 1 addition & 1 deletion src/lib/components/modes/tablemode/ColumnHeader.svelte
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
$: sortDirection =
sortedColumn && isEqual(path, sortedColumn?.path) ? sortedColumn.sortDirection : undefined

// eslint-disable-next-line svelte/valid-compile
// svelte-ignore reactive_declaration_non_reactive_property
$: sortDirectionName = sortDirection ? SORT_DIRECTION_NAMES[sortDirection] : undefined

function handleSort() {
2 changes: 2 additions & 0 deletions src/lib/components/modes/tablemode/TableMode.svelte
Original file line number Diff line number Diff line change
@@ -369,6 +369,8 @@

let context: JSONEditorContext
$: context = {
// eslint-disable-next-line svelte/no-unused-svelte-ignore
// svelte-ignore reactive_declaration_non_reactive_property
// eslint-disable-next-line svelte/valid-compile
mode: Mode.table,
readOnly,
2 changes: 2 additions & 0 deletions src/lib/components/modes/treemode/TreeMode.svelte
Original file line number Diff line number Diff line change
@@ -1810,6 +1810,8 @@
// it should only change when a config option like readOnly or onClassName is changed
let context: TreeModeContext
$: context = {
// eslint-disable-next-line svelte/no-unused-svelte-ignore
// svelte-ignore reactive_declaration_non_reactive_property
// eslint-disable-next-line svelte/valid-compile
mode: Mode.tree,
readOnly,
16 changes: 0 additions & 16 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -7,22 +7,6 @@ const config = {
// for more information about preprocessors
preprocess: sveltePreprocess(),

compilerOptions: {
warningFilter: (warning) => {
if (warning.code === 'reactive_declaration_non_reactive_property') {
// Disable the warning:
// Properties of objects and arrays are not reactive unless in runes mode.
// Changes to this property will not cause the reactive statement to update (svelte)
// These warnings are wrongfully thrown when using TypeScript enums like Mode.tree
// TODO: find a solution and remove this warningFilter again (possibly this is a bug in Svelte 5)

return false
}

return true
}
},

kit: {
adapter: adapter(),
alias: {