-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Const enums in the TS Compiler API can make depending on typescript difficult #5219
Comments
Removing the "const" in post build seems reasonable. feel free to send a PR for this. |
Not sure whether this is related. As I mention in this comment there is a difference in Nightly build However It also shows that Is this intentional? |
On a related note, would it be possible to include the commit reference in the nightly builds to see exactly where they were cut? |
that sounds right, this is the LKG we use to bootstrap the compiler. we update it occasionally, but not regularly.
@DanielRosenwasser what can we do here to make this better? |
But that's exactly what I'm not seeing unless I'm missing something: Nightly build |
TypeScript performs a full build/test run ( |
So are you saying the committed If so, does it make sense to add a build step that ensures the committed
Sounds good to me. |
I'd prefer having two files:
The |
@myitcv the idea is that whatever is in the LKG folder is the last stable version of the compiler that's able to compile the compiler. It's purely for bootstrapping when necessary/convenient and for publishing. I don't think we necessarily need to add that to the build step. |
Should be fixed by #5422 |
At present, if I write a library which depends on typescript, I implicitly lock my consumers into using a typescript package version which has a
SyntaxKind
which matches the numbers which existed when I compiled my library, and failures resulting from a mismatch in runtime and compile-timeSyntaxKind
s only occur as unexpected runtime behavior (like a tslintno-null
rule triggering onif
statements). This behavior change may only even be noticed when the package is consumed and not when it's tested (since, frequently, you test with the same TS you build with).I would suppose that fixing this could require either considering changes to our API's const enums as semver breaking changes to make it easier on npm, or we should stop using const enums in our API, so the name-based references are retained in consumers' compiled output. Alternatively, we could continue to use const enums internally, but in our built
.d.ts
we report them all as normal enums (and we compile withpreserveConstEnums
, as we already do), so our consumers retain the references in their built code.The text was updated successfully, but these errors were encountered: