Skip to content

Add support for Babel 8 #1790

Description

@Dwlad90

Describe the feature request

Summary
Add official support for Babel 8 across the StyleX Babel-based packages (@stylexjs/babel-plugin and any packages depending on @babel/core).

Motivation
Babel 8 introduces breaking changes relative to Babel 7 (dropped support for older Node.js versions, ESM-first distribution, removal of deprecated options/APIs, stricter defaults, etc.). Tooling built on top of @babel/core needs to declare compatibility so downstream users can upgrade without peer-dependency conflicts. StyleX currently pins to @babel/core@^7, which blocks projects migrating to Babel 8.

Proposed solution
Widen the @babel/core peer/dev dependency range to allow ^8 (e.g. ^7.x || ^8.x) in @stylexjs/babel-plugin and related packages.
Audit usage of any Babel APIs that changed or were removed in Babel 8 (visitor/types helpers, config options, plugin ordering) and update accordingly.
Update @babel/* dev dependencies and the test/CI matrix to run against both Babel 7 and Babel 8.
Update documentation to note supported Babel versions.
Additional context
This also unblocks third-party integrations that mirror StyleX's Babel plugin, which depend on StyleX's declared Babel compatibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions