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

Code example generator [LG-2954, LG-2950, LG-2951] #259

Merged
merged 31 commits into from
Apr 25, 2023
Merged

Conversation

TheSonOfThomp
Copy link
Collaborator

@TheSonOfThomp TheSonOfThomp commented Apr 21, 2023

Traverses the rendered example component in the ReactTree to find the relevant component, then generates the JSX string from that component.

To Test:
Link this branch: mongodb/leafygreen-ui#1700
Rebuild packages (yarn build) and docs (yarn docs:tsdoc)

@TheSonOfThomp TheSonOfThomp changed the base branch from staging to live-example-decorators April 21, 2023 17:19
@TheSonOfThomp TheSonOfThomp requested a review from bruugey April 21, 2023 17:20
@TheSonOfThomp TheSonOfThomp changed the title Code example Code example [LG-2954, LG-2950, LG-2951] Apr 21, 2023
@TheSonOfThomp TheSonOfThomp changed the title Code example [LG-2954, LG-2950, LG-2951] Code example generator [LG-2954, LG-2950, LG-2951] Apr 21, 2023
@TheSonOfThomp TheSonOfThomp requested a review from spark33 April 21, 2023 17:25
let isRootSet = false;
let componentRoot: ReactElement<any> = renderedStory;

// @ts-expect-error - prepass callback args are incorrectly typed. Need to explicitly re-type them
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there an open issue on their side that we can reference here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

@TheSonOfThomp TheSonOfThomp Apr 21, 2023

Choose a reason for hiding this comment

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

Though the last commit to that repo was over a year ago, so no guarantees it gets in. I could try and find another library that does the same, but in my research, the other options were even more out-of-date.

(another option would be to port over the code and maintain it ourselves, but that doesn't feel right to me)

@TheSonOfThomp TheSonOfThomp marked this pull request as ready for review April 21, 2023 20:06
Base automatically changed from live-example-decorators to staging April 24, 2023 16:54
@TheSonOfThomp TheSonOfThomp requested a review from bruugey April 24, 2023 19:49
Copy link
Collaborator

@bruugey bruugey left a comment

Choose a reason for hiding this comment

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

Will approve once Table bug is addressed!

@TheSonOfThomp TheSonOfThomp merged commit 5002bd8 into staging Apr 25, 2023
@TheSonOfThomp TheSonOfThomp deleted the code-example branch April 25, 2023 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants