SolidStart 1.0 RC - Progress so Far #1458
Replies: 10 comments 15 replies
-
I think we should also take CSS Modules into consideration. Solid already has a docs page for it https://docs.solidjs.com/guides/styling-components/css-modules and it seems that Nuxt supports them already https://nuxt.com/docs/getting-started/styling#css-modules. |
Beta Was this translation helpful? Give feedback.
-
My 2 cents about
|
Beta Was this translation helpful? Give feedback.
-
I had an issue recently where i wanted to import some global styles in a layout as |
Beta Was this translation helpful? Give feedback.
-
Thank you for this update 😊! Do we want CSS to load lazily in lazy components?Personally I find it really exhausting to work with foucs and i also dont like to see them in prod builds, they can make a site feel very flaky. Then again I also wanna be able to optimize the css loading. As the creator of If solid-start goes the eager route to load all css - which I hope it doesnt - it would be very important that the eager loading can be disabled. Otherwise it would break community solutions and would personally leave me in a worse css state that I am right now 😅. Other design concerns/high level issuesConfig based router limitationsThere are some limitations with config based routers, making them hard to use in a solid-start project:
Vinxi crashes in devThe dev server has a tendency to crash quickly in some cases, instead of just showing an error in the browser/terminal. E.g when you try import a file that doesn't exist. Router load + action + server-functionsThere is some inconsistency with actions and server-functions, which I think would make sense to be explored before start 1.0: solidjs/solid-router#407. |
Beta Was this translation helpful? Give feedback.
-
I hope solid.js can develop a stronger ecosystem. Currently, its progress seems slow, which makes me hesitant to use it in my projects. It's a pity. |
Beta Was this translation helpful? Give feedback.
-
Keep up the awesome work team! I can only hope that this library helps push SolidJS higher. You've done well and I've been happy with the tools you have provided so far. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the update Ryan. CSS TopicsI didn’t encounter any of the related CSS issues, or I guess I didn’t look for them. But it makes sense that a lazy component only loads its CSS at request time and we remove it upon disposal. But avoiding FOUC seems like a priority, in the sense that we tend to choose Solid and SolidStart for its performance, and its Lighthouse score (being a good metric or not is another subject), and FOUC is quite important in that regard. But my understanding of the challenges in that matter is limited… Handling Preload Errors in the RouterI’m not sure that this is the same subject, but it looks like it. On several occasions, I had Seroval complaining that a particular data I was sending with load functions wasn’t serializable. But I had to dig through the payload response to understand it (looking for Global FeedbackI’ve been using SolidStart for almost two years now, maintaining a medium-sized website on SolidStart v0.3.10. It runs great and performance-wise, it’s very satisfying. I’m now rewriting another website frontend closely following the SolidStart main branch, and the DX has improved so much (maybe my understanding as well :-D); it’s a joy to use. I really like the unopinionated approach, and the fact that it’s not fully featured. So that I can choose and then understand what I add and why. The thing that I’m really looking forward to is the island mode. It’s so nice to see the project coming close to its first stable number. Félicitations for the awesome work 🎉 |
Beta Was this translation helpful? Give feedback.
-
Maybe a hot take, but isn't the unmounting of CSS a potential source of bugs? Since you can't guarantee that |
Beta Was this translation helpful? Give feedback.
-
Looking at this all. I've realized that CSS solutions in other Vite frameworks like Remix aren't that different. I see that lazy loading CSS is important. So without being able to really take an official stance we are going to see how this plays out. I'm going do the bug fixes suggested, but in general if you want proper CSS handling of lazy styles you should use either 2 or 3 above. I won't be making a decision in SolidStart just yet because I don't know the right decision here. It is unclear. Other than that I've fixed most of the router stuff so on to the RC. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Ok. I wasn't intending to let this one linger so long. I had a family tragedy and it kept me away from my work for several weeks. Basically the whole month since releasing the RC. It's been a month and like any month since Beta 2 we are doing a reflection on SolidStart's progress.
I'm pretty happy with the RC so far. APIs seem good and locked and we are starting to see some bugs coming in. Many of them are not related to SolidStart. Some are core Solid issues and others aren't bugs but have gotten us to worker harder on documentation as it shows that people are using it.
However, I do think we have 2 concerns that are holding back release so I wanted to put them out to discussion. Really appreciate feedback here.
CSS Handling
Vinxi has some opinions here and has been slightly adjusting over time. I'd like to review them with the community at large to make sure we are doing the right things. And it comes down to a couple questions/assumptions that Vinxi makes.
1. Do we want CSS unload?
I think the answer ultimately is yes. But this has been the source of a lot of confusion. Frameworks with SFCs (Single File Components) have always handled their CSS a bit better than we have and truthfully we are looking at building primitives into the framework. But I do think this is the source of a decent amount of complexity impacting other decisions. Largely why we don't just go with Vite's default handling.
2. Do we want to crawl node_modules for CSS in dev?
Probably not. This is an interesting one. Vite will during production builds but it does something different during dev. But that is also why there is a flash of unstyled content in dev. Vinxi gets rid of that by pre-processing CSS in dev but that is slower. And node_modules start adding up. Vinxi originally did this in dev but stopped. Hence the need for: #1423
However, my understanding to be fair they still come in, just later. We get the FOUC. So maybe this is a reasonable tradeoff. We could look at adding exceptions in the future, but I believe you could just import the required CSS in your projects anyway?
3. Do we want CSS to load lazily in lazy components?
Currently Vinxi stops crawling on dynamic imports. We use a special lazy component in the FS router to determine which stylesheets to render from the build but it stops at any user land dynamic imports. Right now my understanding is that loading CSS is broken in production not just lazy.
Now there are a few ways we can approach solving this.
The most obvious is to not have Vinxi stop tracing through imports so we can eagerly load all the CSS. But I do see advantage of only adding the CSS that is related to components that are rendered.
Expose a version of our routeLazy wrapper. However this would still require compilation and it would be SolidStart specific. I'm ok if SolidStart does some extra transforms but having a different
lazy
wrapper seems not great. This suggests to me that depending on dynamic import granular handling of this may not be for the best. That being said the approach works as seen in userland with: https://codeberg.org/lufrai/solid-lazy-plusWe import the URL instead of the CSS and use it in SolidMeta component (or equivalent).. like:
This would leave the mounting and unmounting to the component lifecycle. Some challenges here are that streaming timing might make this harder. We've started work bringing this into solid core so that we can manage it better. We also still need to use static analysis to get the right preload tags as we may want to send those back before everything has rendered.
Handling Preload Errors in the Router
First of all this isn't a SolidStart problem exactly, but a Solid Router one. However, I want a solution for 1.0. This one has been a bit tricky because we don't
await
generally during load functions so any thrown errors are thrown into space. But maybe the solution could be specific tocache
functions. Maybe based on us knowing when they are initiated we could suppress errors. This is an imperfect solution but, any solution that didn't depend on a cache-like mechanism would be passing promises to await them so that is probably our best bet.In any case I want to address both issues. Are there any other design concerns/high level issues with Start you'd like to make sure are tackled in 1.0 release. Let us know below.
Beta Was this translation helpful? Give feedback.
All reactions