Hacker Newsnew | past | comments | ask | show | jobs | submit | sebmarkbage's commentslogin

My work seems to have made you angry which makes me sad.

You’ll at least be happy to learn that useEffect will be sync if the render itself was sync in React 18. Ofc if you do an async render those effects won’t work anyway and you need to do it in the event handler itself.

I doubt it’s much of a conciliation though. I agree the programming model is weird. It’s the best idea we had for what we were trying to achieve. Sorry for the trouble it has caused you.


My primary issue is that you guys did have other options. You did. I saw the RFC thread. About 2/3s were useless "oh no" or "oh yes" comments, but about a third had suggestions and feedback, some good feedback, on how to make the stateful function API not as jarring and not as weird. You simply ignored it all, since you already had an API in mind (and perhaps already did most of the work, I don't know)

That you thought (correctly) that an eslint package of rules was necessary to prevent people from shooting themselves in the foot with the gun you have provided should have been a hint that it's not good API.


I think this misses the point of what a senior developer is.

Nobody builds a huge thing by themselves better than multiple people can. Being a senior developer is enabling a few other people to do their best work.


Not quite. This PR is almost ready to do it.

https://github.com/facebook/prepack/pull/397

Currently it is blocked on Map/Set support in the output which is an outstanding issue. We could also try it with a Map/Set polyfill.

We're very close to being able to though!

In fact, this isn't just Prepack itself but it is Prepacking the JS part of the entire Node.js runtime as well!


(I'm "Sebastian".) It meant to read C. It definitely wasn't C++. However, now I'm curious if I'm confusing it with the later Amiga games. I'll need to look into this. I was 8 years old at the time. :) Note that this was for hobby projects many years after the original launch of those products - not mainstream dev.


C/C++ was much more common on the Amiga, although even C++ was rare until later in the Amiga's lifecycle.


Yeah I kinda wondered if the article author messed something up. :-)

Probably your dad was doing C on the Amiga. C on the C64 wasn't really a thing. Nor was C++ on the Amiga, really.


If it spread to a become a defacto standard format, wouldn't that be a good thing? That way you only have to deal with this once and it will work everywhere.

At that time, the size/parse time will have much greater impact because the total size of libraries will be smaller or unaffected.

At the same time it encourages libraries to put significant error messages in their code without fear of bloat which helps your customers in the end.

Personally, I hope everyone will follow.


Since the URL to the raw mapping is not in the error and requires external knowledge and the parameters are in free form in the error message I doubt this can become a standard of any sorts. The correct place for this would have been something like sourcemaps.


Yea, this is clearly not enough to be a standard but we don't really know of a standard for this and it is not really our primary expertise.

If Sentry or others that understand this problem space better create a standard format, we would be happy to switch to that.

Everything have to start somewhere. :)


Parse time is the new bottleneck of modern client-side web apps. Of course React on its own isn't going to move the needle but if other libraries follow along it just might. With better, more expressive error messages without paying the cost at scale.


If you can show me even a contrived example of a React app where the presence or absence of three kilobytes of debug messages makes a measurable difference to performance, I will be very impressed (and humbled).


To me its not about the 3KB, thats negligible. Its more the precedent.

It is a strong statement that React cares strongly about my page weight, even as small as 3KB. At least the implied message it sends me:

1. I really should care about my page weight too.

2. React must really need every KB it currently uses. And if not, it will soon optimize away the bloat.


I'm not so sure I agree there. Not that React isn't fantastic, but I remember a recent release adding support for SVG elements. If I don't use any, it would be great to strip out that functionality - React is not a small library. Alternatives like Preact show that you can have a core set of functionality at a much smaller size.

With the prevalence of npm and mini-libraries I'd be interested to see if the size of React could be cut down and put into optional components.


Have there been any efforts to have tree shaking work with react?

It's not a magic bullet, but it can go a long way in helping remove a ton of unused-for-your-use-case code in your production build.


I don't think tree shaking would help much. Speaking as an author of one of those mini-virtual-dom libraries, from my experience/research, the choices of features to support are usually tightly integrated for performance reasons.

For tree shaking to work, it must be possible to statically infer that some code is not part of the dependency graph of your application. Something like SVG support requires extensions to the virtual dom node structure that the renderer's visitor looks at, so it's quite difficult to make it into a hook and not lose performance to various overheads. It's also worth mentioning that over-modularizing can get boilerplatey (e.g. https://github.com/paldepind/snabbdom#inline-example)


Saving a handful of kb on a JS library quickly gets shot to hell when you have to load up sixteen analytics trackers, an auto-playing video, and a bevy of unoptimized ad images.

There is lower-hanging, bigger-buck-for-your-bang, fruit if you're trying to fight page bloat.


And React can't prevent any of those. React can only change React code, so they optimize it as best as they can, and leave the "user" of React to optimize everything else in their own app.


Note that the stateless part is mostly just a stepping stone to a stateful variant.

https://github.com/reactjs/react-future/tree/master/07%20-%2...


Yep, I saw that, and that's even more exciting. Any possibility of 0.15 or 0.16 on that front?


React.DOM is still in 0.13.


Thanks, good to know. That gives us a nice path to upgrade our CoffeeScript components.


The point of this is exactly to reduce the library size AND getting to a stable 1.0 release. By making the class system optional, it becomes an optional dependency which reduces the library size. Supporting only createClass in a stable 1.0 release would mean that we're stuck with that dependency.

The way we see it, ES6 and 7 are around the corner and then the createClass dependency becomes optional.


This is actually a way to eventually reduce the size of the library since it makes the class system optional.

We're definitely considering optional module based systems instead of OOP, but it's still too early. https://github.com/reactjs/react-future/tree/master/07%20-%2...


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: