DEV Community

Discussion on: Thinking about going with PreactJs for dev.to

Collapse
 
johnlukeg profile image
John Luke Garofalo

I think that you've done the right thing by not jumping to a framework immediately, but I am a React Fanboy so I do think that you're hitting the point where it would make your life much easier.

Admittedly, I'm not very familiar with Preact specifically, but here are some of my thoughts on your choice that I think are worth considering. Obviously, there are many factors that only you can gauge so take everything with a handful of salt.

  • What is most important to you? Performance? Efficiency? Ease of Use? Dependency Independence™?

    • Preact is going to give you a light weight framework, but it's going to have less support than React. Additionally, the syntax/features may not be as up to date as React.
    • If you end up open sourcing, you're potentially raising your barrier of entry for contributors who may be discouraged by having to learn the differences between the two frameworks.
    • React may be overkill if you're sure that the complexities of the app aren't going to continue to grow. I love React but there's no sense in jumping in bed with it, if you just don't want all of the overhead or won't gain anything from it.
  • At some point, you're going to scale again, so it's worth considering whether the framework's value matches your needs later down the roadmap.

  • If server rendering is very important to you, you should also check out Next.js if you haven't already. It's not going to be more size-efficient than Preact but it may meet all of your current needs, while preparing you for scale down the road.

Ultimately, I think that you're making the right choice to move towards a framework at this point and I think that Preact is going to put you in a better position than you are in today, but it's worth considering what your future roadmap is telling you.

Young Padawan

I hope my ramblings provide you with valuable ponderings! Let me know what you end up going with :)

Collapse
 
ben profile image
Ben Halpern

Interestingly, I think the use of Preact covers a lot of the concerns you've outlined. Preact literally uses the React API more or less and is mostly different in how it's implemented under the hood. So React-knowledgeable devs should be able to come in and be productive quickly.

React, the "fully native" version of this sort of API is probably the best choice for "sure the app's complexities aren't going to grow". That's an interesting discussion because I'm sure the complexities will grow, but we're not designed like a single page app, so complexity in the components should remain pretty localized.

Thanks for your initial input, what do you think about these things?

Collapse
 
johnlukeg profile image
John Luke Garofalo

Interestingly, I think the use of Preact covers a lot of the concerns you've outlined.

Ah, that makes a lot of sense, thanks for clarifying! I've never used Preact so my opinions about it are subject to scrutiny.

React, the "fully native" version of this sort of API is probably the best choice for "sure the app's complexities aren't going to grow". That's an interesting discussion because I'm sure the complexities will grow, but we're not designed like a single page app, so complexity in the components should remain pretty localized.

Yeah that makes complete sense. It's hard for me to make a concrete opinion without reading through the code base, but you are obviously adept at considering the effects of each framework.

Given what you said, I think Preact is a great choice for you. Here's where I think you'll find the greatest value from Preact: I think that it would provide you with a way to introduce React Components to your code base and allow you to migrate to React fairly painlessly if your complexities call for it. Kind of like a "try before you buy" situation. You can slowly migrate some of the spaghetti into React as you go and if you need to migrate, then it should be pretty straightforward. Hopefully this provides a different perspective on the matter!