Skip to content

Releases: ItalyPaleAle/svelte-spa-router

v4.0.1

09 Jan 01:09
6845f15
Compare
Choose a tag to compare

This release contains a small bug fix in the TypeScript types.

Bug fixes

  • Use ComponentType to fix TypeScript types #315 (thanks @laat)

v4.0.0 - Support for Svelte 4

09 Dec 18:38
63138c7
Compare
Choose a tag to compare

This release introduces support for Svelte 4 (Svelte 3 continues to be supported).

Breaking changes

See UPGRADING.md for upgrading instructions.

  • The deprecated wrap method imported from svelte-spa-router was removed

Notable changes

  • Support for Svelte 4 #309
  • Add conditional exports to package.json to improve compatibility with Vite #313
  • Remove deprecated method "wrap" #311
  • Don't use $ as a prefix in derived #308

Misc

The starter template ItalyPaleAle/svelte-spa-router-template has been upgraded to Svelte 4. The bundler was changed to Vite, and TypeScript is enabled by default.

Thanks

Thanks to people who contributed to this release: @carbogninalberto, @iksflow, @gdamjan

v3.3.0

07 Aug 16:47
Compare
Choose a tag to compare

This is a maintenance release that includes a few fixes.

New features:

  • A new public function restoreScroll is available to programmatically restore the scroll state to a given object - thanks @nathaniel-daniel

Fixes:

  • Restoring scroll state works correctly now even when the page was scrolled on the X axis only - thanks @Jan-Kruse
  • The WrapOptions type is now exported - thanks @notiv-nt
  • Remove 'undefined' from history.replaceState() optional URL parameter for improved IE11 compatibility - thanks @dipscom

v3.2.0

17 Jun 03:17
acec9f0
Compare
Choose a tag to compare

This release adds a few new features and fixes.

New features:

  • In the object that callbacks for routeLoading, routeLoaded and conditionsFailed receive, there's now a params property that contains the matches params
  • The router now exports a $params readable store that contains all params matched.
  • The use:link action now supports passing an object with options, including href and a new disable boolean which disables the link when true; the change maintains backwards-compatibility for when a string is passed rather than an object (#163 - thanks @omerman)

Fixes:

  • Do not override state in the browser's history (#197 - thanks @orange4glace)
  • Fixed memory leaks when the router was un-mounted (#221, #225, and #214 - thanks @dimitrisrk and @Erwin-k)
  • Updated regexparam dependency to version 2.0.0 to fix using svelte-spa-router in the Svelte REPL
  • Fixed a warning in Rollup (#207 - thanks @byr-gdp)

v3.1.0

04 Dec 06:06
v3.1.0
6d89f61
Compare
Choose a tag to compare

This release contains some improvements and fixes.

New features:

  • The use:active action now allows setting a class name when the link is not active (inactiveClassName)

Fixes:

  • When there's a prefix in the router (e.g. for nested routers), if the prefix doesn't match now no route is displayed
  • Some more fixes and improvements to TypeScript definitions
  • When a route path is not valid, now the error message is clearer

v3.0.5

24 Oct 00:41
v3.0.5
7cf1560
Compare
Choose a tag to compare

Typings published with 3.0.4 were not correct. This release fixes them.

Fixes:

  • Typings for TypeScript are actually working this time.

v3.0.4

24 Oct 00:39
v3.0.4
eacb377
Compare
Choose a tag to compare

This release adds TypeScript definitions to svelte-spa-router so it should play nicer with TypeScript (and with editors!).

New features:

  • Exporting .d.ts files with TypeScript definitions

v3.0.3

04 Oct 01:48
v3.0.3
9879d8f
Compare
Choose a tag to compare

This is another bugfix release that fixes a small regression introduced in 3.0 🐞

Fixes:

  • Fixed: switching routes while a dynamically-imported component is being requested could cause an exception (#143)

v3.0.2

24 Sep 03:52
v3.0.2
e9954eb
Compare
Choose a tag to compare

This version contains bug fixes, including a fix for a regression introduced in version 3.0.

Fixes:

  • Do not un-mount components before replacing them, as with dynamically-imported components the replacement might happen in a next tick, causing the component to be un-mounted and re-mounted in the DOM (fixes #136)
  • Better cloning of the detail object to ensure it's not altered between ticks.

v3.0.1

20 Sep 23:59
v3.0.1
Compare
Choose a tag to compare

svelte-spa-router has reached version 3.0! 🎉🥳

This major release contains a set of new features, most notably support for dynamically-imported components (which enables code-splitting)!

Breaking changes:

  • Because parameters from the URL are now URL-decoded, if you were doing it on your application before, you might need to update the code to avoid URL-decoding twice
  • The wrap method exported by svelte-spa-router is now considered deprecated and using it will throw a warning; it will be removed in a future version. Please upgrade to the new wrap method exported by svelte-spa-router/wrap, which also supports dynamically-imported routes. See the documentation for route pre-conditions.
  • The method nextTickPromise, which was already deprecated, has been removed

New features:

  • Add support for dynamically-imported components (fixes #73)
  • Restore scroll position on navigation (thanks @liquiddandruff)
  • Route pre-conditions can be async functions (fixes #125)
  • Can now pass static props to a component using the wrap method (fixes #131) (thanks @matt-psaltis)
  • Route Loaded event includes the path of the route (fixes #132)

Changes:

  • Decode URL-encoded parameters from URL (fixes #107)
  • Prefix for nested routers can be a regular expression that will be removed if matched (fixes #134)
  • Using the tick method from Svelte rather than re-implementing it. The method nextTickPromise, which was already deprecated, has been removed.
  • svelte-spa-router now uses ES2016 features (async/await) internally and requires a recent-enough browser (most browsers from 2017 onwards should be good), or transpilation with Babel
  • Added devcontainer, so you can develop inside a Docker container or GitHub Codespaces

Fixes:

  • Tests now run against Chrome running in Docker, so there's no more issues with the CI server updating Chrome

Note: version 3.0.0 was retired minutes after release because of an issue with the .npmignore file that caused more files to be included in the NPM bundle than needed. No code changes happened between 3.0.0 and 3.0.1.