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

Specify which browsers we support to remove some Babel transforms #58

Merged
merged 1 commit into from
Mar 1, 2021

Conversation

captbaritone
Copy link
Contributor

eel-wasm makes heavy use of the ... array spread operator and the native version performs much better than the transformed version. I suspect this will also decrease the bundle size.

Before

Using targets:
{}

Using modules transform: auto

Using plugins:
  proposal-numeric-separator {}
  proposal-logical-assignment-operators {}
  proposal-nullish-coalescing-operator {}
  proposal-optional-chaining {}
  proposal-json-strings {}
  proposal-optional-catch-binding {}
  transform-parameters {}
  proposal-async-generator-functions {}
  proposal-object-rest-spread {}
  transform-dotall-regex {}
  proposal-unicode-property-regex {}
  transform-named-capturing-groups-regex {}
  transform-async-to-generator {}
  transform-exponentiation-operator {}
  transform-template-literals {}
  transform-literals {}
  transform-function-name {}
  transform-arrow-functions {}
  transform-block-scoped-functions {}
  transform-classes {}
  transform-object-super {}
  transform-shorthand-properties {}
  transform-duplicate-keys {}
  transform-computed-properties {}
  transform-for-of {}
  transform-sticky-regex {}
  transform-unicode-escapes {}
  transform-unicode-regex {}
  transform-spread {}
  transform-destructuring {}
  transform-block-scoping {}
  transform-typeof-symbol {}
  transform-new-target {}
  transform-regenerator {}
  transform-member-expression-literals {}
  transform-property-literals {}
  transform-reserved-words {}
  proposal-export-namespace-from {}
  syntax-dynamic-import {}
  syntax-top-level-await {}

After

Using targets:
{
  "android": "81",
  "chrome": "65",
  "edge": "79",
  "firefox": "59",
  "opera": "52",
  "samsung": "7.2"
}

Using modules transform: auto

Using plugins:
  proposal-numeric-separator { "chrome":"65", "firefox":"59", "opera":"52", "samsung":"7.2" }
  proposal-logical-assignment-operators { "android":"81", "chrome":"65", "edge":"79", "firefox":"59", "opera":"52", "samsung":"7.2" }
  proposal-nullish-coalescing-operator { "chrome":"65", "edge":"79", "firefox":"59", "opera":"52", "samsung":"7.2" }
  proposal-optional-chaining { "chrome":"65", "edge":"79", "firefox":"59", "opera":"52", "samsung":"7.2" }
  proposal-json-strings { "chrome":"65", "firefox":"59", "opera":"52", "samsung":"7.2" }
  proposal-optional-catch-binding { "chrome":"65", "opera":"52", "samsung":"7.2" }
  proposal-async-generator-functions { "samsung":"7.2" }
  proposal-object-rest-spread { "samsung":"7.2" }
  transform-dotall-regex { "firefox":"59", "samsung":"7.2" }
  proposal-unicode-property-regex { "firefox":"59", "samsung":"7.2" }
  transform-named-capturing-groups-regex { "firefox":"59", "samsung":"7.2" }
  proposal-export-namespace-from { "chrome":"65", "firefox":"59", "opera":"52", "samsung":"7.2" }
  syntax-dynamic-import { "android":"81", "chrome":"65", "edge":"79", "firefox":"59", "opera":"52", "samsung":"7.2" }
  syntax-top-level-await { "android":"81", "chrome":"65", "edge":"79", "firefox":"59", "opera":"52", "samsung":"7.2" }

@captbaritone
Copy link
Contributor Author

Size Change: -4.49 kB (-7%) ✅

Total Size: 64.4 kB

Filename Size Change
./dist/butterchurn.min.js 63.8 kB -4.5 kB (-7%)
./dist/isSupported.min.js 678 B +8 B (+1%)

@captbaritone
Copy link
Contributor Author

Same idea applied to Webamp: captbaritone/webamp#1069

@jberg jberg merged commit 7d6cb70 into jberg:master Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants