Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

chore: transpile modern JS features for older browsers #29

Merged
merged 7 commits into from
Jun 24, 2023

Conversation

anthonypecchillo
Copy link
Contributor

@anthonypecchillo anthonypecchillo commented Jun 23, 2023

Transpile Modern JS features for Older Browsers

Resolves:

Summary

Aims to prevent errors in older browsers related to the use of modern JS/TS features by extending Next.js' default Babel configuration.

Changes

  • Installed @babel/core and @babel/preset-env dependencies
  • Created a .babelrc file
    • Extends Next.js' default Babel configuration
    • Configures @babel/preset-env to target all browsers that either
      a. Have more than 0.25% market share
      b. Are not "dead" (without official support/updates for > 24 months).

Note

The Next.js docs warn of the following:

Good to know:

  • Next.js uses the current Node.js version for server-side compilations.
  • The modules option on "preset-env" should be kept to false, otherwise webpack code splitting is turned off.

However, our .babelrc doesn't need any adjustments, because the modules option is not explicitly set in the @babel/preset-env configuration, which means it will default to false, as recommended by the Next.js documentation. 🤓

aheckmann
aheckmann previously approved these changes Jun 23, 2023
* chore: add semantic-release dependency

* chore: init semantic release GitHub workflow

* fix: bump node version in CI to LTS

* chore: add "semantic-release" script to package.json
@anthonypecchillo anthonypecchillo merged commit 46cc985 into main Jun 24, 2023
@anthonypecchillo anthonypecchillo deleted the support-older-browsers branch June 24, 2023 00:03
@github-actions
Copy link

github-actions bot commented Jul 5, 2023

🎉 This PR is included in version 0.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants