wails
wails copied to clipboard
Wails / Frontend: Consider making built TS types any if not found / visible
Is your feature request related to a problem? Please describe.
Okay, so this is kinda confusing but it's a real issue. Types like that are not available are still attempted to be converted with missing import for the types.
Describe the solution you'd like
One solution I would like if the wailsJS compiler/builder can not find that type just convert it, by default to the 'any' or 'unknown' reserved type in typescript. It would make building on GitHub actions more simplified since I don't have to overwrite pre-generated files anymore.
Describe alternatives you've considered
NA
Additional context
No response
This is probably a regression due to: https://github.com/wailsapp/wails/issues/1721 - Could you please make a test for your scenario in v2/internal/binding/generate_test.go that exposes the bug, then we can fix it 👍
Yes, I can. And just for some real quick feedback. I expose a function (Not intentionally) of "FindRelations" which returns: *map[int64]mocks.PublicUser, *int64, error
When this file is generated on TS it tries to import from mocks map[int64] neither of which "map", nor "int64" exists on mocks. (Which it shouldn't exist) This is normally not a problem in development. But, vue-tsc forces typescript to compile with non-broken types. Which, causes these sorts of issues. I will generate a test ASAP!
And to add more to this (while I'm not proficient with this language at all) it may be possible to have a TS lookup table for Golang types? Sounds... complicated.. and scary, but I'm not sure how else you'd detect something like this!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@brys0 - Feels like there's more to do with this. Were you going to make the test to highlight the issue?