question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

For legacy-javascript advice, suggest excluding some polyfills for "modern" build

See original GitHub issue

As of today, @babel/preset-env + esmodules: true + bugfixes: true will apply these polyfills and transforms:

Using targets:
{
  "android": "61",
  "chrome": "61",
  "edge": "16",
  "firefox": "60",
  "ios": "10.3",
  "opera": "48",
  "safari": "10.1",
  "samsung": "8.2"
}

Using modules transform: auto

Using plugins:
  proposal-nullish-coalescing-operator { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  proposal-optional-chaining { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  proposal-json-strings { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  proposal-optional-catch-binding { "android":"61", "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  proposal-async-generator-functions { "android":"61", "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1" }
  proposal-object-rest-spread { "edge":"16", "ios":"10.3", "safari":"10.1" }
  transform-dotall-regex { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" }
  proposal-unicode-property-regex { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  transform-named-capturing-groups-regex { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  transform-unicode-regex { "ios":"10.3", "safari":"10.1" }
  bugfix/transform-async-arrows-in-class { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  bugfix/transform-edge-default-parameters { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  bugfix/transform-edge-function-name { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  bugfix/transform-safari-block-shadowing { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  bugfix/transform-safari-for-shadowing { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  bugfix/transform-tagged-template-caching { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  transform-modules-commonjs { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  proposal-dynamic-import { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }

Using polyfills with `entry` option:

[/Users/cjamcl/src/lighthouse/lighthouse-core/scripts/legacy-javascript/variants/655dfce5bd8bbca5337615b71d06458d12bc2665e1a2c9e4e760d4bfef5691f4/core-js-3-preset-env-esmodules/true-and-bugfixes/main.js] Replaced core-js entries with the following polyfills:
  es.symbol.description { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  es.symbol.async-iterator { "android":"61", "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1" }
  es.symbol.match { "edge":"16" }
  es.symbol.replace { "edge":"16" }
  es.symbol.search { "edge":"16" }
  es.symbol.split { "edge":"16" }
  es.array.flat { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  es.array.flat-map { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  es.array.index-of { "ios":"10.3", "safari":"10.1" }
  es.array.iterator { "android":"61", "chrome":"61", "opera":"48", "samsung":"8.2" }
  es.array.last-index-of { "ios":"10.3", "safari":"10.1" }
  es.array.reverse { "ios":"10.3", "safari":"10.1" }
  es.array.slice { "ios":"10.3", "safari":"10.1" }
  es.array.sort { "android":"61", "chrome":"61", "ios":"10.3", "opera":"48", "safari":"10.1" }
  es.array.splice { "ios":"10.3", "safari":"10.1" }
  es.array.unscopables.flat { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  es.array.unscopables.flat-map { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  es.array-buffer.constructor { "ios":"10.3", "safari":"10.1" }
  es.array-buffer.slice { "ios":"10.3", "safari":"10.1" }
  es.math.hypot { "android":"61", "chrome":"61", "opera":"48", "samsung":"8.2" }
  es.number.parse-float { "ios":"10.3", "safari":"10.1" }
  es.number.to-fixed { "edge":"16" }
  es.object.assign { "edge":"16" }
  es.object.define-getter { "android":"61", "chrome":"61", "opera":"48" }
  es.object.define-setter { "android":"61", "chrome":"61", "opera":"48" }
  es.object.from-entries { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  es.object.lookup-getter { "android":"61", "chrome":"61", "opera":"48" }
  es.object.lookup-setter { "android":"61", "chrome":"61", "opera":"48" }
  es.promise { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  es.promise.finally { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  es.reflect.set { "edge":"16" }
  es.regexp.constructor { "edge":"16" }
  es.regexp.flags { "edge":"16" }
  es.regexp.to-string { "edge":"16" }
  es.string.ends-with { "edge":"16" }
  es.string.includes { "edge":"16" }
  es.string.match { "edge":"16" }
  es.string.pad-end { "ios":"10.3", "safari":"10.1" }
  es.string.pad-start { "ios":"10.3", "safari":"10.1" }
  es.string.replace { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  es.string.search { "edge":"16" }
  es.string.split { "edge":"16" }
  es.string.starts-with { "edge":"16" }
  es.string.trim { "ios":"10.3", "safari":"10.1" }
  es.string.trim-end { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  es.string.trim-start { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  es.typed-array.float32-array { "ios":"10.3", "safari":"10.1" }
  es.typed-array.float64-array { "ios":"10.3", "safari":"10.1" }
  es.typed-array.int8-array { "ios":"10.3", "safari":"10.1" }
  es.typed-array.int16-array { "ios":"10.3", "safari":"10.1" }
  es.typed-array.int32-array { "ios":"10.3", "safari":"10.1" }
  es.typed-array.uint8-array { "ios":"10.3", "safari":"10.1" }
  es.typed-array.uint8-clamped-array { "ios":"10.3", "safari":"10.1" }
  es.typed-array.uint16-array { "ios":"10.3", "safari":"10.1" }
  es.typed-array.uint32-array { "ios":"10.3", "safari":"10.1" }
  es.typed-array.from { "ios":"10.3", "safari":"10.1" }
  es.typed-array.of { "ios":"10.3", "safari":"10.1" }
  es.typed-array.to-locale-string { "edge":"16" }
  esnext.aggregate-error { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.array.last-index { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.array.last-item { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.composite-key { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.composite-symbol { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.global-this { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.map.delete-all { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.map.every { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.map.filter { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.map.find { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.map.find-key { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.map.from { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.map.group-by { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.map.includes { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.map.key-by { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.map.key-of { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.map.map-keys { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.map.map-values { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.map.merge { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.map.of { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.map.reduce { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.map.some { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.map.update { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.math.clamp { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.math.deg-per-rad { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.math.degrees { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.math.fscale { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.math.iaddh { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.math.imulh { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.math.isubh { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.math.rad-per-deg { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.math.radians { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.math.scale { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.math.seeded-prng { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.math.signbit { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.math.umulh { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.number.from-string { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.observable { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.promise.all-settled { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.promise.any { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.promise.try { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.reflect.define-metadata { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.reflect.delete-metadata { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.reflect.get-metadata { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.reflect.get-metadata-keys { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.reflect.get-own-metadata { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.reflect.get-own-metadata-keys { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.reflect.has-metadata { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.reflect.has-own-metadata { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.reflect.metadata { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.set.add-all { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.set.delete-all { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.set.difference { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.set.every { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.set.filter { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.set.find { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.set.from { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.set.intersection { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.set.is-disjoint-from { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.set.is-subset-of { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.set.is-superset-of { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.set.join { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.set.map { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.set.of { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.set.reduce { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.set.some { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.set.symmetric-difference { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.set.union { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.string.at { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.string.code-points { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.string.match-all { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.string.replace-all { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.symbol.dispose { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.symbol.observable { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.symbol.pattern-match { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.weak-map.delete-all { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.weak-map.from { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.weak-map.of { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.weak-set.add-all { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.weak-set.delete-all { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.weak-set.from { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  esnext.weak-set.of { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  web.dom-collections.iterator { "android":"61", "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  web.immediate { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  web.queue-microtask { "android":"61", "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  web.url { "android":"61", "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  web.url.to-json { "android":"61", "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  web.url-search-params { "android":"61", "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }

That means, if you follow our planned module/nomodule strategy, the modern bundle will still ship Promise and TypedArrays.

Polyfilling just the typed-arrays and Promise is about 85KB:

// bundle and minify this file -> ~85kB
require("../../../../node_modules/core-js/modules/es.promise");
require("../../../../node_modules/core-js/modules/es.typed-array.float32-array");
require("../../../../node_modules/core-js/modules/es.typed-array.float64-array");
require("../../../../node_modules/core-js/modules/es.typed-array.int16-array");
require("../../../../node_modules/core-js/modules/es.typed-array.int32-array");
require("../../../../node_modules/core-js/modules/es.typed-array.int8-array");
require("../../../../node_modules/core-js/modules/es.typed-array.uint16-array");
require("../../../../node_modules/core-js/modules/es.typed-array.uint32-array");
require("../../../../node_modules/core-js/modules/es.typed-array.uint8-array");
require("../../../../node_modules/core-js/modules/es.typed-array.uint8-clamped-array");

AFAICT, typed-arrays are included either because 1) a bug in .toString in all versions of safari or 2) it is mistakenly not given a constraint for safari here

See the bottom of https://github.com/GoogleChrome/lighthouse/pull/10937#issuecomment-641744844 for why Promises are included.

Actions we can take:

  1. Do nothing, be ok with large polyfills in “modern” bundles
  2. Suggest excluding (via babel/preset-env exclude) type-arrays in the modern bundle, possibly also add a small polyfill to fix the toString issue (taking similar approach as babel/preset-modules and attempt to upstream to preset-env). Would be good to understand failure modes for this bug in older browsers.
  3. Suggest excluding Promise in the modern bundle. Again, maybe we can create a smaller polyfill to fix the thenable w/ error bug. (EDIT: actually this module would still get included, because other features like promise.finnaly, allSettled, etc pull in the promise module too …)

Related: https://github.com/GoogleChrome/web.dev/issues/3129 cc @housseindjirdeh Context: https://github.com/GoogleChrome/lighthouse/pull/10937#issuecomment-642320005

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
patrickhulcecommented, Jun 11, 2020

possibly also add a small polyfill to fix the toString issue (taking similar approach as babel/preset-modules and attempt to upstream to preset-env)

I think this is an awesome idea. Even if it’s 10x the time/effort on our part, getting the default module/nomodule build path to not pull in a polyfill for all typedarray behavior will have 100x the impact. 👍

0reactions
paulirishcommented, Jun 23, 2020

For LH pov, we start with heavily recommending @babel/preset-env + esmodules: true + bugfixes: true.

Ideally we can resolve the promises/typedarrays polyfilling from within the babel-preset-env bugfixes path. An alternative is recommending some exclude patterns, but it’s not guaranteed to be totally fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Smart Bundling: How To Serve Legacy Code Only To Legacy ...
To transpile our JavaScript in an environment-aware manner, we're going to use babel-preset-env . ... Enabling the useBuiltIns flag allows Babel ...
Read more >
Serve modern code to modern browsers for faster page loads
In this codelab, learn how to improve the performance of an application by minizming how much code is transpiled.
Read more >
Browser Compatibility | Vue CLI
If one of your dependencies need polyfills, you have a few options: ... config only for the legacy build, or only for the...
Read more >
Loading Polyfills Only When Needed - Philip Walton
New JavaScript and HTML features are being introduced all the time that make ... and in some cases I would absolutely recommend using...
Read more >
Building: Rollup - Open Web Components
Rollup configuration to help you get started building modern web applications. ... Optional separate build for legacy browsers; Loads polyfills using ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found