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

[TIMOB-24027] Provide migration help for new properties (2_0_X) #92

Merged
merged 4 commits into from Oct 17, 2016

Conversation

janvennemann
Copy link
Contributor

JIRA: https://jira.appcelerator.org/browse/TIMOB-24027

Show migration instructions for the changes introduced in #82 and try to fix most of them automatically during build phase so the existing code won't crash.

@@ -71,6 +71,7 @@ function HyperloopiOSBuilder(logger, config, cli, appc, hyperloopConfig, builder
this.nativeModules = {};
this.buildSettings = {};
this.headers = null;
this.needMigration = {};
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer needsMigration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

needsMigration would infer that this variable contains a single value, but it actually contains all methods that need migration so i left it at needMigration.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree, makes sense.

that.logger.error('!!! CODE MIGRATION REQUIRED !!!');
that.logger.error();
that.logger.error('Due to changes introduced in iOS 10 and Hyperloop 2.0.0 some method calls need');
that.logger.error('to be changed to property access. It seems like you used some of the affected');
Copy link
Contributor

Choose a reason for hiding this comment

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

to be changed to property access. => to be changed regarding the access of properties.

that.logger.error('to be changed to property access. It seems like you used some of the affected');
that.logger.error('methods.');
that.logger.error();
that.logger.error('We tried to fix most of these automatically during our Copy Resources build step.');
Copy link
Contributor

Choose a reason for hiding this comment

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

during our Copy Resources build step. => during compile time. (They don't know about our build phases :-)

that.logger.error('methods.');
that.logger.error();
that.logger.error('We tried to fix most of these automatically during our Copy Resources build step.');
that.logger.error('However, we did not touch your original source files. Please see the list bellow');
Copy link
Contributor

Choose a reason for hiding this comment

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

bellow => below. bellow means brüllen in german btw :-)

that.logger.error('However, we did not touch your original source files. Please see the list bellow');
that.logger.error('to help you migrate your code.');
that.logger.error();
that.logger.error('NOTE: Some line numbers and filenames shown here are from your compiled alloy files');
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

alloy files => Alloy source code (capitalized and different wording)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I always wondered what's correct, filename or file name. Guess you can use both but filename is slightly more common nowdays: http://english.stackexchange.com/questions/5366/which-is-correct-filename-file-name-or-filename

that.logger.error('to help you migrate your code.');
that.logger.error();
that.logger.error('NOTE: Some line numbers and filenames shown here are from your compiled alloy files');
that.logger.error('and may differ from your original source file.');
Copy link
Contributor

Choose a reason for hiding this comment

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

source file => source code

Object.keys(this.needMigration).forEach(function (pathAndFilename) {
var tokens = that.needMigration[pathAndFilename];
that.logger.error();
var shortPathAndFilename = pathAndFilename.replace(that.resourcesDir, 'Resources');
Copy link
Contributor

Choose a reason for hiding this comment

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

Arrange the variables together for better code-style and use error('') to signalize the empty line more clear.

@@ -0,0 +1,290 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

SWEET!

return getMethodTableForMigration.cachedTable;
}

var migrationPathAndFilename = path.resolve(__dirname, '../../data/migration-20161014143619.json');
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't hard-code the file name inside this method. Rather place it at the top or introduce a config-file for this kind of stuff.

@hansemannn
Copy link
Contributor

Left some minor comments. Please also do the master-PR, thx.

@janvennemann janvennemann changed the title [TIMOB-24027] Provide migration help for new properties [TIMOB-24027] Provide migration help for new properties (2_0_X) Oct 17, 2016
@hansemannn
Copy link
Contributor

CR + FT passed, PR approved!

@hansemannn hansemannn merged commit c0bdf2e into tidev:2_0_X Oct 17, 2016
@janvennemann janvennemann deleted the TIMOB-24027 branch March 23, 2017 13:56
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

2 participants