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
[ALOY-1646] Add support for platform specific namespaces for xml attributes #922
Conversation
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 should be done in the initial pass rather than at the end.
Also, should we log any warnings if the platform restriction is nonsensical? For example if I have a platform restriction attribute alongside an attribute that has already been defined?
@@ -53,6 +53,17 @@ function parse(node, state, args) { | |||
args.symbol = CU.generateUniqueId(); | |||
} | |||
|
|||
// find platform specific attributes | |||
var platformAttributes = _.filter(_.keys(args.createArgs), key => _.includes(key, ':')); |
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.
Rather than looping through all the keys again in this file, I think it would be better to do this in the initial pass in compilerUtils.getParserArgs. Filtering out any args that aren't for the platform and removing the platform prefix from the attribute.
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.
Looking good! Just one comment about ensuring that the suspected platform is a valid platform
Co-Authored-By: brentonhouse <brenton.house@gmail.com>
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.
This looks good to me! Thanks @brentonhouse!
No description provided.