Skip to content

State of targeting browers #3774

Closed
Closed
@Timer

Description

@Timer

I think we've all agreed targeting browsers would be an acceptable configuration. For 2.0, we tried giving this a shot -- here's the current state:

Parsing target browsers (#3644)

This change told our build pipeline to start looking for browserslist configuration.

When this was merged, the only real effect it had was CSS prefixing. It was not a complete implementation.
Our Babel configuration was still locked down to ES5.

Concerns

  1. Speed: what effect does this have on build time? Previously, we fed the configuration that now needs to be found (potentially found thousands of times depending on the build pipeline plugin efficiency)
  2. Configuration hell: We wanted to support browserslist in package.json, but we now support 5 means of configuration. I think we need to lock this down.
  3. What happens when nothing is specified? I'm not sure if we align with the browserslist default.

Minifying code ES6+

We know we want to support the latest syntax, so we merged #3618 -- this PR switched us from uglify-js to uglify-es under the hood, which supports new syntax.

Concerns

  1. This now lets node_modules with bad syntax leak into the build without being checked.
  2. Specify JavaScript version for Uglify #3743 tried to solve this but upon further digging, the option is used twice in uglify-es and does not actually limit syntax support in any way.

Outputting ES6+ code

Since #3644 didn't affect our compilation process, #3770 was merged.

#3770 removes our forced IE9/Uglify compatibility and instead lets @babel/preset-env use its new behavior of identifiying browser support via browserslist.

Concerns are shared with above:

  1. Speed -- what kind of performance hits are we going to see?
  2. Configuration hell (see above).
  3. node_module validity
  4. Defaults when nothing is specified?

Compiling node_modules

Yet to be solved.

Concerns

  1. Not all packages specify an engines field

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions