Skip to content

Commit

Permalink
Remove automatic fetch cache instrumentation (#28896)
Browse files Browse the repository at this point in the history
This removes the automatic patching of the global `fetch` function in
Server Components environments to dedupe requests using `React.cache`, a
behavior that some RSC framework maintainers have objected to.

We may revisit this decision in the future, but for now it's not worth
the controversy.

Frameworks that have already shipped this behavior, like Next.js, can
reimplement it in userspace.

I considered keeping the implementation in the codebase and disabling it
by setting `enableFetchInstrumentation` to `false` everywhere, but since
that also disables the tests, it doesn't seem worth it because without
test coverage the behavior is likely to drift regardless. We can just
revert this PR later if desired.

DiffTrain build for [a94838d](a94838d)
  • Loading branch information
acdlite committed Apr 23, 2024
1 parent f007da7 commit 802cec5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9f2eebd807bf53b7d9901cf0b768762948224cae
a94838df1c598a3993316ff453c84f3688537a97
1 change: 0 additions & 1 deletion compiled/facebook-www/__test_utils__/ReactAllWarnings.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 802cec5

Please sign in to comment.