by cetra3 · 3y ago · 0 comments
The only main frustrations I have are:
- Library support is pretty lousy. You need to fudge things around to get working. I.e, with leaflet and others I have vendored in the libs and redone them.
- Incremental static refresh with svelte kit is not really there. I'd like a web hook or api callback that allows me to refresh certain static pages as I know that changes are made. Right now I'm doing a janky refresh using a file lock notifier & it's a blemish on an otherwise great framework.
- The URL routing in svelte kit is... a little ugly. It's really hard when you have an editor open with 5 `+page.svelte` files. I wish they re-introduced file name routes, rather than folder name routes. It is entirely a personal preference I know, but I have seen a lot of negative things around it.
[1] - https://github.com/cetra3/divedb - deployed at https://divedb.net/
But I'm 100% with you on the routing. It's weird. One thing I had a lot of trouble was with "sub routing", like being in a route, opening a modal and having the url change so it can be linked to.
I had to implement some ugly workaround in the layout to catch hasthag # navigation.
around the 7:00 min mark
Next 13's app directory and React Server Components is killing library support in React, so that's not such a big problem.
It's a short term problem because most popular libraries will get updated eventually, but some won't and they'll only ever work on the client side.
In the case of Next, maintainers need to package their libraries differently to support ESM modules, or you need to configure your project to use the experimental.esmModules=false flag. Again, it's not a particularly big problem but it does reduce the size of the available ecosystem a bit.
+1. I've been pushed to change tabs using `Ctrl+P` instead (search tab command) and write its route (folder's name). But it's still a bit painful
Some people have mentioned liking to set the label format to short under File > Preferences > Settings and then search for Label Format.
I just looked through your repo. I'm still relatively new to SvelteKit and rewriting a similar content based site from React.
What led you to use the SSG adapter vs the node adapter (which uses SSR)?
How long does the build take to pre-render all of your content pages like the sea life?
Was there a particular reason you didn't want to use Form Actions?
Not criticizing your decisions by the way, I'm mostly just curious about the decisions others make to learn something myself :)
- I am using a rust backend for the static files and didn't want NodeJS part of the request workflow. Most pages aren't changed all that much, like maybe once every few months & so having yet another service as part of the connection flow just adds resources/delay when it's not needed. It's a lot faster/easier/cacheable to serve a static file.
- The prerender doesn't take all that long, maybe a minute or so, it's fast enough for the site as it stands, but if it got super massive it'd be a different story. I throttle how often it happens currently, so that there is a bit of time between pre-renders.
- The frontend communicates to the backend via GraphQL & the backend is not part of svelte kit, it's an entirely separate service, and so things like `page.server.ts` won't apply.
Cheers
I'm hoping https://github.com/microsoft/vscode/issues/41909 will get implemented so we can make the problem go away entirely