3 ms·
I wonder if there's a guide of recommendations about typescript now deprecated features, and its modern equivalents.
by leidenfrost 2y ago
I wonder if there's a guide of recommendations about typescript now deprecated features, and its modern equivalents.
- msoad 2y agoYeah they should deprecate namespaces and enums in the next major version... oh wait... TypeScript versioning is literally a joke
- cap11235 2y agoIt's js devs, what do you expect
- Dylan16807 2y agoWhat are you implying with "oh wait"? They have major versions every once in a while, and breaking changes. They could do that.
- silverwind 2y agoThey are not doing Semver. They are just counting two number, e.g. after 4.9 there is 5.0. Afaik, every version can contain breaking changing.
- Dylan16807 2y agoDoes that mean I'm supposed to interpret "... oh wait..." as "it would be very easy for them to deprecate a feature because they have lots of sufficiently major releases"? Because it comes across as implying they wouldn't be able to do it. I really don't understand what GP's point was.
- msoad 2y agoI'm not trying to be cheeky here. They have literally joked about how TypeScript versions means nothing really. So they can't just announce a new major version and drop enums completely. Maybe with a feature flag this is possible but even then, a fresh tsc --init not supporting enums is not really how TypeScript works
- Dylan16807 2y agoBut they do break things and drop things. I don't see why they can't do that. I think they simply don't want to remove it very badly.
- WorldMaker 2y agoGiven Typescript has preferred opt-in strictness flags for its recommendations, the two big places that seem to be Typescript's best documentation of "deprecated" features seems to be: 1) verbatimModuleSyntax -- https://www.typescriptlang.org/tsconfig/#verbatimModuleSyntax https://www.typescriptlang.org/tsconfig/#verbatimModuleSynta... 2) isolatedModules -- https://www.typescriptlang.org/tsconfig/#isolatedModules https://www.typescriptlang.org/tsconfig/#isolatedModules Between the two of those flags, enums and namespaces and a few other things get disabled. The flag documentation doesn't explain what the modern equivalents are, though. I suppose that's currently left to blog posts like the one linked here.
- inbx0 2y agoisolatedModules doesn't disable enums in general, only exported const enums (which are arguably the most useful form of enums).