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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge babel-plugin-fbt-runtime into babel-plugin-fbt #125

Open
jrwats opened this issue Jan 17, 2020 · 0 comments
Open

Merge babel-plugin-fbt-runtime into babel-plugin-fbt #125

jrwats opened this issue Jan 17, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@jrwats
Copy link
Contributor

jrwats commented Jan 17, 2020

馃殌 Merge babel-plugin-fbt-runtime into babel-plugin-fbt

The old behavior of babel-plugin-fbt should be configurable via plugin option and babel-plugin-fbt-runtime should simply be "on" by default.

Motivation

babel-plugin-fbt-runtime being written as a separate plugin is largely due to historical reasons and to Facebook's own internal usage patterns. It's not exactly optimal from an end-user app-developer perspective. Ease the pain, and merge the plugins

Example

A webpack plugin configuration of

            ['babel-plugin-fbt', {
              fbtEnumPath: path.join(__dirname, '.enum_manifest.json')
            }],
            'babel-plugin-fbt-runtime',

would instead look like:

            ['babel-plugin-fbt', {
              fbtEnumPath: path.join(__dirname, '.enum_manifest.json')
            }],

FB usage of the babel-plugin-fbt Babel transform would be called via:

            ['babel-plugin-fbt', {
              fbtEnumPath: path.join(__dirname, '.enum_manifest.json')
              fbtSuppressRuntimeTransform: true,
            }],

or via some better named boolean.

Pitch

2 plugins is 1 too many. Some might argue, 2, too many.

@jrwats jrwats added the enhancement New feature or request label Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant