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

[mdx-plugin-detect-imports] generate proper AST #36

Merged
merged 4 commits into from
Jul 22, 2022
Merged

Conversation

Ayc0
Copy link
Contributor

@Ayc0 Ayc0 commented Jul 22, 2022

Before we were high-jacking the Literal node to be able to pass down a piece of code that wasn't a literal but a line of code.

So the AST in the end was generating some working piece of JS, but the AST was wrong (and it could break other AST-based plugins)

As I also start to use estree-util-visit to offset the nodes, I had to move to full ESM, and I used a import() in a .cjs file for backward compatibility.

This makes so that the plugin becomes async and cannot be used anymore with compileSync, only the async compile.

@Ayc0 Ayc0 merged commit 5b97edb into main Jul 22, 2022
@Ayc0 Ayc0 deleted the task/36-proper-ast branch July 22, 2022 19:49
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