Skip to content

Commit

Permalink
support for svelte 4 (#309)
Browse files Browse the repository at this point in the history
* upgrade(svelte): support for svelte 4
bumped changes from PR:https://github.com/ItalyPaleAle/svelte-spa-router/pull/303/files

* fix(router): props

* Disable linter for sample app

---------

Co-authored-by: ItalyPaleAle <[email protected]>
  • Loading branch information
carbogninalberto and ItalyPaleAle authored Dec 9, 2023
1 parent f525f9d commit c88aaf4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
test/app/dist
examples/*/dist

# Test app
test/app

# Files that use dynamic imports
test/app/src/routes.js
examples/dynamic-imports/src/routes.js
15 changes: 6 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@ module.exports = {
node: true,
browser: true
},
extends: 'eslint:recommended',
extends: [
'eslint:recommended',
'plugin:svelte/recommended'
],
parserOptions: {
ecmaVersion: 2019,
sourceType: 'module'
sourceType: 'module',
extraFileExtensions: ['.svelte']
},
plugins: [
'html',
'svelte3'
],
overrides: [
{
files: '**/*.svelte',
processor: 'svelte3/svelte3'
}
],
settings: {
html: {
Expand Down
6 changes: 3 additions & 3 deletions Router.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,14 @@ function scrollstateHistoryHandler(href) {

{#if componentParams}
<svelte:component
this="{component}"
params="{componentParams}"
this={component}
params={componentParams}
on:routeEvent
{...props}
/>
{:else}
<svelte:component
this="{component}"
this={component}
on:routeEvent
{...props}
/>
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "svelte-spa-router",
"version": "3.3.0",
"description": "Router for SPAs using Svelte 3",
"version": "4.0.0",
"description": "Router for SPAs using Svelte 4",
"main": "Router.svelte",
"svelte": "Router.svelte",
"types": "Router.d.ts",
Expand All @@ -20,7 +20,7 @@
"keywords": [
"router",
"svelte",
"svelte3",
"svelte4",
"spa"
],
"author": "Alessandro Segala (@ItalyPaleAle)",
Expand All @@ -37,14 +37,14 @@
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-node-resolve": "^13.3.0",
"chromedriver": "^103.0.0",
"eslint": "^8.21.0",
"eslint": "^8.44.0",
"eslint-plugin-html": "^7.1.0",
"eslint-plugin-svelte3": "^4.0.0",
"nightwatch": "^1.7.3",
"rollup": "^2.77.2",
"eslint-plugin-svelte": "^2.32.2",
"nightwatch": "^1.7.13",
"rollup": "^2.79.1",
"rollup-plugin-css-only": "^3.1.0",
"rollup-plugin-svelte": "^7.1.0",
"serve": "^14.0.1",
"svelte": "^3.49.0"
"rollup-plugin-svelte": "^7.1.6",
"serve": "^14.2.0",
"svelte": "^4.0.5"
}
}
4 changes: 2 additions & 2 deletions test/app/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<li>
<a id="dynamic-link-{dl.id}" href={dl.link} use:link use:active>Dynamic Link {dl.id}</a>
-
<i id="delete-link-{dl.id}" on:click={() => dynamicLinks = dynamicLinks.filter(e => e.id != dl.id)}>delete link</i>
<i role="button" id="delete-link-{dl.id}" on:click={() => dynamicLinks = dynamicLinks.filter(e => e.id != dl.id)}>delete link</i>
</li>
{/each}
</ul>
Expand All @@ -56,7 +56,7 @@
<li>
<a id="disable-link-{dl.id}" href="/foo" use:link={dl.opts} use:active>Dynamic Link {dl.id}</a>
-
<i id="toggle-link-{dl.id}" on:click={dl.toggle}>
<i role="button" id="toggle-link-{dl.id}" on:click={dl.toggle}>
{#if dl.opts.disabled}
enable link
{:else}
Expand Down

0 comments on commit c88aaf4

Please sign in to comment.