SolidStart Beta 2 #1052
Replies: 6 comments 15 replies
-
Epic! I've been trying solid start on a couple of projects (overall it's great) and many of my issues with it look like they're being addressed. Here's some feedback that might be helpful that wasn't addressed, just quickly jotted down. I'm not sure if "6. Better Middleware setup" includes this but one other area where I really struggled (this might be a docs thing) was setting a cookie on the server with a unique id for each client and getting that cookie value on the client. I tried various things for 1.5 hours before giving up. And lastly, I've had lots of issues with the router. I reported one which got fixed and there's also another one which I didn't report.
Furthermore I got really annoyed by your efforts of waiting for something before the router actually commits to updating the page. I think the idea is to wait for the next page to have loaded or something before showing it, but I don't need that since either the pages are sufficiently small that I don't want any lazy loading of them or I want to show placeholders/skeletons which appear instantly (so navigation should complete instantly) and then I take care of lazy loading my big things myself. While other people might want it different, the biggest problem with solid's approach detailed above is the following: From countless hours of debugging when implementing an SDK where scroll restoration is absolutely crucial and deciding to rely on browser native scroll restoration I'm telling you this very-little-known and documented requirement for browser native scroll restoration to work: the DOM must have been updated to the target page, at least the height of the target page (or greater) before the last I can't speak for other users, but for me "instant routing" where native scroll restoration just works is far more important than whatever fancy features you have to delay navigation that I don't use. |
Beta Was this translation helpful? Give feedback.
-
I'm here only to express my gratitude towards everyone who contributed to Solid and SolidStart in any way. |
Beta Was this translation helpful? Give feedback.
-
Thanks for this update and all the hard work @ryansolid ! My project is getting pretty large but the only real issues I've found so far that wasn't able to work around while keeping the code clean and scalable have been: 1. Nested routing with multiple
|
Beta Was this translation helpful? Give feedback.
-
That's some great news to hear <3! @ryansolid thank you for the hard work you and the team are putting into this, finally making the web a solid place 😁! And a special thanks for not only the fun, enjoyable, explorative hours you are investing, but also the boring, unrewarding, yet still important ones! Now that As you might know, I am implementing a CMS on top of start and waited with my own implementation of sitemap/RSS, because I wasn't sure what to expect from the previously announced start->Astro transition 😅. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the update!! Not sure what this means. Is there an example of this somewhere?
|
Beta Was this translation helpful? Give feedback.
-
@ryansolid I just created a new solidstart project and root.tsx is gone. Above, you mentioned the removal of capital letter Components that belong only in the root. However, it appears the docs aren't up to date on this change. The docs still reference root.tsx and use capital letter Components everywhere. Do you have any references for converting Beta 1 projects to Beta 2 projects? |
Beta Was this translation helpful? Give feedback.
-
There has been a lot of anticipation about when SolidStart can get out of Beta and move to 1.0. But unfortunately we are not ready yet. I think that is clear from the nature of bugs and issues we are facing. While there are some happy paths (node, UNIX, SSR) a lot of what Start does is pretty buggy. We've also learned a lot over the process on what we did well as APIs and what has failed. We also want to design a platform that keeps us open to the future.
I apologize for the time it has taken to post another update. The last one was over 8 months ago. Even then the path for what we needed to do was clear, it just wasn't obvious how we were going to achieve it. There were some fundamental issues with how Start was setup and large amount of work required to fix it. We've done a lot of exploration over the last several months that now I feel comfortable starting the discussion about Starts future.
And that starts with Beta 2. A second beta run that applies what we've learned. Why mark it like so? Well there will be some breaking changes. Not necessarily the largest for hobby apps, but we are changing how SolidStart deploys. We also need to make some other API level changes. This is why I want to include everyone in the discussion. Some decisions are pretty certain but many have a lot of details that are still being worked out and could use your feedback.
Summary of Changes
So what does a second Beta look like high level:
1. Rebase to Nitro's adapters and Vinxi
We want to offload the work on the adapter level and Nitro(powers Nuxt and Analog) can handle that for us. @nksaraf has been building a universal bundler/fs router on top of it which handles a lot of the specific wiring. This means that SolidStart stops maintaining adapters and our Vite Plugin basically becomes just configuration into this more generalized system. This will mean support for things like per page pre-renders, and properly supported CSR-only mode. It will mean proper support of code extraction like server functions, ie.. they will work regardless of if imported on the server, so behind lazy components, in CSR-only mode etc. And one of the messiest parts of SolidStart (the vite plugins) basically goes away.
Nitro
vinxi
2. Merge the Start CLI with the Solid CLI community project
SolidStart's CLI is sort of powerful but also tends to break. Long term I'd like our examples in here just to replace the degit templates. So we're going to combine efforts with the Solid CLI and make Start just a target for it. This will be much more powerful and allow for more things in the future. We should also re-alias create-solid. In combination with the Nitro changes above long term SolidStart doesn't really even need to be a mono repo (except for docs). Long term the docs effort could even be merged with other docs efforts.
3. Update the entry point
As much as I like how we have this Isomorphic Root it has been problematic for things like CSR mode. When considering that and things like Islands routing in the future I think we should start from an
app.tsx
and have the document part of the server entry.app.tsx
will look pretty much exactly as it would in our other Vite templates or like CRA. Just starts from the mount point.Something like this (this may not be the final API here):
This will keep things clean for the different modes of operation without worry about leaking side effects. It will also let us have a natural split for the top-level layout for Islands routing.
Part of this change will involve removing many of the capital letter Components that belong only in the root. Things like
<Html>
,<Head>
or<Body>
. Instead you can use lowercase versions. This will reduce API surface area and unnecessary import statements and align better with other changes.4. Stop aliasing other libraries through Start
My intention is to move
solid-start
to@solidjs/start
and in so we won't be aliasing other packages.@solidjs/router
or@solidjs/meta
would be referenced directly. This leaves very few imports from@solidjs/start
and leaves a very clear sense of responsibility. This also lets start be independent of improvements to those libraries other than version bumps. With changes to routing it should be possible for even the router of SolidStart to be replaceable so this is how we reach our goal.5. Update the router
I want to move
createRouteData
andcreateRouteAction
back into the router package and deprecate theircreateServer____$
equivalents. If you wish to use a server function just use a server function. This will allow us to make clearer, better APIs than trying to use some sort of first argument convention. It is also more explicit and doesn't give it special treatment while expanding the API surface unnecessarily. To accomplish this, Solid itself will need a standard interface for accessing server context/request so every third-party library can access it. In so we should be able to pull the Context Providers like the router into user/application space.There are other API changes for the router that will need consideration when trying to universalize for Islands. Things like using
props.children
instead of<Outlet />
and revisiting the upper case vs lowercase design of anchors. Also re-evaluate where@solidjs/meta
belongs. As part of the router we may be able to do more ahead of time.Also we should update the fileSystem routing convention. Instead of
routeData
we should export arouteConfig
that can pass through other options to the route other than just data, likeprerender
, ormatchFilters
etc... Basically any data we'd send to the route config other than the component we could put there.6. Better Middleware setup
We want Middleware to work across modes and different entries even if those entries are deployed to different locations. By making the fileSystem router more configurable we should be able to split apart where things are deployed and will need smarter wiring of middleware. To start that might just be a optional
middleware.ts
for global middleware. But I want to talk with the community to understand what the best patterns are.7. Revisit
server$
vsuse server
andisland$
vsuse client
These mechanisms won't be owned by SolidStart but will be configurable by it. The conventions of decorator vs directive has consequence and I'd like to find a consistent convention when considering all the different permutations.
Moving Forward
Work towards this has begun on the
vinxi
branch. It is not ready to use yet but we are seeing good progress. I want to share this now so that you all know what to expect and can be part of the process. Bugs and missing features (not backported in the router for example) aside the new branch is ~1200 LoC over 30 files vs the ~10,700 LoC over 150 files of current Start. That's the ballpark of difference this is going to make.For existing projects other than things that tap into middleware/request it is mostly going to just be a matter of updating imports and changing the config and root of the project. It may be easiest to copy your routes and non-start related folders into a fresh project. I have not dedicated effort for migration as we are still in beta, but I would welcome thoughts here.
Ultimately the goal is to expedite our 1.0 release and that is why we are introducing a new version with breaking changes. We've applied what we've learned to build a more solid project.
Beta Was this translation helpful? Give feedback.
All reactions