Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gatsby-legacy-polyfills): add dom collections to polyfills #30483

Merged
merged 1 commit into from
Mar 29, 2021

Conversation

wardpeet
Copy link
Contributor

@wardpeet wardpeet commented Mar 26, 2021

Description

Enable dom iterables polyfill for nodeList.forEach and others.

You can test it with this snippet in IE11

import React from "react"

export default function Home() {
  const myRef = React.useRef()

  React.useEffect(() => {
    // console.log(myRef.current)
    myRef.current.querySelectorAll("li").forEach(node => {
      console.log(node.innerHTML)
    })
  }, [])

  return (
    <div>
      <ul ref={myRef}>
        <li>hello</li>
        <li>hi</li>
        <li>yo</li>
      </ul>
    </div>
  )
}

Related Issues

Fixes #30473

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 26, 2021
@LekoArts LekoArts added topic: webpack/babel Webpack or babel and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Mar 26, 2021
@wardpeet wardpeet marked this pull request as ready for review March 26, 2021 10:00
@vladar vladar merged commit 169eefe into master Mar 29, 2021
@vladar vladar deleted the fix/add-dom-iterables-polyfills branch March 29, 2021 10:12
wardpeet added a commit that referenced this pull request Mar 29, 2021
wardpeet added a commit that referenced this pull request Mar 30, 2021
… (#30532)

(cherry picked from commit 169eefe)

Co-authored-by: Ward Peeters <ward@coding-tech.com>
vladar pushed a commit that referenced this pull request Mar 30, 2021
vladar pushed a commit that referenced this pull request Mar 30, 2021
… (#30567)

(cherry picked from commit 169eefe)

Co-authored-by: Ward Peeters <ward@coding-tech.com>
pieh pushed a commit that referenced this pull request Apr 1, 2021
pieh pushed a commit that referenced this pull request Apr 1, 2021
… (#30616)

(cherry picked from commit 169eefe)

Co-authored-by: Ward Peeters <ward@coding-tech.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: webpack/babel Webpack or babel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NodeList.forEach polyfill missing; IE 11 breaking
3 participants