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

Update to 1.0.0-beta.4 #13

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

JonahPlusPlus
Copy link
Collaborator

@JonahPlusPlus JonahPlusPlus commented Nov 5, 2024

This will fix:

A little bit on how code snippet generation will work after this PR:

SolidJS doesn't have a VDOM to get info on components and their children and handlers and whatnot.
So instead, I've opted for extracting the source code of stories and transforming them into JSX.
To do this, I'm using the source code taken from csf-tools and running Babel's standalone parser on it to get an AST.
The AST is then transformed, and then Babel's standalone generator turns it back into JS.
What is returned is some JSX with some basic formatting.

(I've messed around with different parsers (acorn, babel, @typescript-eslint/typescript-estree, typescript) and even formatters (prettier, biomejs), and this is what worked best while not being too expensive)

@JonahPlusPlus JonahPlusPlus marked this pull request as ready for review November 7, 2024 00:58
@JonahPlusPlus JonahPlusPlus marked this pull request as draft November 7, 2024 01:06
@JonahPlusPlus JonahPlusPlus marked this pull request as ready for review November 7, 2024 01:11
@JonahPlusPlus JonahPlusPlus marked this pull request as draft November 7, 2024 01:12
@JonahPlusPlus JonahPlusPlus marked this pull request as ready for review November 7, 2024 01:14
@JonahPlusPlus
Copy link
Collaborator Author

Okay, ready to merge (I had a brain fart remembering if I parsed the component names correctly lol)

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.

1 participant