Live data from Hacker News

Preact : a smaller, faster React alternative

blog.logrocket.com

41–49 of 49 posts

Re: Preact : a smaller, faster React alternative

#41
post #28

Earlier quoted context omitted.

You can use React and virtual dom without JSX. Not that it's pleasant though.

I definitely preferred Mithril's m('div') over JSX . The closing tags are overly verbose for me.

As soon as the markup reaches a certain level, the verbosity (closing tags in particular) of JSX benefits you more than the terseness of hyperscript. Of course you can argue that you should split your components into smaller chunks, but that is, in my experience, rarely good just for the sake of readability.

Re: Preact : a smaller, faster React alternative

#42
post #9
post #3

To all people who write React-alternatives: please modularize as much as possible. For example, JSX-like syntax is not necessary and some developers might not want to use it; therefore, it should be in a separate module that is completely optional. Also, the virtual-DOM part may be useful in itself, therefore it should also be a separate module. React offers some tools to more easily manage state, but please acknowle…

I disagree, and prefer monolithic frameworks than modular ones. Catering for a common configuration of modules allows the maintainer and contributors to make more assumptions. These assumptions allow them greater freedom to optimize performance and simplify interfaces. Lego like frameworks have to be uber generic thus catering to theoretical computer science aesthetics rather than real world practical use cases. if a…

Agreed, I use Django for backend development and one of the main reasons is the consistent set of interfaces and architectural decisions, that all work well together.

I could probably get something faster or smarter with Flask + sqlalchemy, etc, but it's going to require much more thought and overhead on my part, and ultimately take longer to maintain.

Re: Preact : a smaller, faster React alternative

#43
post #32

Earlier quoted context omitted.

Be very careful. If FB holds any patents covering React, they are also enough likely to cover Preact. And there is no patent grant at all with Preact.

Also, for all we know FB might hold patents covering parts of Angular or Vue as well. Avoiding React because of the patent grant is a complete non-sequitur. The only thing we know about FB's patents is that using React means they won't sue you over patents covering React and they won't revoke the grant if you countersue (unless you countersue for patents you hold over React). The entire hysteria seems to only be back…

What about the following situation:

We are approached by a big company to buy our startup. In that case do they have the same limitation of not being able to sue Facebook? Do you think that Amazon or Google would be as happy buying your startup with React as without it? I was just wondering about this angle.

Re: Preact : a smaller, faster React alternative

#44

Is this viable to use as a drop in replacement for React? I am concerned about the license using React, that would be the sole reason to chose something else. I also got few projects in React that we would like to keep.

Be very careful. If FB holds any patents covering React, they are also enough likely to cover Preact. And there is no patent grant at all with Preact.

True, at least we are not directly using React in that case. I think there is a difference between directly using React or through software like Preact. I am going to ask our lawyers about this.

Re: Preact : a smaller, faster React alternative

#45
post #20

Is this viable to use as a drop in replacement for React? I am concerned about the license using React, that would be the sole reason to chose something else. I also got few projects in React that we would like to keep.

Same here. I am going to try to replace React with preact for the larger projects (webpack makes it easy) and run the e2e tests.

Let me know the results. There might be other people in similar situation too.

Re: Preact : a smaller, faster React alternative

#46
post #28

Earlier quoted context omitted.

You can use React and virtual dom without JSX. Not that it's pleasant though.

I definitely preferred Mithril's m('div') over JSX . The closing tags are overly verbose for me.

My group tried Mithril both with and without JSX. With JSX was more readable for the code we were writing.

Re: Preact : a smaller, faster React alternative

#47
post #32

Earlier quoted context omitted.

Also, for all we know FB might hold patents covering parts of Angular or Vue as well. Avoiding React because of the patent grant is a complete non-sequitur. The only thing we know about FB's patents is that using React means they won't sue you over patents covering React and they won't revoke the grant if you countersue (unless you countersue for patents you hold over React). The entire hysteria seems to only be back…

What about the following situation: We are approached by a big company to buy our startup. In that case do they have the same limitation of not being able to sue Facebook? Do you think that Amazon or Google would be as happy buying your startup with React as without it? I was just wondering about this angle.

Amazon uses React. https://medium.com/@blairanderson/amazons-new-brand-stores-u...

Google uses React. In fact, that's why the language used in the patent grant was changed. https://github.com/facebook/react/issues/7293#issuecomment-2...

Apple uses React. https://twitter.com/soprano/status/705516380913692672

Twitter uses React. https://www.infoq.com/news/2017/02/twitter-react-mobile-stac...

Microsoft uses React. https://microsoft.github.io/reactxp/

Seems like they don't care what some guy on Medium thinks.

Re: Preact : a smaller, faster React alternative

#48
post #47

Earlier quoted context omitted.

What about the following situation: We are approached by a big company to buy our startup. In that case do they have the same limitation of not being able to sue Facebook? Do you think that Amazon or Google would be as happy buying your startup with React as without it? I was just wondering about this angle.

Amazon uses React. https://medium.com/@blairanderson/amazons-new-brand-stores-u... Google uses React. In fact, that's why the language used in the patent grant was changed. https://github.com/facebook/react/issues/7293#issuecomment-2... Apple uses React. https://twitter.com/soprano/status/705516380913692672 Twitter uses React. https://www.infoq.com/news/2017/02/twitter-react-mobile-stac... Microsoft uses React. https…

Seems like sound logic that given many different companies including those in competition with Facebook are using React that there should be no worries for the rest of us.

Re: Preact : a smaller, faster React alternative

#49

I'm really curious, what did they have to throw overboard to lighten the load from 45kB to 3kB? They list a handful of missing bits[1] -- I'm not a React developer so I don't know how significant they are, but they don't sound like the sort of things that'd multiply the size of the codebase by fifteen... So what's the deal? How so small? [1] ( https://github.com/developit/preact/wiki/Differences-to-Reac... )

Some key points:

1. Preact eliminated white/black lists and uses regexes instead [1]. These lists take up huge amounts of space in React/ReactDOM [2].

2. No synthetic events, just native `addEventListener` [3].

3. Only target the DOM for rendering, no React Native to worry about.

4. Less invariants, error handling, and error messages

[1] https://github.com/developit/preact/blob/master/src/constant...

[2] https://github.com/facebook/react/blob/master/src/renderers/...

[3] https://github.com/developit/preact/blob/master/src/dom/inde...

Post reply on HN