Skip to content

use array spread for htmlcollection foreach#2064

Merged
ffont merged 2 commits intomasterfrom
foreach-array-spread
Feb 18, 2026
Merged

use array spread for htmlcollection foreach#2064
ffont merged 2 commits intomasterfrom
foreach-array-spread

Conversation

@alastair
Copy link
Member

Issue(s)
Last change needed to be made for related commits
dda177c
3408341

Description
According to claude, the issue was:

What almost certainly happened: your previous Parcel setup included core-js polyfills that patched
  HTMLCollection.prototype.forEach onto the prototype. Parcel 1 automatically included core-js via
  @babel/preset-env, which patches a bunch of DOM collection prototypes — adding .forEach(), Symbol.iterator,
  .entries(), etc. to HTMLCollection and NodeList.

  When you upgraded Parcel (likely to Parcel 2), two things changed:
  1. The default JS transformer switched from Babel to SWC (@parcel/transformer-js), which doesn't do automatic
  polyfill injection
  2. Even if you're still using Babel, Parcel 2 doesn't auto-include core-js polyfills the way v1 did

So this seems like a reasonable solution without going back and adding in a polyfill. Just found one more case where it wasn't fixed

@ffont
Copy link
Member

ffont commented Feb 18, 2026

Perfect @alastair , thanks!

@ffont ffont merged commit c90dc0c into master Feb 18, 2026
2 checks passed
@ffont ffont deleted the foreach-array-spread branch February 18, 2026 16:54
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.

2 participants