Skip to content
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

docs: Update the docParser to prevent max call stack errors [skip release] #2342

Merged
merged 8 commits into from
Sep 25, 2023

Conversation

NicholasBoll
Copy link
Member

@NicholasBoll NicholasBoll commented Sep 19, 2023

Summary

Sometimes the doc parser throws an `Maximum call stack exceeded" error. This happens when a type is self-referential, but not exported. Example:

type NestedType = string | number | { foo: NestedType }

If NestedType is referenced by an exported type, the doc parser will get into a recursive loop. This change adds symbol tracking per export to detect this case and will bail considering NestedType to be exported.

Release Category

Documentation


Checklist

  • Label ready for review has been added to PR

For the Reviewer

  • PR title is short and descriptive
  • PR summary describes the change (Fixes/Resolves linked correctly)

Where Should the Reviewer Start?

docParser.spec.ts

Areas for Feedback? (optional)

  • Code
  • Testing

@NicholasBoll NicholasBoll added the ready for review Code is ready for review label Sep 19, 2023
@NicholasBoll NicholasBoll changed the title docs: Update the docParser to prevent max call stack errors docs: Update the docParser to prevent max call stack errors [skip release] Sep 19, 2023
@@ -173,7 +173,7 @@ export const SymbolDialog = ({value}: SymbolDialogProps) => {
{breadcrumbsList.map((item, index) => {
return (
<>
{item === breadcrumbsList[breadcrumbsList.length - 1] ? (
{index === breadcrumbsList.length - 1 ? (
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change fixes where a breadcrumb item is the same string as the previous.

For example:

Some Item > Nested ItemNested ItemNestedItem

This fix corrects the breadcrumb to render like

Some Item > Nested Item > Nested Item > Nested Item

@cypress
Copy link

cypress bot commented Sep 19, 2023

1 flaky test on run #6194 ↗︎

0 941 2 0 Flakiness 1

Details:

Merge a0a0874 into bc7ee75...
Project: canvas-kit Commit: 7c3b1599af ℹ️
Status: Passed Duration: 08:03 💡
Started: Sep 21, 2023 5:55 PM Ended: Sep 21, 2023 6:03 PM
Flakiness  cypress/integration/Autocomplete.spec.ts • 1 flaky test

View Output Video

Test Artifacts
... > when a value is entered > when down arrow key is pressed > when the user presses the enter key > when the use hits the "2" key > should change the filtered results Output Screenshots Video

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

Copy link
Contributor

@RayRedGoose RayRedGoose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@jamesfan jamesfan added automerge and removed ready for review Code is ready for review labels Sep 20, 2023
@alanbsmith alanbsmith enabled auto-merge (squash) September 20, 2023 17:43
@alanbsmith alanbsmith disabled auto-merge September 21, 2023 17:50
@alanbsmith alanbsmith enabled auto-merge (squash) September 21, 2023 17:50
@alanbsmith alanbsmith merged commit 5ea37a8 into master Sep 25, 2023
11 checks passed
@alanbsmith alanbsmith deleted the docs/prevent-call-stack-errors branch September 25, 2023 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants