-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Fix a bunch of bugs with APIDocs system #99589
Fix a bunch of bugs with APIDocs system #99589
Conversation
…05-06-fix-sucky-react-types
…05-06-fix-sucky-react-types
That hack is nasty, but I assume you've delved into the other ways that might allow us to understand from the AST node that we should drop or ignore some nodes from the tree before printing the signature instead of effectively find/replacing the specific string that's annoying us. If you think there still might be a chance that we could use the AST for this I'd be happy to take a look, but I'd probably need a few minutes of your time to setup and explore a few things to understand exactly what we're working with rather than spending hours getting up to speed. I assume this won't address any of the non-deterministic "References to deprecated APIs" metrics? |
Very nasty. Any other hack, that I can think of, would still be a hack, and require a lot more complicated code. I wanted it to be fixed naturally, using the system itself, but I don't think that's possible. Given the system is still experimental and we're in the "prove value" phase, I went with the very quick, very small amount of code, and yes, very nasty hack.
I'd love to get a second pair of eyes on it! I'm happy to pair program with you on it, to help get you up to speed. I'll look to set something up on the cal. To unblock this PR on that, would you prefer I remove that code, or merge it and then we try to improve it in another PR?
No, @brianseeders started looking into that before GAH week. The suspicion is that master ci runs operations in a different order than PR ci, which caused different numbers. The numbers seemed to be the same for every PR. The benchmark numbers were always different than the number in the PR ci run. The numbers were deterministic, just deterministically always different. |
…05-06-fix-sucky-react-types
💚 Build SucceededMetrics [docs]Public APIs missing comments
Any counts in public APIs
Public APIs missing exports
Unknown metric groupsAPI count
References to deprecated APIs
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm on board with unblocking and taking a look with you next week!
💔 Backport failed
To backport manually run: |
* Remove custom code, add in a hack * remove artifical limit * Fix arrow functions in interfaces not having children * Update docs * Update api docs after merge from master * update api docs after merge from master * update api docs # Conflicts: # api_docs/core.json # api_docs/data.json # api_docs/data_index_patterns.json # api_docs/deprecations.mdx # api_docs/features.json # api_docs/licensing.json # api_docs/reporting.json # api_docs/spaces.json
* Remove custom code, add in a hack * remove artifical limit * Fix arrow functions in interfaces not having children * Update docs * Update api docs after merge from master * update api docs after merge from master * update api docs # Conflicts: # api_docs/core.json # api_docs/data.json # api_docs/data_index_patterns.json # api_docs/deprecations.mdx # api_docs/features.json # api_docs/licensing.json # api_docs/reporting.json # api_docs/spaces.json
* Remove custom code, add in a hack * remove artifical limit * Fix arrow functions in interfaces not having children * Update docs * Update api docs after merge from master * update api docs after merge from master * update api docs
Partially fix #99586.
Unfortunately it looks like the only way to fix this is with a hack, because of the way the Typescript Compiler typeToString function works.
Before
After
Fix #99585
The fix required special handling for Type Aliases that don't have initializers, but still have call signatures. Tests added for coverage.
You can see the fix in the above two screenshots. In the second one,
props
is a child.Fix #99588
Found a way to use
TypeFormatFlags
to remove a whole bunch of custom code that tried to patch the links together. Unfortunately, if a type alias is referenced that uses something likeReturnType
ortypeof
, the entire type is expanded, and this ends up looking pretty ugly. The fix for that is to use explicit interfaces more instead.Before
After
Removed an artificial limit on the signature.
I must have accidentally left that in to debug a ninfinite loop