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

[ALOY-1646] Add support for platform specific namespaces for xml attributes #922

Merged
merged 8 commits into from Mar 29, 2019

Conversation

brentonhouse
Copy link
Contributor

No description provided.

Copy link
Contributor

@ewanharris ewanharris left a 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, ':'));
Copy link
Contributor

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.

@build
Copy link

build commented Mar 28, 2019

Warnings
⚠️

Please ensure to add a changelog entry for your changes. Edit the CHANGELOG.md file and add your change under the Unreleased items header

Messages
📖

✅ All tests are passing
Nice one! All 3470 tests are passing.

Generated by 🚫 dangerJS against 54c5a26

Copy link
Contributor

@ewanharris ewanharris left a 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

Alloy/commands/compile/compilerUtils.js Outdated Show resolved Hide resolved
Co-Authored-By: brentonhouse <brenton.house@gmail.com>
Copy link
Contributor

@ewanharris ewanharris left a 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!

@ewanharris ewanharris merged commit 5fdc44c into tidev:master Mar 29, 2019
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

3 participants