Skip to content

Update 07-fetching-data.mdx#82862

Merged
icyJoseph merged 8 commits intovercel:canaryfrom
sleekLancelot:patch-3
Aug 25, 2025
Merged

Update 07-fetching-data.mdx#82862
icyJoseph merged 8 commits intovercel:canaryfrom
sleekLancelot:patch-3

Conversation

@sleekLancelot
Copy link
Copy Markdown
Contributor

Promise.all or any of the other 3 static concurrency methods don't actually run requests in parallel, rather they execute concurrently.

Parallelism vs Concurrency
Promise Concurrency

Promise.all or any of the other 3 static concurrency methods don't actually run requests in parallel, rather they execute concurrently.

[Parallelism vs Concurrency](https://wiki.haskell.org/Parallelism_vs._Concurrency)
[Promise Concurrency](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency)
@ijjk ijjk added the Documentation Related to Next.js' official documentation. label Aug 21, 2025
@ijjk
Copy link
Copy Markdown
Member

ijjk commented Aug 21, 2025

Allow CI Workflow Run

  • approve CI run for commit: 13cb931

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@ijjk
Copy link
Copy Markdown
Member

ijjk commented Aug 21, 2025

Allow CI Workflow Run

  • approve CI run for commit: 49dc633

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

Comment thread docs/01-app/01-getting-started/07-fetching-data.mdx Outdated
correct spelling error
Comment thread docs/01-app/01-getting-started/07-fetching-data.mdx Outdated
Comment thread docs/01-app/01-getting-started/07-fetching-data.mdx Outdated
Comment thread docs/01-app/01-getting-started/07-fetching-data.mdx Outdated
format markdown

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
@icyJoseph icyJoseph self-requested a review August 21, 2025 21:20
@icyJoseph
Copy link
Copy Markdown
Member

icyJoseph commented Aug 21, 2025

Hi,

This is one of those topics where it is fairly easy to talk past each other. Let me first value the PR, there are good ideas here, I’ll add some review comments so we can land it.

The root problem as I see it, is the placement of the comments and how the section hints at Promise.all as the executor, when in reality it is just a collector.

Whether operations run in parallel is a function of the host environment, not of Promise APIs. For example, when you call fetch twice, the network stack (browser or Node/undici) can issue both requests in parallel, but JavaScript itself remains single‑threaded.

const a = fetch('/a'); // request is initiated here
const b = fetch('/b'); // and here
await Promise.all([a, b]); // this only awaits both

For CPU-bound work, there's no such thing as parallelism without Worker Threads/Web Workers - and at best async/tasks just interleave, so that operations look concurrent.

I'll leave some comments, let's discuss over those and try to land some changes :)

Comment thread docs/01-app/01-getting-started/07-fetching-data.mdx Outdated
Comment thread docs/01-app/01-getting-started/07-fetching-data.mdx Outdated
Comment thread docs/01-app/01-getting-started/07-fetching-data.mdx Outdated
Comment thread docs/01-app/01-getting-started/07-fetching-data.mdx Outdated
Comment thread docs/01-app/01-getting-started/07-fetching-data.mdx Outdated
add suggested changes
@sleekLancelot
Copy link
Copy Markdown
Contributor Author

Thanks, I added your suggestions, pls take a look when you have the chance.

Comment thread docs/01-app/01-getting-started/07-fetching-data.mdx Outdated
Comment thread docs/01-app/01-getting-started/07-fetching-data.mdx Outdated
@icyJoseph icyJoseph merged commit 1029d05 into vercel:canary Aug 25, 2025
63 checks passed
@github-actions github-actions bot added the locked label Sep 8, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Documentation Related to Next.js' official documentation. locked

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants