2 comments

[ 0.15 ms ] story [ 16.8 ms ] thread
Can someone tell if this has much/any practical significance? To me it seems to be a long pedantic discussion with little practical impact.

> import { a } from "./a"

Seems to be the issue, maybe something about missing an extension.

> Bearing this in mind, the last version of ES for which TypeScript was a superset would be ES5 (2009), before the introduction of ES modules.

This certainly matters to those writing ts -> js transpilers. As far as I care, it doesn't matter if the split happens at ES5 or ES2015 as long as the transpiled output works.

The fact that this detail is being raised seems like an indication of how well it conforms to being a superset, unlike CoffeeScript's "It's just JavaScript." assertion.

The issue is that, AFAIK, the ES import must include file extension. But imports in TS may not include it. And transpiler to JS didn't add some extension to the import, making it invalid in JS.

But I think that TS is still a superset of JS, even with this import thing.

Because every valid JS file is valid TS file. To me that seems to confirm to definition of superset:

   A set A1 is a superset of another set B1 if all elements of the set B1 are elements of the set A1.