Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

refactor: fetch v8Versions map from external url #242

Merged
sis0k0 merged 4 commits into master from vlaeva/fetch-v8-versions
Aug 4, 2017

Conversation

Copy link
Contributor

@sis0k0 sis0k0 commented Aug 3, 2017
edited
Loading

Https request to the v8-versions.json file from the android-runtime repo is used to determine the used v8 version.

@sis0k0 sis0k0 force-pushed the vlaeva/fetch-v8-versions branch from a3f8314 to 64d9ff0 Compare August 3, 2017 14:48
@sis0k0 sis0k0 force-pushed the vlaeva/fetch-v8-versions branch 3 times, most recently from 48999fe to 5079bd9 Compare August 3, 2017 15:55
@sis0k0 sis0k0 force-pushed the vlaeva/fetch-v8-versions branch from 5079bd9 to 189a4c2 Compare August 3, 2017 16:14
@sis0k0 sis0k0 changed the title (削除) [DON'T MERGE] refactor: fetch v8Versions map from external url (削除ここまで) (追記) refactor: fetch v8Versions map from external url (追記ここまで) Aug 3, 2017
bin/ns-bundle Outdated
const platform = options.platform;
let commands = [
() => runTns("prepare", platform)
// () => runTns("prepare", platform)
Copy link
Contributor

@Mitko-Kerezov Mitko-Kerezov Aug 3, 2017

Choose a reason for hiding this comment

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

Do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do, thanks for noticing that!

bin/ns-bundle Outdated
const childProcess = spawn("tns", ["--version"], { shell: true });

childProcess.stdout.on("data", resolve);
childProcess.stdout.on("data", version=>resolve(String(version)));
Copy link
Contributor

@Mitko-Kerezov Mitko-Kerezov Aug 3, 2017

Choose a reason for hiding this comment

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

I think I'd prefer version.toString() here to String(version).
The latter looks a bit odd, just a personal taste though, although there are some minor differences between the two.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 toString is recommended in some style guides

"generate-android-snapshot": "./bin/generate-android-snapshot"
},
"dependencies": {
"semver": "^5.4.1",
Copy link
Contributor

@Mitko-Kerezov Mitko-Kerezov Aug 3, 2017

Choose a reason for hiding this comment

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

An exact version would be better IMO - ^5.4.1 could cause problems in case semver releases 5.5.0 which has breaking changes (which shouldn't happen but can)

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 believe the semver package will follow the semver versioning. Also if there are some changes that they need to introduce because of new node/npm versions, they'll probably do it with minor releses and not patches.

}
});
}).catch(error => {
throw new Error("Cannot find suitable v8 version!");
Copy link
Contributor

@Mitko-Kerezov Mitko-Kerezov Aug 3, 2017

Choose a reason for hiding this comment

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

Do you think it would be sensible to add information about the actual error that occurred here, like for example:
throw new Error(`Cannot find suitable v8 version! Original error: ${error.message || error}`);

sis0k0 reacted with thumbs up emoji
const runtimeVersion = this.getAndroidRuntimeVersion().replace(/-.*/, "");

const runtimeRange = Object.keys(v8VersionsMap).find(range => {
return semver.satisfies(runtimeVersion, range)
Copy link
Contributor

@Mitko-Kerezov Mitko-Kerezov Aug 3, 2017

Choose a reason for hiding this comment

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

You can optionally shorten this syntax here:

const runtimeRange = Object.keys(v8VersionsMap).find(range =>semver.satisfies(runtimeVersion, range));

sis0k0 reacted with thumbs up emoji
Copy link
Contributor

@Mitko-Kerezov Mitko-Kerezov left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@petekanev petekanev left a comment

Choose a reason for hiding this comment

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

Looks good and clean.

@sis0k0 sis0k0 merged commit f474e30 into master Aug 4, 2017
@sis0k0 sis0k0 deleted the vlaeva/fetch-v8-versions branch August 4, 2017 08:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Reviewers
2 more reviewers

@Mitko-Kerezov Mitko-Kerezov Mitko-Kerezov approved these changes

@petekanev petekanev petekanev approved these changes

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /