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-plugin-mdx): Use latest for acorn's ecmaVersion #38126

Merged
merged 1 commit into from May 30, 2023

Conversation

LekoArts
Copy link
Contributor

@LekoArts LekoArts commented May 30, 2023

Description

#38104 showed that you can't use some modern JS syntax in MDX layout components. This is most probably due to us using 2020 in the acorn parser.

The docs at https://github.com/acornjs/acorn/tree/master/acorn/ say:

ecmaVersion: Indicates the ECMAScript version to parse. Must be either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or "latest" (the latest the library supports). This influences support for strict mode, the set of reserved words, and support for new syntax features.

I think we should be fine moving it to latest as we use https://babeljs.io/docs/babel-preset-env which also always defaults to "latest".

Documentation

#38104 is handling docs

Tests

Existing tests should pass

Related Issues

N/A

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label May 30, 2023
@LekoArts LekoArts added topic: remark/mdx Related to Markdown, remark & MDX ecosystem and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels May 30, 2023
@LekoArts LekoArts marked this pull request as ready for review May 30, 2023 06:09
@pieh pieh merged commit 5020b74 into master May 30, 2023
32 checks passed
@pieh pieh deleted the mdx-acorn-ecmaversion branch May 30, 2023 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: remark/mdx Related to Markdown, remark & MDX ecosystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants