Skip to content
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

[heft-typescript-plugin] feat: support typescript 5.6 #4972

Merged

Conversation

UberMouse
Copy link
Contributor

@UberMouse UberMouse commented Oct 13, 2024

Summary

Updates the heft typescript plugin for breaking changes made to the typescript internals that the plugin relies on

Details

The breakage was caused by an internal change of BuilderProgram.getState() to BuilderProgram.state in this commit.

Changing the code to use .state instead of .getState() if state is defined was the only change required

Fixes #4921

How it was tested

Linked into our monorepo and a full build of all packages was done
Then everything was started in watch mode and a webpack based package was started up to verify that watch mode changes are still picked up correctly

Our monorepo does not use heft for linting so I haven't tested if this change still works correctly with the heft lint plugin

Impacted documentation

@UberMouse UberMouse force-pushed the heft-typescript-plugin-typescript-56-support branch from 0e630d6 to 30caeba Compare October 13, 2024 22:44
@UberMouse
Copy link
Contributor Author

Hmm, seems obvious now but the CI doesn't work because the change only functions when tested against a typescript 5.6 based compiler but rushstack repo is on an older typescript version 🤷

Anyway, I'll leave this here as an example

@UberMouse UberMouse marked this pull request as draft October 13, 2024 22:55
@UberMouse UberMouse force-pushed the heft-typescript-plugin-typescript-56-support branch from 30caeba to a8d78bc Compare October 14, 2024 20:03
@UberMouse UberMouse marked this pull request as ready for review October 14, 2024 20:04
@UberMouse UberMouse force-pushed the heft-typescript-plugin-typescript-56-support branch from a8d78bc to 29b45e4 Compare October 14, 2024 20:07
Copy link
Contributor

@dmichon-msft dmichon-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should also update the "newest compatible version" constants here:

const NEWEST_SUPPORTED_TS_MAJOR_VERSION: number = 5;
const NEWEST_SUPPORTED_TS_MINOR_VERSION: number = 4;

Assuming this works with 5.5 and 5.6

This is a breaking change and will not work on Typescript versions < 5.6
@UberMouse UberMouse force-pushed the heft-typescript-plugin-typescript-56-support branch from 29b45e4 to aca28b9 Compare October 15, 2024 01:03
@UberMouse
Copy link
Contributor Author

Updated

@D4N14L D4N14L merged commit 8e9a51e into microsoft:main Oct 15, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

[heft] typescript plugin does not work with Typescript 5.6.2
5 participants