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

Stop using babel-plugin-jsx-pragmatic #827

Merged
merged 2 commits into from Apr 27, 2018

Conversation

@edmorley
Copy link
Member

edmorley commented Apr 27, 2018

Since:

  • the plugin is not maintained and does not have a version that officially supports Babel 7 (it seems to work, but does so by pulling in Babel 6 dependencies that would presumably end up causing issues in the future)
  • the automatic imports break being able to import other things from React
  • explicit is better than implicit (python -m this <3)

Also enables eslint-plugin-react if using ESLint with @neutrinojs/preact, for parity with the React preset. (This will make it easier for Preact users to realise what changes they need to make, now that we're not using babel-plugin-jsx-pragmatic - and fixes #821).

@edmorley edmorley self-assigned this Apr 27, 2018
@eliperelman

This comment has been minimized.

Copy link
Member

eliperelman commented Apr 27, 2018

We also need to change the places in the docs where it says et al:

Automatic import of React.createElement, no need to import react or React.createElement yourself

@edmorley

This comment has been minimized.

Copy link
Member Author

edmorley commented Apr 27, 2018

Good point :-)

edmorley added 2 commits Apr 27, 2018
Since:
* the plugin is not maintained and does not have a version that
  officially supports Babel 7 (it seems to work, but does so by
  pulling in Babel 6 dependencies that would presumably end up
  causing issues in the future)
* the automatic imports break being able to import other things
  from `React`
* explicit is better than implicit (`python -m this` <3)

Users will need to add the missing imports when they upgrade to
Neutrino 9, but the airbnb preset will warn them (if they use it),
and we'll call it out in the migration guide.
`@neutrinojs/preact` already had a dependency on `eslint-plugin-react`,
but wasn't actually using it. Now the React ESLint plugin is enabled
if an ESLint configuration is found - the same as for the React preset.

This will make it easier for Preact users to realise what changes they
need to make, now that we're not using `babel-plugin-jsx-pragmatic`.

Fixes #821.
@edmorley edmorley force-pushed the edmorley:rm-jsx-pragmatic branch from e7f5554 to b552e40 Apr 27, 2018
@edmorley edmorley requested a review from eliperelman Apr 27, 2018
@edmorley edmorley merged commit f9a2d27 into neutrinojs:master Apr 27, 2018
2 checks passed
2 checks passed
Codacy/PR Quality Review Up to standards. A positive pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@edmorley edmorley deleted the edmorley:rm-jsx-pragmatic branch Apr 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.