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

Update TypeScript #15826

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Update TypeScript #15826

wants to merge 1 commit into from

Conversation

ryantrem
Copy link
Member

One of my other PRs is failing in the build because the older version of TS we are using (5.1.6) is missing the states property from the ElementInternals WebAPI type (the states property and the its type CustomStateSet are sort of new but supported in all the major browsers). TypeScript 5.5+ has this property and type, so I started trying to update our TypeScript version. However I ran into some problems with deprecated TypeScript APIs used for the path transformation stuff in the build. I tried to fix it (based on some input from the TypeScript team!), but I definitely broke it. So I'm creating a draft PR as a starting point for getting TypeScript updated.

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 14, 2024

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 14, 2024

Reviewer - this PR has made changes to one or more package.json files.

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 14, 2024

@sebavan
Copy link
Member

sebavan commented Nov 14, 2024

Is ElementInternals support wide enough considering where the viewer might be used ?

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 14, 2024

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 14, 2024

@RaananW
Copy link
Member

RaananW commented Nov 15, 2024

Wer usually fix these first by adding them manually to the mixins file and then removing them when not needed. Using an API that only exists in a certain typescript version will also force our users to use this version. Otherwise, type check will fail.
I have no problem with updating the version (after making sure everything works as existed), but we have to support older versions as well.

@ryantrem
Copy link
Member Author

Is ElementInternals support wide enough considering where the viewer might be used ?

Yes I think it is ok.
ElementInternals is baseline 2023: https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals
CustomStateSet is baseline 2024: https://developer.mozilla.org/en-US/docs/Web/API/CustomStateSet

If they are missing in a browser, it will just mean annotation elements don't get a reduced opacity when not facing the camera.

@ryantrem
Copy link
Member Author

Wer usually fix these first by adding them manually to the mixins file and then removing them when not needed. Using an API that only exists in a certain typescript version will also force our users to use this version. Otherwise, type check will fail. I have no problem with updating the version (after making sure everything works as existed), but we have to support older versions as well.

I remembered this from one of our previous conversations :) In this case, it is only used as an implementation detail, it is not surfaced through the API at all, so it doesn't show up in the d.ts files. I believe that means it cannot impact consumers of the package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants