dillon1000/react

Commit

[Blocks] Scaffolding react-fetch + first pass at node implementation (#18863)

* First pass at scaffolding out the Node implementation of react-data.

While incomplete, this patch contains some changes to the react-data
package in order to start adding support for Node.

The first part of this change accounts for splitting react-data/fetch
into two discrete entries, adding (and defaulting to) the Node
implementation.

The second part is sketching out a rough approximation of `fetch` for
Node. This implementation is not complete by any means, but provides a
starting point.

* Remove NodeFetch module and put it directly into ReactDataFetchNode.

* Replaced react-data with react-fetch.

This patch shuffles around some of the scaffolding that was in
react-data in favor of react-fetch. It also removes the additional
"fetch" package in favor of something flatter.

* Tweak package organization

* Simplify and add a test

Co-authored-by: Dan Abramov <[email protected]>
Browse files
Changed paths24 files
First-parent comparison
M fixtures/blocks/src/server/Comments.js ModifiedM fixtures/blocks/src/server/Feed.js ModifiedM fixtures/blocks/src/server/PostList.js ModifiedM fixtures/blocks/src/server/ProfileBio.js ModifiedM fixtures/blocks/src/server/ProfilePage.js ModifiedM fixtures/blocks/src/server/ProfileTimeline.js ModifiedD packages/react-data/npm/fetch.js DeletedD packages/react-data/npm/index.js DeletedD packages/react-data/src/__tests__/ReactDataFetch-test.js DeletedR packages/react-data/README.md →packages/react-fetch/README.md RenamedR packages/react-data/fetch.js →packages/react-fetch/index.browser.js RenamedR packages/react-data/index.js →packages/react-fetch/index.js RenamedR packages/react-data/src/ReactData.js →packages/react-fetch/index.node.js RenamedA packages/react-fetch/npm/index.browser.js AddedA packages/react-fetch/npm/index.js AddedA packages/react-fetch/npm/index.node.js AddedR packages/react-data/package.json →packages/react-fetch/package.json RenamedR packages/react-data/src/fetch/ReactDataFetch.js →packages/react-fetch/src/ReactFetchBrowser.js RenamedA packages/react-fetch/src/ReactFetchNode.js AddedR packages/react-data/src/__tests__/ReactData-test.js →packages/react-fetch/src/__tests__/ReactFetchBrowser-test.js RenamedA packages/react-fetch/src/__tests__/ReactFetchNode-test.js AddedM scripts/rollup/build.js ModifiedM scripts/rollup/bundles.js ModifiedM scripts/rollup/modules.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…