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

Add `@babel/template`-like package #369

Open
fengzilong opened this issue Oct 28, 2019 · 5 comments
Open

Add `@babel/template`-like package #369

fengzilong opened this issue Oct 28, 2019 · 5 comments

Comments

@fengzilong
Copy link

@fengzilong fengzilong commented Oct 28, 2019

Write the builders syntax by hand is really tedious, can we provide some package like @babel/template or add an online playground to convert the code to builders syntax. It will save us tons of time

@rajasegar-c

This comment has been minimized.

Copy link

@rajasegar-c rajasegar-c commented Nov 15, 2019

@fengzilong Actually I am working on one playground to build AST nodes through code for jscodeshift and Glimmer templates here.
https://rajasegar.github.io/ast-builder/
Please let me know this is what you are looking for. Appreciate any PRs or issues.
And thanks for the @babel/template pointer btw.
For this project, let's hear from @benjamn

@fengzilong

This comment has been minimized.

Copy link
Author

@fengzilong fengzilong commented Nov 18, 2019

Yeah, good job, that's the playground I need, but there are some issues with yours

try this snippet

module.exports = {
  components: {
    'demo': demo
  }
}

the 'demo' becomes j.identifier('undefined')

and it seems not to be usable with es6 export syntax

some suggestion: it will be much better if we can format the code with prettier

thanks for reply @rajasegar-c

@rajasegar

This comment has been minimized.

Copy link

@rajasegar rajasegar commented Dec 6, 2019

@fengzilong Thanks for trying it out and reporting the issues. It's a bug I need to fix and yes formatting needs some work.

rajasegar added a commit to rajasegar/ast-node-builder that referenced this issue Dec 6, 2019
@rajasegar

This comment has been minimized.

Copy link

@rajasegar rajasegar commented Dec 7, 2019

Can you give me an example for the ES6 export you were trying, have you tried changing the parser to babel or babylon?
Fixed the module.exports and formatting

@fengzilong

This comment has been minimized.

Copy link
Author

@fengzilong fengzilong commented Dec 16, 2019

@rajasegar sorry for my late reply, I just see the notification from github. I tried and ES6 export has been fixed, and formatting works perfectly👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.