Skip to content

Conversation

vladimir-kotikov
Copy link
Member

Draft implementation of Unified Platform API for cordova, that inspired by this thread in cordova-dev mailing list and this proposal

Vladimir Kotikov added 4 commits May 25, 2015 17:32
`platforms` property now returns array of platforms APIs
* Renames common methods' names to be more JS-y
* Provides mapping from old names -> new ones to smooth transition
* Moves compat-related functionality to separate section
* Adds more comments for better understanding
value: new ParserHelper(this.platform),
enumerable: true,
configurable: false,
writable: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The writeable/configurable:false, has the tendency to interfere with jasmine spies which causes our tests to fail with very obscure error messages. Just in case you encounter such errors, otherwise I'm all for leaving this as false.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can always change behavior of parser if we'll have any problems later so i would prefer to leave it as-is.

@kamrik
Copy link
Contributor

kamrik commented May 26, 2015

Looks great!
Looks like figuring out the tests will be pretty difficult. But it might be worth it just throwing away some of the older tests that rely on a lot of mocks/spies.

PlatformHandler.prototype.updateWww = function() {
var projectRoot = util.isCordova(this.root);
var appWww = util.projectWww(projectRoot);
var platformWww = path.join(this.root, 'platform_www');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we would like to avoid using util.isCordova() here. One can easily create single platform projects that do not maintain the traditional Cordova Project directory structure. Kind of like it was with plugman based workflow or with my latests attempts at the gulp based workflow.

Myabe just pass the appWww as a parameter to this function, and for now as a compatibility feature, get it from util.isCordova() if it's not provided.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@vladimir-kotikov
Copy link
Member Author

Yeah, reworking tests will be painful.
BTW, i'm still wondering that so small number of tests is became failing.

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.

2 participants