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): with some custom babel configs array spreading with Set is not safe #29885

Merged
merged 1 commit into from
Mar 1, 2021

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Mar 1, 2021

Description

With some custom .babelrc configs those can result in wrong transpiled code:

  var deduplicatedErrors = react__WEBPACK_IMPORTED_MODULE_6__.useMemo(function () {
    return [].concat(new Set(errors));
  }, [errors]);

Array.from does same thing without above:

  var deduplicatedErrors = react__WEBPACK_IMPORTED_MODULE_6__.useMemo(function () {
    return Array.from(new Set(errors));
  }, [errors]);

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 1, 2021
@LekoArts LekoArts added topic: hot reloading and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Mar 1, 2021
Copy link
Contributor

@vladar vladar left a comment

Choose a reason for hiding this comment

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

Thank you 🙏

@vladar vladar merged commit 5d312fe into master Mar 1, 2021
@vladar vladar deleted the v3/array-spread-with-set-not-always-safe branch March 1, 2021 18:17
vladar pushed a commit that referenced this pull request Mar 1, 2021
vladar pushed a commit that referenced this pull request Mar 1, 2021
…is not safe (#29885) (#29889)

(cherry picked from commit 5d312fe)

Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: DX Developer Experience (e.g. Fast Refresh, i18n, SSR, page creation, starters)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants