-
Notifications
You must be signed in to change notification settings - Fork 759
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
Make generator es6 and ts usable at same time #1299
Conversation
1a0da7b
to
c1791e6
Compare
<%= file_header %> | ||
interface I<%= component_name %>Props { | ||
<% if attributes.size > 0 -%> | ||
<% attributes.each do | attribute | -%> | ||
<% if attribute[:union] -%> | ||
<%= attribute[:name].camelize(:lower) %>: <%= attribute[:name].titleize %>; | ||
<% else -%> | ||
<%= attribute[:name].camelize(:lower) %>: <%= attribute[:type] %>; | ||
<% end -%> | ||
<% end -%> | ||
<% end -%> | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think It would be good to use indentation here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahangarha
Do you mean this?
interface I<%= component_name %>Props {
<% if attributes.size > 0 -%>
<% attributes.each do | attribute | -%>
<% if attribute[:union] -%>
<%= attribute[:name].camelize(:lower) %>: <%= attribute[:name].titleize %>;
<% else -%>
<%= attribute[:name].camelize(:lower) %>: <%= attribute[:type] %>;
<% end -%>
<% end -%>
<% end -%>
}
But All <%
in template have no indentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can say the indentations there are not ideal. Better to make a little improvement in each PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahangarha
OK. I have tried fixing indentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it can still be improved, but also the issue is beyond the changes in this particular PR.
So, I don't want to block the PR for this specific reason.
@Judahmeek If there is no other issue except this one, I think we are good to move forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ippachi Please resolve @ahangarha's comment & also please rebase to address the Changelog conflict.
c1791e6
to
961c793
Compare
Thank you @ippachi for your contribution. |
Summary
Thank you for great integration rails and react. I use react-rails recently and I notice that I can't use
--ts
and--es6
same time. What about making these two available at the same time?Other Information
This is actual generated file
rails g react:component HelloWorld greeting:string --ts --es6
Pull Request checklist
Update documentation