-
Notifications
You must be signed in to change notification settings - Fork 5
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
Integrate new metal/soyparser #11
Conversation
lib/pipelines/compileSoy.js
Outdated
} | ||
|
||
// Parse inner params | ||
template.params.forEach(extractParam); |
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.
@mthadley, could template.params
be null?
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.
@jbalsas Nope, you should be good here: https://github.com/metal/soyparser/blob/master/src/types.ts#L217 👍
lib/pipelines/compileSoy.js
Outdated
if (cmd.deltemplate) { | ||
|
||
parsed.body.forEach(function(template) { | ||
if (template.deltemplate) { |
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 this will always be false, since neither Template
or DelTemplate
have a deltemplate
field. If the intent is to skip these, you can check if template.type === 'DelTemplate'
.
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.
Makes sense, yeah, didn't think about it. Will update it and add a test for it, thanks!
lib/pipelines/compileSoy.js
Outdated
return; | ||
} | ||
|
||
var templateName = cmd.name; | ||
var templateName = template.id.name; |
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.
Just be aware that this will only be something like .render
, and namespace
is a separate attribute on id
.
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.
True... I'll double check to see what were we getting before. Thanks!
Hey @mthadley, I've added a test for the Could you please take a final look? Thanks! |
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.
@jbalsas LGTM
Merged, thanks @mthadley! |
This PR updates support to use the newer metal/soyparser