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 hooks to allow user to manipulate asts #12

Closed
wants to merge 2 commits into from
Closed

add hooks to allow user to manipulate asts #12

wants to merge 2 commits into from

Conversation

Chun-Yang
Copy link
Contributor

This is more of a suggestion instead of a PR.

@roman01la We want to extend the function of this component and do something like this:

<C1 data-props-users="users">
  <C2 data-props-user="users">
  <C2 data-props-user="users">
  <C2 data-props-user="users">
</C1>
// CONVERT TO
<C1>
  {
    this.props.users.map(
      function(user){ return <C2 user={user}> }
    )
  }
</C1>

Or something like this

<C1>
   user's name is <span data-value="user.name">John</span>,
   he has a car named <span data-value="car.name">Toyota</span>
</C1>
// CONVERT TO
<C1>
   user's name is <span>{this.props.user.name}</span>,
   he has a car named <span>{this.props.car.name}</span>
</C1>

There are several solutions for us:

  1. fork you repo and do PRs.
  2. extend your repo a little bit to allow users to hook into their own functionality into the conversion flow.

I am trying to do the second one. What do you think is the best?

BTW, thank you for your awesome package!

@roman01la
Copy link
Owner

Hello! I think this is a great idea. I do want to implement these kind of transformations, but it doesn't seem like a good idea to have them in the core library. So a simple plugins system would be very cool. Your contribution is very welcomed!

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.

None yet

2 participants