Skip to content

replaces calls to RSVP.map() with native equivalents. - #9460

Merged
dartajax merged 1 commit into
ilios:masterfrom
stopfstedt:promise_map
Aug 11, 2026
Merged

replaces calls to RSVP.map() with native equivalents.#9460
dartajax merged 1 commit into
ilios:masterfrom
stopfstedt:promise_map

Conversation

@stopfstedt

Copy link
Copy Markdown
Member

@netlify

netlify Bot commented Aug 10, 2026

Copy link
Copy Markdown

Deploy Preview for ilios-frontend ready!

Name Link
🔨 Latest commit fe29224
🔍 Latest deploy log https://app.netlify.com/projects/ilios-frontend/deploys/6a79fd61bb7ddd0008875974
😎 Deploy Preview https://deploy-preview-9460--ilios-frontend.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 10, 2026

Copy link
Copy Markdown

Deploy Preview for ilios-frontend ready!

Name Link
🔨 Latest commit 56a6b53
🔍 Latest deploy log https://app.netlify.com/projects/ilios-frontend/deploys/6a7b431b2d158100081569b3
😎 Deploy Preview https://deploy-preview-9460--ilios-frontend.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

✅ Visual Diff Report — PASSED

984 images compared: 984 identical

Download the results.

@stopfstedt
stopfstedt force-pushed the promise_map branch 5 times, most recently from 4aa1510 to 79a9326 Compare August 10, 2026 18:21
@stopfstedt
stopfstedt marked this pull request as ready for review August 10, 2026 20:14
@jrjohnson
jrjohnson removed the request for review from michaelchadwick August 10, 2026 22:31

@jrjohnson jrjohnson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would like a slightly different pattern in the routes where we're doing pre-loading to fire all network requests at the same time (as well as resolution in different threads instead of waiting for each individually).

Comment on lines +17 to +19
await term.vocabulary;
await Promise.all(sessions.map((s) => s.sessionType));
return await Promise.all(sessions.map((s) => s.totalSumDuration));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has slightly different loading behavior in that it would now send each network request individually, waiting for the response. This is repeated in a few of the routes here, a better patten would be something more like:

Suggested change
await term.vocabulary;
await Promise.all(sessions.map((s) => s.sessionType));
return await Promise.all(sessions.map((s) => s.totalSumDuration));
//this is freehanded, not comitable, just an example
return Promise.all([
term.vocabulary,
...sessions.map((s) => s.sessionType),
...sessions.map((s) => s.totalSumDuration),
]);

that will fire all the requests at the same time and only move on with rendering when they've all resolved.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea makes sense. i'll give the destructuring approach a try. thanks.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handled. ✅

@stopfstedt
stopfstedt marked this pull request as draft August 10, 2026 23:48
@stopfstedt
stopfstedt marked this pull request as ready for review August 11, 2026 16:10
@stopfstedt
stopfstedt requested a review from jrjohnson August 11, 2026 16:10
@stopfstedt
stopfstedt dismissed jrjohnson’s stale review August 11, 2026 16:11

i made the requested changes.

@dartajax
dartajax merged commit ce75b38 into ilios:master Aug 11, 2026
61 of 62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

replace usage of RSVP.map with native equivalent

3 participants