microsoft / tslib

Runtime library for TypeScript helpers.
BSD Zero Clause License
1.26k stars 128 forks source link

Update __spreadArray helper #151

Closed rbuckton closed 3 years ago

rbuckton commented 3 years ago

Updates the __spreadArray helper to align with https://github.com/microsoft/TypeScript/pull/44527

rbuckton commented 3 years ago

Can someone review please? We would need to ship an updated tslib before I can merge https://github.com/microsoft/TypeScript/pull/44527, since using a nightly with --importHelpers would result in a checker error until an updated tslib is available.

rbuckton commented 3 years ago

@DanielRosenwasser can you let me know when this is published? As far as versioning is concerned, this is a backwards compatible change (the only slight difference would be for [1, , 2, ...[3]], which we would have incorrectly turned into [1, undefined, 2, 3] anways).

DanielRosenwasser commented 3 years ago

@rbuckton it sounds like for any existing user (ignoring people manually writing out weird references to tslib), this is backwards-compatible. Otherwise, it's just enabling TypeScript 4.4 to make a breaking change. Is that accurate?

DanielRosenwasser commented 3 years ago

I'm going to version this as 2.3.0.

rbuckton commented 3 years ago

Its not even a breaking change. TS 4.4 would work with old tslib, but would be slower and have the older incorrect array-packing behavior, and TS 4.3 will work with the new tslib and likely be faster but mostly maintaining the older incorrect array-packing behavior.

DanielRosenwasser commented 3 years ago

2.3.0 should be available shortly.

https://github.com/microsoft/tslib/releases/tag/2.3.0