The past month we've seen three new Routify feature releases:
- 1.8 (beta)
- Support for service workers
- Support for prefetching
- Support disabling prerendering with
prerender=false
- Support plugins
- Example plugin: FrontMatter
- Added new
$isChangingPage
helper - Various bug fixes
- 1.7: Better support for configs through package.json and environment variables (.env)
- 1.6: Added afterPageLoad hook (see documentation)
Next to this, we are continuing to improve the documentation. We're thinking about a new layout that will make it easier to find things.
As the framework gets more popular, we get more and more questions on our Discord channel (join us!).
Some of these will eventually be added to the docs on a dedicated FAQ page when deemed relevant for everyone. In FAQ this page it already in progress, but in order to keep us sane, we are already posting this content as a blog post so we can link to it easily.
This is a tough one to answer. Routify is a router. Routify starter is a template that provides much more than routing.
The Routify website - the very website you're looking at - talks about much more than routing alone. It is clear our ambitions are bigger than being a simple file-based router. These ambitions are coming to fruition in a project called Roxi. If you are eager to learn, join the discussion in the #roxi channel on Discord.
There are a few helper functions that were added in 1.7 and 1.8 that need some better documentation. In lieu of finished docs, we provide some information here.
$redirect()
functions the same as$goto()
, but usesreplacestate
instead ofpushstate
(the original page doesn't get added to browser history)- $isChangingPage` ...
- Try the svelte-app-electron template from @legionofone
- Electron doesn't detect changes in node_modules. To get around that, we can export the generated files to a folder in the project. The command
routify --routify-dir routify
will change the directory Routify uses for its files. Remember to import yourroutes.js
from this folder.
Your server isn't forwarding requests to Routify. Make sure that you redirect 404s to your entrypoint. Usually /index.html
or /__app.html
.
Yes. If you're using the starter template, these features are enabled by default, but can be disabled. Please note that these features are not mutually exclusive and you still get a full-fledged SPA when they're enabled.
SSR (Server side Rendering) is done in realtime and is useful for pages with dynamic content, like a news feed. Prerendering/static export is done when building the app. Prerendered pages are great for pages that don't rely on APIs.
$isChangingPage is a store which returns true while navigation is in progress. Ie, when the URL changes the store changes to true and once all the layouts and the page has been loaded on the new page, it changes to false. It's primarily intended for spinners and other loaders.