-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
#272 broke new TS 4.1+ typing features #291
Comments
Held back got and query-string because they moved to pure ESM and I'm still not sure how to get them working in our convoluted build. Had to switch to a fork of wouter for the time being, can switch back once molefrog/wouter#291 is fixed.
I did a simple experiment and sadly reversing the order didn't help. It worked for the main entry, but it broke types of the other files such as "typesVersions": {
">=4.1": {
"types/ts3.9.4/index.d.ts": [
"types/ts4.1/index.d.ts"
],
"use-location": [
"types/use-location.d.ts"
],
"matcher": [
"types/matcher.d.ts"
],
"static-location": [
"types/static-location.d.ts"
]
},
"<4.1": {
"use-location": [
"types/use-location.d.ts"
],
"matcher": [
"types/matcher.d.ts"
],
"static-location": [
"types/static-location.d.ts"
]
}
}, |
I definitely don't have the expertise there either :) This is the change I applied for the time being (which I assume is what you tested, but just making sure): Very possible that breaks other things of course, but it did fix my own project's build. Changing the wildcard to match less than a specific version seems sound to me, I see other projects doing that, but I don't get why that would differ from the wildcard in this case. |
I just ran into this issue as well! ➕ 1️⃣ |
Hey @vicero, I've published a test version with the fix applied |
@molefrog yes this works perfectly! Thank you! FWIW my project with issues is on Typescript 4.7.4 |
@vicero Great, I will include it in the next release along with some new features. |
The changes in #272 seem to break the new typing features (e.g. automatically extracting types from route strings). According to the TS docs on
typeVersions
:https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#multiple-fields
By moving
>=4.1
below a*
match string, the 4.1+ case will never be hit (even if no files inside the*
block are being looked for). Testing locally, reversing the order of these blocks makes things work on my machine again.This seems like a possibly simple fix (just reverse the order of these blocks, duplicate the content of the
*
block in the>=4.1
block as well), but as I'm not sure what issue this change was solving in the first place/how to test it, I don't really feel comfortable making that change myself.The text was updated successfully, but these errors were encountered: