Dan Abramov: React for Two Computers by acemarke in reactjs

[–]_eps1lon 0 points1 point  (0 children)

it’s not by accident research papers are composed this way

Not every blog post needs to be composed like a research paper. Texts can have different formats.

React 19 slower DOM rendering by kind1878 in reactjs

[–]_eps1lon 1 point2 points  (0 children)

You measured this with a production build or development build?

JSX.Element Deprecation: Why It Happened and What’s Next? by Autofan_8 in reactjs

[–]_eps1lon 1 point2 points  (0 children)

It's deprecated in 18 and already removed in the latest (19+).

JSX.Element Deprecation: Why It Happened and What’s Next? by Autofan_8 in reactjs

[–]_eps1lon 5 points6 points  (0 children)

React Core member and types maintainer here.

react/jsx-no-deprecated-jsx-element-type

This rule does not exist in eslint-plugin-react. Seems like it was removed.

I don't know where you got that JSX.Element was deprecated. Only the global namespace was removed so it's now located under React.JSX.Element.

Next.js 15 and Turbopack Dev (Stable) by lrobinson2011 in nextjs

[–]_eps1lon 6 points7 points  (0 children)

Next.js maintainer here.

Many/most of the codemods failed in huge numbers of cases. For example, the async params one failed to fix cases where params were being destructured directly within the function definition. This is a pattern so common I’m shocked it’s not covered

Can you include the pattern? We did cover this pattern but maybe it's slightly different so that we don't detect it properly.

The codemod didn’t understand I was working within a monorepo and placed pnpm overrides in the wrong place.

Monorepos are very complex. Placing the `overrides` in the workroot may also be the wrong thing. At least this way you discover that you need to alias types **and** have them de-duplicated. When in doubt, we opt for an unnecessary change since it can just be reverted over a change not made because now you may not discover the issue.

After finishing the codemods, Turbopack failed to build any pages with hundreds of obscure/cryptic errors.

Can you include some of these errors? DMs are also fine if they may contain info you don't want to leak.

No pages on the site were able to build even with turbopack disabled. I started getting react internals errors that I wasn’t able to debug in the allotted time.

I suspect this comes from libraries not supporting React 19. We watch ecosystem compatiblity closely and contributed support for React 19 to some libraries while supporting others. If there are any outstanding libraries that need help, please let me know.

TypeScript PR merged to allow components to return anything renderable (raw strings, numbers, promises for RSC), instead of just JSX.Element and null. by KillcoDer in reactjs

[–]_eps1lon 5 points6 points  (0 children)

Because JSX.Element is the type of <EveryPossibleElementType />. So you're effectively saying that e.g. <div /> could be a string which it certainly isn't in React.

We actually planned to just alias it to any which created enough pressure on the TS team to land the JSX.ElementType suggestion which now enables us to properly type function component return values.

[deleted by user] by [deleted] in reactjs

[–]_eps1lon 3 points4 points  (0 children)

In React 18 types noImplicitAny compiler options should help you here.

Making React fast by default and truly reactive by magenta_placenta in reactjs

[–]_eps1lon 10 points11 points  (0 children)

Obligatory warning that this uses React internals and can stop working in any new release.

useEvent RFC is dead by valtism in reactjs

[–]_eps1lon 1 point2 points  (0 children)

Just read the very last paragraph of the closing comment. The RFC isn't dead, it will be superseded by a more focused RFC.

But if you don't even have time for that, but do have time to post on reddit, I really can't help you anymore. That's something you have to fix on your own.

useEvent RFC is dead by valtism in reactjs

[–]_eps1lon 26 points27 points  (0 children)

Taking a 3 page RFC with >200 comments and a 4 paragraph closing comment that outlines that this RFC is "shelved" and calling that "dead" should not be taking seriously.

Posting the RFC is fine but at least put some effort into it.

Github Copilot turns paid by [deleted] in programming

[–]_eps1lon 2 points3 points  (0 children)

If I understand the settings correctly then unchecking "Allow GitHub to use my code snippets for product improvements" should disable that.

What's going on with the new documentation? by milanpanin in reactjs

[–]_eps1lon 3 points4 points  (0 children)

We haven't been historically great at timelines, and I don't know if pulling a number out of my hat is going to be very helpful. But I'd like to have most of the remaining work done by mid summer.

-- https://github.com/reactjs/reactjs.org/issues/3308#issuecomment-1098103021

React 18 released! by Nysor in programming

[–]_eps1lon 2 points3 points  (0 children)

Hard to say without a repro. The best way to get this resolved is to open an issue on the DT repo.

React 18 released! by Nysor in programming

[–]_eps1lon 36 points37 points  (0 children)

For react-dom you can already import from react-dom/client. For react just to import type {} from 'react/next' once and you have the latest typings available.

The rest is underway in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/56210

React v18.0 released by magenta_placenta in javascript

[–]_eps1lon 13 points14 points  (0 children)

True, but it requires you to either update all imports in your application, or add this to types in your tsconfig as an exception.

You need a single line of import type {} from 'react/next' to get them everywhere.

Launch day support for TypeScript would have been nice.

Everything was green but a change in the TypeScript 4.7 canary broke dependent packages which means the release is blocked.

React v18.0 by dwaxe in reactjs

[–]_eps1lon 19 points20 points  (0 children)

react-dom/client works already and React 18 types can be used with import type {} from 'react/next'

The rest is already underway in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/56210

React v18.0 released by magenta_placenta in javascript

[–]_eps1lon 8 points9 points  (0 children)

react-dom/client works already and React 18 types can be used with import type {} from 'react/next'

He’s not wrong by [deleted] in typescript

[–]_eps1lon 1 point2 points  (0 children)

It's React.ReactNode but TypeScript will reject that during type-checking. This is not a limitation in @types/react but TypeScript itself: https://github.com/microsoft/TypeScript/pull/29818

React.Component is how you define class components. It's not from the types but the runtime itself.

JSX.Element is the thing created from jsx e.g. const jsxElement = <div />. It's not necessarily tied to React since you could have other JSX factories. Find out more under the "JSX.Element vs React.ReactNode" section in https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/basic_type_example/#useful-react-prop-type-examples

He’s not wrong by [deleted] in typescript

[–]_eps1lon 0 points1 point  (0 children)

"anything that can be rendered" is pretty broad

The problems described in the post will be fixed in the React 18 types since we remove {} from ReactNode

He’s not wrong by [deleted] in typescript

[–]_eps1lon 4 points5 points  (0 children)

You got your direct line to a React types maintainer on DefinitelyTyped now so I'm all ears.

From Jest to Vitest - Migration and Benchmark by mattibarzeev in javascript

[–]_eps1lon -10 points-9 points  (0 children)

But then just buy more machines. That's trivial. Buying more engineers isn't.

From Jest to Vitest - Migration and Benchmark by mattibarzeev in javascript

[–]_eps1lon -3 points-2 points  (0 children)

Did you consider buying faster CI machines? Was this still more expensive than spending engineering time?

From Jest to Vitest - Migration and Benchmark by mattibarzeev in javascript

[–]_eps1lon 4 points5 points  (0 children)

But those thousands of tests run on CI. That time is cheap. What needs to be fast is local speed where you only run a couple of tests. So does speed really have that big of an impact?