inferno icon indicating copy to clipboard operation
inferno copied to clipboard

Support react-optimize

Open cia48621793 opened this issue 7 years ago • 8 comments

https://github.com/thejameskyle/babel-react-optimize

transform-react-inline-elements would be a little bit problematic for Inferno I guess?

cia48621793 avatar May 12 '17 05:05 cia48621793

@cia48621793 it wouldn't give Inferno any performance benefit as Inferno's VNodes are not immutable.

trueadm avatar May 12 '17 09:05 trueadm

There are plans to make inferno vNodes immutable in v4.

Havunen avatar May 12 '17 16:05 Havunen

This will not happen for v4. Moving target forward.

Havunen avatar Dec 15 '17 20:12 Havunen

@Havunen What about immutability of VNode in Inferno 6.0?

artembatura avatar Oct 14 '18 17:10 artembatura

@artemirq If vNode is hoisted and used in one or more places it will be cloned, Im not sure If it gains any performance that way

Havunen avatar Oct 14 '18 18:10 Havunen

@Havunen What you think about future React changes with respect to Inferno? These are:

  1. Async rendering
  2. Time slicing and Suspense API (React.Lazy too)
  3. Profiler API

artembatura avatar Oct 19 '18 23:10 artembatura

@artemirq

Async rendering and Time slicing and Suspense API (React.Lazy too)

I think this is interesting concept, I have not read enough about it to form opinion yet. I believe async rendering also comes with priority queues or something similar. Pushing everything to event queue wouldn't probably make much sense otherwise.

I don't know if managing priority queue is worth the cost of just diffing through, because inferno diff is really fast.

Profiler API

I think we could just add this into Inferno. It should be straightforward unless there is some catch that I'm not aware of.

Havunen avatar Oct 20 '18 07:10 Havunen

@Havunen Hey! Check it out https://twitter.com/reactjs/status/1054886083475857408

React.memo https://scotch.io/tutorials/react-166-reactmemo-for-functional-components-rendering-control

React.Lazy https://medium.com/@vigzmv/react-lazy-what-and-how-to-use-in-your-app-14b416dde8f7

Interesting, for Inferno does need to implement something like React.memo or React.PureComponent?

React.Lazy is very interesting with Suspense API ^o^

artembatura avatar Oct 24 '18 23:10 artembatura