dillon1000/react
Commit
Browse files [Flight] provide property descriptors for client references (#27328)
Client reference proxy should implement getOwnPropertyDescriptor. One practical place where this shows up is when consuming CJS module.exports in ESM modules. Node creates named exports it statically infers from the underlying source but it only sets the named export if the CJS exports hasOwnProperty. This trap will allow the proxy to respond affirmatively. I did not add unit tests because contriving the ESM <-> CJS scenario in Jest is challenging. I did add new components to the flight fixture which demonstrate that the named exports are properly constructed with the client reference whereas they were not before.
Changed paths6 files
First-parent comparisonfixtures/flight/src/App.js ModifiedA fixtures/flight/src/Client.js AddedA fixtures/flight/src/Dynamic.js AddedA fixtures/flight/src/cjs/Note.js AddedM fixtures/flight/yarn.lock ModifiedM packages/react-server-dom-webpack/src/ReactFlightWebpackReferences.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…