Skip to content

Conversation

@JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Jun 24, 2025

Docs PR for babel/babel#17390

This pull request introduces support for the "commonjs" mode in the sourceType configuration across various parts of the codebase and documentation. The "commonjs" mode is designed for parsing code intended to run in CommonJS environments, such as Node.js, and includes syntax differences from the "script" mode. The changes update documentation, types, and UI elements to incorporate this new mode.

Documentation Updates:

  • docs/options.md: Added "commonjs" to the list of valid values for sourceType, with an explanation of its compatibility with CommonJS environments and syntax differences.
  • docs/parser.md: Updated the sourceType description to include "commonjs" and clarified its behavior, including compatibility with "script" mode and additional syntax support. Also noted the addition of "commonjs" in version v7.28.0. [1] [2]

Code Updates:

@netlify
Copy link

netlify bot commented Jun 24, 2025

Deploy Preview for babel-next ready!

Name Link
🔨 Latest commit 4e02926
🔍 Latest deploy log https://app.netlify.com/projects/babel-next/deploys/6864f036201a370008a55530
😎 Deploy Preview https://deploy-preview-3106--babel-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jun 24, 2025

Deploy Preview for babel ready!

Name Link
🔨 Latest commit 4e02926
🔍 Latest deploy log https://app.netlify.com/projects/babel/deploys/6864f036aa6d5400084ef191
😎 Deploy Preview https://deploy-preview-3106--babel.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nicolo-ribaudo nicolo-ribaudo force-pushed the source-type-commonjs branch from 1682b39 to 4e02926 Compare July 2, 2025 08:39
@nicolo-ribaudo nicolo-ribaudo merged commit 2fe953f into babel:main Jul 2, 2025
4 checks passed
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