Skip to content

Commit

Permalink
deps: upgrade Babel preset-env, remove now redundant plugins
Browse files Browse the repository at this point in the history
- optional-chaining and nullish-coalescing are now part of
  @babel/preset-env, so no need to explicitly install or configure
  them anymore
  - left in the regression tests though!
  - previously they were new syntax and TSDX adopted them as soon as
    they landed in TS
  - can view current compat table here:
    https://github.com/babel/babel/blob/e498bee10f0123bb208baa228ce6417542a2c3c4/packages/babel-compat-data/data/plugins.json#L24

- update autoprefixer integration test because browserslist and
  caniuse-lite were updated to more recent compat tables
  - `-webkit-input-placeholder` is no longer needed, but some others
    are, so switch to checking for `-moz-placeholder`
  - this probably fixes that "caniuse-lite is out-of-date" warning I
    was getting occassionally in CI
    - didn't get locally probably because I didn't install with
      `--frozen-lockfile` locally, unlike in CI
  • Loading branch information
agilgur5 committed Aug 25, 2020
1 parent 485e04b commit d628b16
Show file tree
Hide file tree
Showing 4 changed files with 717 additions and 625 deletions.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,9 @@
"@babel/core": "^7.4.4",
"@babel/helper-module-imports": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.4.4",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.7.4",
"@babel/plugin-proposal-optional-chaining": "^7.7.5",
"@babel/plugin-transform-regenerator": "^7.4.5",
"@babel/polyfill": "^7.4.4",
"@babel/preset-env": "^7.4.4",
"@babel/preset-env": "^7.11.0",
"@rollup/plugin-commonjs": "^11.0.0",
"@rollup/plugin-json": "^4.0.0",
"@rollup/plugin-node-resolve": "^7.1.0",
Expand Down
4 changes: 0 additions & 4 deletions src/babelPluginTsdx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ export const babelPluginTsdx = babelPlugin.custom(() => ({
name: '@babel/plugin-proposal-class-properties',
loose: true,
},
// Adds syntax support for optional chaining (.?)
{ name: '@babel/plugin-proposal-optional-chaining' },
// Adds syntax support for default value using ?? operator
{ name: '@babel/plugin-proposal-nullish-coalescing-operator' },
{
name: '@babel/plugin-transform-regenerator',
async: false,
Expand Down
2 changes: 1 addition & 1 deletion test/integration/tsdx-build-withConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('integration :: tsdx build :: tsdx.config.js', () => {

// autoprefixed and minifed output
expect(
cssText.includes('.test::-webkit-input-placeholder{color:"blue"}')
cssText.includes('.test::-moz-placeholder{color:"blue"}')
).toBeTruthy();

expect(output.code).toBe(0);
Expand Down
Loading

0 comments on commit d628b16

Please sign in to comment.