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

build(babel): upgrade from babel 6 to babel 7 #1628

Merged
merged 2 commits into from
Aug 1, 2020

Conversation

AtofStryker
Copy link
Contributor

@AtofStryker AtofStryker commented Aug 1, 2020

Upgrade the babel config from babel 6 to babel 7. The goal here is to make sure VTU does not get too far behind on babel support. This is likely considered a larger maintenance item and may be replaced once typescript is fully implemented.

Build output is the same. I believe babel is only used for testing purposes here.

This includes a few subset of changes.

The vue-flow preset has been removed in favor or
direct plugin installation, including 'transform-flow-strip-types',
'syntax-flow', and ' proposal-class-properties'.

Use of 'transform-vue-jsx' plugin, using @vue/babel-plugin-transform-vue-jsx and @vue/babel-helper-vue-jsx-merge-props to gain babel 7 support. This is handled by @vue/babel-preset-jsx

Use proposal decorators with legacy decorators option set to true. This
requires options to be set in the babel-eslint to support since legacy
behavior is deprecated.

Use loose interpretation for proposal class properties to support legacy
proposal decorators. Proposal decorators must come before class
properties in plugin declaration

There were many stage-2 plugins that are not being used and were not
installed:
'proposal-export-namespace-from'
'proposal-function-sent'
'proposal-json-strings'
'proposal-numeric-separator'
'proposal-throw-expressions'
'syntax-import-meta'

@babel/polyfill now replaces babel-polyfill. @babel/polyfill is
currently deprecated, and should be replaced in a future PR. Please see
https://babeljs.io/docs/en/babel-polyfill for more details

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

@AtofStryker AtofStryker force-pushed the upgrade_babel branch 2 times, most recently from e6eaa96 to c6764bf Compare August 1, 2020 02:38
@AtofStryker AtofStryker marked this pull request as ready for review August 1, 2020 05:24
@lmiller1990
Copy link
Member

Thanks a lot. The deps here are pretty old... I also started updating our test infrastructure in this branch but it is failing on CI for some reason. 🤔 any ideas why?

RE this PR: If you can fix the conflict, I can merge this - and do a release. 🎉

Regarding TypeScript, I don't see much benefit in moving away from flow to TS (although TS is definitely better).

We are basically in maintenance mode (not looking to add any major features, anyway) so I don't see a huge benefit in moving to TS. None of the other Vue 2.x core libraries will, so I don't think VTU will either. I'd much rather get us onto Jest + update the rollup version before thinking about TS, at the very least.

@lmiller1990 lmiller1990 self-requested a review August 1, 2020 12:55
@AtofStryker
Copy link
Contributor Author

Thanks for taking a look @lmiller1990! I am trying to get more involved in the community and help out where I can. I can take a look at resolving the conflict. I am guessing my base branch is out of date with dev and should likely just be able to cherry-pick (or something) everything but the yarn.lock and run a reinstall. I will give it a shot!

I also started updating our test infrastructure in this branch but it is failing on CI for some reason. thinking any ideas why?

I can take a look and see what I can find!

Regarding TypeScript, I don't see much benefit in moving away from flow to TS (although TS is definitely better).

We are basically in maintenance mode (not looking to add any major features, anyway) so I don't see a huge benefit in moving to TS. None of the other Vue 2.x core libraries will, so I don't think VTU will either. I'd much rather get us onto Jest + update the rollup version before thinking about TS, at the very least.

💯 agree. There isn't a huge value add gained from moving to TS and there are bigger fish to fry. I just wanted to throw out the idea that the TS compiler would likely replace babel if going that route, especially considering the capacity in which babel is currently used. Considering VTU Next, I don't believe VTU 1.x would ever remove flow for TS

I would love to help out where I can, especially with the Jest upgrade. I am guessing you and the team are super busy with VTU Next. Going to take a look and see if I can help out there. To be honest, I am not exactly sure of the roadmap. As far as I know, VTU Next is going to eventually be VTU 2.x and only support Vue 3, while there will be some branch/tagging model (current dev branch) to support VTU 1.x for Vue 2 where fixes and minor features can still be contributed. Hopefully that is a correct assumption 😆

Upgrade the babel config from babel 6 to babel 7. This includes a few
subset of changes.

The vue-flow preset has been removed in favor or
direct plugin installation, including 'transform-flow-strip-types',
'syntax-flow', and ' proposal-class-properties'.

Use of 'transform-vue-jsx' plugin, using
@vue/babel-plugin-transform-vue-jsx and @vue/babel-helper-vue-jsx-merge-props to gain babel 7 support

Use proposal decorators with legacy decorators option set to true. This
requires options to be set in the babel-eslint to support since legacy
behavior is deprecated.

Use loose interpretation for proposal class properties to support legacy
proposal decorators. Proposal decorators must come before class
properties in plugin declaration

There were many stage-2 plugins that are not being used and were not
installed:
'proposal-export-namespace-from'
'proposal-function-sent'
'proposal-json-strings'
'proposal-numeric-separator'
'proposal-throw-expressions'
'syntax-import-meta'

@babel/polyfill now replaces babel-polyfill. @babel/polyfill is
currently deprecated, and should be replaced in a future PR. Please see
https://babeljs.io/docs/en/babel-polyfill for more details
Upgraded to latest patch version of vuepress to gain configFile: false fix for babel config. See
vuejs/vuepress#797 for more details.
@lmiller1990
Copy link
Member

Roadmap: I think Vue 2.7 will released, as the final "major" release for Vue. After that, only security and bugfixes will be done, no new features or significant changes. I think VTU will be similar, we will just patch bugs, and keep the dependencies up to date (eg, if we move to Jest, I think the workflow will be better and it will be easier to fix bugs etc).

VTU 1.x = Vue 2 support
VTU 2.x = Vue 3 support

@lmiller1990 lmiller1990 merged commit 4f71d1a into vuejs:dev Aug 1, 2020
@AtofStryker AtofStryker mentioned this pull request Aug 2, 2020
13 tasks
@AtofStryker AtofStryker mentioned this pull request Aug 16, 2020
13 tasks
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