wails icon indicating copy to clipboard operation
wails copied to clipboard

Wails / Frontend: Consider making built TS types any if not found / visible

Open brys0 opened this issue 3 years ago • 3 comments

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

brys0 avatar Aug 31 '22 16:08 brys0

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 👍

leaanthony avatar Aug 31 '22 21:08 leaanthony

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!

brys0 avatar Aug 31 '22 22:08 brys0

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!

brys0 avatar Aug 31 '22 22:08 brys0

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.

stale[bot] avatar Nov 02 '22 02:11 stale[bot]

@brys0 - Feels like there's more to do with this. Were you going to make the test to highlight the issue?

leaanthony avatar Nov 02 '22 08:11 leaanthony