Preact: React for dev, Preact for prod ?

Created on 22 Apr 2017  路  2Comments  路  Source: preactjs/preact

I have found out about Preact just today. It looks very good, but I am concerned a lot about the lack of warnings that React usually produces that can save a lot of time and headaches when looking for a problem.

So that got me thinking if it would be actually viable to use React for developing app and just switch it for Preact (+ compat) in a production bundle. Obviously, it wouldn't be possible to use things that are only in Preact, but that's a low price for having easier developer experience.

Did anyone try this approach?

discussion

Most helpful comment

There are quite a few people using that approach, but I wouldn't recommend it. You should test the code you run in production, and swapping out the rendering library is a fairly major difference between dev and prod.

For warnings, we're about to release a debug plugin that adds much of what you're missing, you can see @NekR's lovely work on that in #633.

All 2 comments

There are quite a few people using that approach, but I wouldn't recommend it. You should test the code you run in production, and swapping out the rendering library is a fairly major difference between dev and prod.

For warnings, we're about to release a debug plugin that adds much of what you're missing, you can see @NekR's lovely work on that in #633.

@FredyC Yeah, if you have any suggestions about warning/throwing errors in preact/debug -- please suggest!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KnisterPeter picture KnisterPeter  路  3Comments

matthewmueller picture matthewmueller  路  3Comments

simonjoom picture simonjoom  路  3Comments

skaraman picture skaraman  路  3Comments

jescalan picture jescalan  路  3Comments