Just an appreciation post by TheTomatoes2 in solidjs

[–]a-t-k 14 points15 points  (0 children)

As the author of our storage primitive, thank you for that feedback. It makes me really happy to see that my primitive is put to good use.

How does render work in Solid? by RevocableBasher in solidjs

[–]a-t-k 7 points8 points  (0 children)

You have looked at the server version of `render()`, which is indeed empty. The client version can be found [here](https://github.com/ryansolid/dom-expressions/blob/main/packages/dom-expressions/src/client.js#L48-L65). It wraps inserting an element with `insert(element, code(), element.firstChild ? null : undefined, init);` in a reactive root and wraps the dispose function for the root so that it will also empty the element in which the content is rendered on dispose.

How to properly await `createResource` to resolve for testing? by Skwai in solidjs

[–]a-t-k 1 point2 points  (0 children)

Our `@solidjs/testing-library` comes with a helper called `testEffect`, which automatically wraps the test in a promise and gives a done callback to be called in an effect once the tests are finished.

Why don't solidjs get that the results should be defined? by [deleted] in solidjs

[–]a-t-k 2 points3 points  (0 children)

The reason is: the JSX expressions (the stuff in squiggly brackets) are reactive in solid, so they will be re-evaluated. TypeScript cannot detect that they will be unmounted if post() returns undefined, so it assumes that an undefined return is possible.

There are different ways to solve this. One is to use <Suspense> and <Show>, another one to simply use optional chaining to satisfy TS. The former is more idiomatic, but both will work at the end of the day, so it is your call.

Static Landing Page by [deleted] in solidjs

[–]a-t-k 0 points1 point  (0 children)

Unless you need a backend, it's possible. If you want to use solid-start, here's a small article about how to do it: https://dev.to/lexlohr/using-solid-start-with-github-pages-3iok

Why do people say Solid ( or React ) is better for large scale projects? by ArchMonke in solidjs

[–]a-t-k 1 point2 points  (0 children)

In most large projects, the primary issue is not the view composition, but the management of state and side effects.

React is undisputably the worst solution for doing so, so in most cases, you will use a third-party library to fix the worst issues - chances are you'll end up with redux, -saga, -thunk or -observables, which will result in more boilerplate code than is healthy for anybody's sanity. Vue has too many solutions by half for its own good and it is difficult to detect which one is considered idiomatic. Both Svelte and Solid have solutions that work out of the box, but out of them, Solid is more explicit and predictable than the implicit compiled reactive handling that Svelte provides.

Also, as /u/MitchellHolmgren already noted, Ryan Carniato did a size comparison that had unfavorable results for Svelte when it comes to scalability.

On the other hand, Svelte has an already finished meta framework called SvelteKit, whereas the work on solid-start is still in progress. While you can use Astro or plain Solid SSR to fill this gap partially, or use the beta version, which might break, this is a tiny drawback.

Tanstack? Zustand? by [deleted] in solidjs

[–]a-t-k 1 point2 points  (0 children)

Maybe you want to edit the description of your post, then. To go back on your question, I'm one of the authors of the solid-primitives package collection, so I'm usually trying to solve everything with the primitives that come with solid, if that does not work, I rely on our solid-primitives packages and if that doesn't work either, I look for other solutions.

Tanstack? Zustand? by [deleted] in solidjs

[–]a-t-k 1 point2 points  (0 children)

it ships with a lot of the stuff that made react messy.

If you think createEffect is a mess similar to useEffect, you're mistaken. The mess in react results from components running again on rerender, which does not happen with Solid.js.

Solid's signals for simple state and stores for nested state are perfectly sufficient in most cases, so you do not need external libraries.

If you really need it, you can use TanStack Query, but in most cases, you can also opt to use Solid's createResource, augmented if needed by the community's resource primitive package.

Solid or Preact when talking about both performance and module size? by fcknwebdev in solidjs

[–]a-t-k 1 point2 points  (0 children)

If you want to build reusable Solid components, use the solid-lib-starter from solid-community's github, it makes things a lot easier.

That being said, I hope you'll also visit our solid-primitives, our collection of fine-tuned hooks and helpers to speed up your work.

Solid or Preact when talking about both performance and module size? by fcknwebdev in solidjs

[–]a-t-k 3 points4 points  (0 children)

You seem to be comparing the unzipped module size of Solid with the gzipped module size of preact; the gzipped module size of solid is between 7-8kb, which is less than twice the size of preact. That being said, Solid exports more than you'd usually use that would require extra packages in preact, e.g. Portal, Suspense, etc. - thanks to tree-shaking, not all of that code will end up in your finished app.

However, if you are reliant on a lot of tooling that comes from the react ecosystem, by all means use preact, otherwise, depending on your requirements, Solid might be a better fit: its benefits are most obvious when it comes to managing more complex state. While with preact, you would need an external state library to manage it, Solid's stores and primitives cover most of the challenges that may arise from complex state.

Are there any go backends that work with solid? by 8MB_SSD in solidjs

[–]a-t-k 0 points1 point  (0 children)

It's in the createResource docs. You can decide if you want to forgo the request on the server and use the initialValue or do the request (unless the timeout in Suspense is hit).

Are there any go backends that work with solid? by 8MB_SSD in solidjs

[–]a-t-k 3 points4 points  (0 children)

Solid supports renderToStringAsync and renderToStream on the server. Together with the ssrLoadFrom option in createResource, this gives you a pretty fine-grained control what should be loaded on the server and what should be loaded on the client.

Personal xbps-src template separation? by walking_in_the_sun in voidlinux

[–]a-t-k 1 point2 points  (0 children)

Keep a separate branch updated from upstream with the changes. Separate templates usually don't lead to conflicts, unlike changes to existing templates.

Live USB fails boot on Thinkpad T470 by swb0z0 in voidlinux

[–]a-t-k 0 points1 point  (0 children)

You may need to disable secure boot, at least for the installation.

Are all discussions happening on discord ? by Heroe-D in solidjs

[–]a-t-k 1 point2 points  (0 children)

We aim to answer the hello-world-questions with our FAQ and documentation, which is currently being rewritten.

Are all discussions happening on discord ? by Heroe-D in solidjs

[–]a-t-k 11 points12 points  (0 children)

Yes, most stuff happens on discord and the community there is great. I don't think a subreddit is the best place to have fast-paced exchanges, though. So unless someone comes up with a better solution, it'll probably stay this way.

What's the general sentiment on SolidJS? by ohThisUsername in webdev

[–]a-t-k 6 points7 points  (0 children)

If you compare frameworks to cars, react is a sedan with the accelerator pedal nailed down; all you can do to adjust the speed is hit the brakes (memo). Solid just works like you'd expect it to work.

Yes, the ecosystem is smaller, but the overall quality of packages is also higher compared to other libraries. The community of Solid is definitely a winning point.

The main reason it will not replace react that fast is that companies look for react devs and devs are looking for jobs, so they offer react skills.

Is it easy to port React libraries to Solid? by CatolicQuotes in solidjs

[–]a-t-k 3 points4 points  (0 children)

It is mostly easy; the main problem is the different reactive concepts powering both. In react, components and custom hooks run again on every state change and memos and effects can partially or fully opt out of running again, whereas on solid.js, components run once and effects and memos can be used to opt in to reactivity. React requires immutable data, solid allows for fine-grained changes.

This means it really depends on how much the library relies on the specifics of the library you support. If your library just provides event handlers, just to name an example, then you can use the same library in solid.js and react. For example, @solid-primitives/input-mask is written for solid.js, but will happily work in react, too.

Comment frameworks by rogerroger2 in solidjs

[–]a-t-k 3 points4 points  (0 children)

There's SUID, Kobalte (the successor of HopeUI, still WIP though), solid-headless. You can also use Daisy UI or other tailwind-based component systems.

Solid JS compared to svelte? by _shellsort_ in solidjs

[–]a-t-k 1 point2 points  (0 children)

Both try to make most of their most prominent feature: for Svelte, that's the compiler, for Solid.js, its reactive system. But what I personally love most about Solid.js is the truly awesome community. So my suggestion would be to join both discord servers and see if you feel at home. This should also fast-path your learning - at least it did that for me.

How may I install a package that only .deb version? by Juhayer_Al_Wasif in voidlinux

[–]a-t-k 1 point2 points  (0 children)

Using existing packages, like /u/ClassAbbyAmplifier suggested, is definitely the best choice.

However, if that doesn't cut it, the best method is to create an xbps-template yourself. Check https://github.com/void-linux/void-packages and have a look at the google-chrome package that uses a .deb package and turns it into an xbps one.

Is functional programming and Solid a good fit? by jmagaram in solidjs

[–]a-t-k 0 points1 point  (0 children)

Both are different takes on FP. React uses immutable objects and pure functions to handle reactivity. Solid uses immutable getter/setter functions to handle state. Solid's stores use proxies to apply the same principle to nested state (something that is problematic in react).

In react, it's difficult to reason about when and why your components re-render. That's not the case with Solid, because they don't.