Blueprint: Remove es6-shim as a dependency for @blueprintjs/table

Created on 20 Jan 2017  路  10Comments  路  Source: palantir/blueprint

I'd like to propose removing es6-shim as a dependency for @blueprintjs/table.

Most modern desktop browsers are at the point where they cover everything that es6-shim covers, and the inclusion of a shim should be as the discretion of applications consuming @blueprintjs/table (if it's not necessary for an app's compat guarantees, all it does is contribute to an app's bundle size).

tooling P1 table breaking change

Most helpful comment

Ok, yeah, I'm down for this. Unfortunately it is a small breaking change, so we should wait until 2.0 (as Antoine indicated with the milestone).

All 10 comments

Ok, yeah, I'm down for this. Unfortunately it is a small breaking change, so we should wait until 2.0 (as Antoine indicated with the milestone).

Is ie11 ready for this???? There's no Promise, the Set and Map implementations are lacking, no Array.find/etc, and I don't think TS does downlevel emits for those does it?

@hellochar it's more of the application's responsibility to include the shim, not the library's.

We're effectively saying table is es6 only, correct? It just sounds like a pretty big decision; would we make it for core as well?

We're effectively saying table is es6 only, correct

No, we're not compiling to ESM modules (not yet anyway, and when we do with #309, it'll be _in addition_ to CommonJS modules). As @rcchen states, it's the application's responsibility to determine its runtime environment support and provide shims as necessary (maybe they only want to run in the latest Chrome browser and not include the cruft of es6-shim, that's up to them).

Ok fair. I'm still a little shaky on the details:

  1. Should we do the same thing for core?
  2. Which es6 features are we allowing? Just Set and Map? Do we enumerate the list of APIs we use in our install instructions?
  3. How do we get typings? Looks like --lib "ES2015.Collection" is what we want?

I guess I'm just not sure from this ticket alone what the original issue is, other than the abstract "it's not our responsibility".

@hellochar

  1. Sure, this would be a reasonable change to make for @blueprintjs/core 2.0.
  2. Yeah, I think we'll have to document all the ES6 features we rely on and don't shim. This goes in the browser compat section of the docs.
  3. Yes, "lib": ["dom", "es2015.collection"] in tsconfig.json is the right way to get typings.

The intent of original issue is to provide more flexibility to consuming applications. Making this change allows them to use the shim of their choosing (e.g. core-js is also very common) and reduce bundle size (we don't use all of es6-shim).

Just bumping this issue as we ran into this today. We removed es6-shim from our application because we didn't need it in our environment, but because we use blueprint-table, it still gets pulled in.

I concur that blueprint-table shouldn't automatically pull in the shim. However, it should be strongly documented that ES6 features are in use and that some shim is required if you want to run on older browsers.

Was this page helpful?
0 / 5 - 0 ratings