-
Notifications
You must be signed in to change notification settings - Fork 62
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
Type issues since >= 2.12.0 #797
Comments
As reported by @mtorregrosa in #795 (comment):
and
cc: @Verdant31 |
With Typebox, `Static` is used to infer types from schema, however, `StaticDecode` is needed for Transform types which have a `Decode()` function. This is important also for schemas composed of other schemas that make use of transform types. We already use `StaticDecode` in `validateAndCoerceTypes()` which is the most important place and filters down to regular use of the library. But now that we are exporting all types again (per previous commit), this is important to make sure that users who are importing types directly get the correct type. And I think solved some edge cases where certain types will still coming through incorrectly. cc: @eddie-atkinson
* chart: Remove no-longer necessary @ts-expect-error * options: Return a new tranformed object with correct types rather than mutating in place. cc: @eddie-atkinson
## [2.12.3](v2.12.2...v2.12.3) (2024-09-18) ### Bug Fixes * **chart,options:** fix types after last commit ([#797](#797)) ([27150e6](27150e6)) * **historical:** add missing types, colocate types with schema ([#797](#797)) ([5ca349e](5ca349e)) * **types:** use StaticDecode vs Static to infer types ([#797](#797)) ([696baf6](696baf6))
@mtorregrosa, thanks for your help and patience. Can you see if 2.12.13 fixes these final issues for you? |
Thanks for the fixes in version 2.12.3:
New compilation problem found in version 2.12.3:
|
Thanks for all your time with this, @mtorregrosa! I do understand it's a pain but the whole community is benefiting from your help 😅 Umm, regarding your latest report... I think a few things might be going on here:
Does that make sense? What do you think? |
Yes. You are right. The types are ok. My code was wrong, but compiler does not detected it in previous versions. Now I've changed my code in accordance with the correct types. Thanks. Another issue I've detected: Once compiled, if I run my code, I get execution errors related with the following query: yahooFinance.historical(symbol, { events: 'dividends', period1: ..., interval: '1d' }) I get the following dividends in the result: [ The problem is with the field date, that should be of type Date, in accordance with type HistoricalDividendsResult (as it was in version 2.11.3). |
@mtorregrosa, big thanks again for all this back and forth. Really appreciate it.
Absolutely right, again. This was a mistake in my convenience mapping from And thanks re the feedback from the older release that didn't catch those issues are compile time, great that the new architecture catches these better. |
Now, with version 2.12.4, it all seems to be ok for me. The software is compiled without errors and running ok. Thank you very much. |
Thank you so much, @mtorregrosa! Appreciate all the help. 🙏 |
I seem to be missing a few types I've used in my code:
|
Ooh, thanks, @Yhprum... somehow I missed the This is fixed now and will be in the next release (which will probably come after I get through your other issues... thanks for those too!). |
# [2.13.0](v2.12.5...v2.13.0) (2024-09-29) ### Bug Fixes * **options:** re-export missing types ([#797](#797)) ([e96395f](e96395f)) * **setGlobalConfig:** cookieJar prop should be optional (fixes [#809](#809)) ([7e524fc](7e524fc)) ### Features * **quote:** export `QuoteField` type ([#808](#808)) ([a1f07d7](a1f07d7))
Out in 2.13.0. |
I've just discovered another runtime issue that seems to be related with type validation of the response for request
with symbols including 'BTC-EUR' (Bitcoin EUR). When I try this, I get the error errors: [ |
Previous comment is for version 2.13.0 |
Hey there,
Any idea how to handle this ? (If I can lift some weight off your shoulders by fixing something on my end) |
## [2.13.1](v2.13.0...v2.13.1) (2024-10-02) ### Bug Fixes * **quoteSummary:** re-add missing modules except insiderHolders ([#797](#797)) ([d862806](d862806))
Thanks for the report! Looking into this. I think it relates to #807 even though it's response validation. Do you get the same issue without specifying
Right you are. Not sure how this slipped through. Re-added |
I've just tested that the query
always works fine for me, but the query
fires validation error only if symbols include 'BTC-EUR', as stated previously. |
Gotcha; thanks, @mtorregrosa 🙏 Glad you have a temporary work around so I have a bit more time to handle this properly. Have a great weekend! |
Hey @eddie-atkinson, moving the typebox part of our chat from #826 to here: As you say, there were a few small things that were easily fixed. And the DX is significantly better. Unfortunately there are some other issues which haven't been as easy:
The big question is: How much time would you potentially have to look into this now? `:) (that's an honest question, not a hint :) i.e. depending on your time and passion for this) My other thought / option is that, with a lot of other changes coming in, we could possibly revert the typebox stuff, publish a final release for this major version, and integrate it into the next major release, which I want to start working on in the dev branch. But we should see how much work is involved in fixing things first. One other issue is:
Thanks as usual for all your help and input on these matters. |
In 2.12.0, our new validation code landed. Although all tests were passing for functionality, we don't have any tests for the structure of typescript exports. This could result in compile errors or mismatched types for typescript users. We apologise for that. We believe most of these issues have either been fixed or are in the process of being fixed, and we'll leave this issue up for discoverability.
We know this is a pain and inconvenience, but was part of a big internal restructuring which greatly eases development and opens the way to non-node runtimes. So, we really thank the early adopters among you who took the time to provide feedback and help us iron out the final issues.
The text was updated successfully, but these errors were encountered: