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

Built-in support for yearly baseline #2

Open
jkrems opened this issue Aug 12, 2019 · 4 comments
Open

Built-in support for yearly baseline #2

jkrems opened this issue Aug 12, 2019 · 4 comments

Comments

@jkrems
Copy link

jkrems commented Aug 12, 2019

One thing that has been suggested in the past is to provide builds for certain feature sets by year. E.g. closure compiler's --browser-featureset-year or the srcset attribute suggested by @mathiasbynens. Maybe something like featuresetXXXX could be added as a built-in? The definition would be tricky admittedly since it requires ongoing work at the beginning of each year.

@jkrems
Copy link
Author

jkrems commented Aug 12, 2019

Example usage may look like this:

{
  "exports": {
    ".": [
      {
        "featureset2019": {
          "browser": "./dist/browser-modern.js",
          "main": "./dist/node-modern.js"
        }
      },
      {
        "browser": "./dist/browser-es5.js",
        "main": "./dist/node-es5.js"
      }
      "./dist/es5-mega-bundle.js"
    ]
  }
}

@mathiasbynens
Copy link

The definition would be tricky admittedly since it requires ongoing work at the beginning of each year.

For Closure Compiler, we've decided to keep the definition as simple as possible. On January 1st of each year, we note down the latest stable versions of the following browsers:

  • Chrome
  • Edge
  • Firefox
  • Safari
  • iOS Safari
  • (each bundler could make up their own list of special-cased browsers, although alignment would be ideal)

Features that are supported in all those browsers become part of the feature set of that year.

cc @concavelenz

@jkrems
Copy link
Author

jkrems commented Aug 13, 2019

To clarify, the tricky part is "who has the definite list of what featureset 2020 contains" because each bundler / compiler / runtime doing their own data gathering on Jan 1st each year seems error prone. Not unsurmountable but adds an unknown. So basically your parenthetical "alignment would be ideal". I still think it's super valuable to have and assuming it's independent of "browser", it could be used for node as well, even though it would require node to define its own [language] feature set in terms of browser features.

@guybedford
Copy link
Owner

guybedford commented Aug 14, 2019

This is exactly the sort of reason to try and build a central location for this information and the meanings of these definitions to try to get alignment between tools.

It is yet to be seen if it will be possible though, or if this proposal is the right approach, but it seems like it can only be beneficial to try.

To try to better work out how to go about getting alignment on these definitions, I've started a thread in #7 around the process there.

The proposed target definitions discussed here entirely seem to fit the requirements though to me!

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

No branches or pull requests

3 participants