Skip to content

Remove ios native dependencies #2495

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

Merged
merged 8 commits into from
Mar 14, 2017

Conversation

TsvetanMilanov
Copy link
Contributor

@TsvetanMilanov TsvetanMilanov commented Feb 6, 2017

We need to remove our native dependencies - ref and ffi because they are casuing problems with each version of NodeJS which has new version of V8 in it. We are using ref and ffi to communicate with iTunes and execute fs and application management operations on iOS devices. This operations are moved in new dependency - device-lib. The device lib has JavaScript wrapper which we use in the CLI. Everything in the ios device file system and ios device application manager is replaced with the exposed methods from the device lib.

Common lib reference: telerik/mobile-cli-lib#889

@TsvetanMilanov TsvetanMilanov added this to the 2.6.0 (TBD) milestone Feb 6, 2017
@TsvetanMilanov TsvetanMilanov self-assigned this Feb 6, 2017
@Plamen5kov Plamen5kov modified the milestones: 3.0.0, 2.6.0 (TBD) Feb 7, 2017
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.

Seems legit

Copy link
Contributor

@rosen-vladimirov rosen-vladimirov left a comment

Choose a reason for hiding this comment

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

The title says: Remove ios native dependencies
However the PR just adds dependency in package.json. Shouldn't we actually delete the native dependencies from package.json?

@TsvetanMilanov TsvetanMilanov force-pushed the milanov/remove-ios-native-dependencies branch 3 times, most recently from 4c05959 to 8893b67 Compare February 14, 2017 13:35
@TsvetanMilanov TsvetanMilanov force-pushed the milanov/remove-ios-native-dependencies branch from 8893b67 to cfee565 Compare February 23, 2017 14:56

npc.postNotificationAndAttachForData(this.$iOSNotification.attachRequest);
});
// We should create these promises here beecause we need to send the ObserveNotification on the device
Copy link
Contributor

Choose a reason for hiding this comment

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

beecause -> because

try {
await this.$iOSNotificationService.awaitNotification(npc, this.$iOSNotification.readyForAttach, timeout);
// We should create this promise here beecause we need to send the ObserveNotification on the device
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above


await this.$iOSNotificationService.awaitNotification(npc, this.$iOSNotification.readyForAttach, readyForAttachTimeout);
await this.$iOSNotificationService.postNotificationAndAttachForData(deviceIdentifier, this.$iOSNotification.attachRequest);
await Promise.all(promisesToWait);
} catch (e) {
this.$logger.trace(`Timeout error: ${e}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this really a timeout error now? Is it possible something else to fail?


await this.$iOSNotificationService.awaitNotification(npc, this.$iOSNotification.readyForAttach, readyForAttachTimeout);
await this.$iOSNotificationService.postNotificationAndAttachForData(deviceIdentifier, this.$iOSNotification.attachRequest);
await Promise.all(promisesToWait);
Copy link
Contributor

Choose a reason for hiding this comment

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

hm, is Promise.all the correct method here. The order before was:

  • appLaunching
  • readyForAttach
  • waitForDebug (optional)
  • attachRequest

Now, with current code, it is:

  • appLaunching, readyForAttach (simultaneously)
  • waitForDebug
  • attachRequest

Or even in some cases:

  • waitForDebug
  • attachRequest
  • appLaunching, readyForAttach (simultaneously)

Can you elaborate why is the change of the order?

@TsvetanMilanov TsvetanMilanov force-pushed the milanov/remove-ios-native-dependencies branch 5 times, most recently from a0bed5e to 12b0d08 Compare March 2, 2017 12:20
TsvetanMilanov and others added 3 commits March 3, 2017 14:17
We need to remove our native dependencies - ref and ffi because they are casuing problems with each version of NodeJS which has new version of V8 in it. We are using ref and ffi to communicate with iTunes and execute fs and application management operations on iOS devices. This operations are moved in new dependency - device-lib. The device lib has JavaScript wrapper which we use in the CLI. Everything in the ios device file system and ios device application manager is replaced with the exposed methods from the device lib.
@Mitko-Kerezov Mitko-Kerezov force-pushed the milanov/remove-ios-native-dependencies branch from d0b8154 to 3eb893a Compare March 3, 2017 13:09
@TsvetanMilanov TsvetanMilanov force-pushed the milanov/remove-ios-native-dependencies branch 2 times, most recently from 4ebcb94 to a170d90 Compare March 10, 2017 17:14
Since we use the ios-device-lib to connect to the device backend port for debugging, the socket returned from the device can be used only in the ios-device lib.
That's why we need to change the logic for creating the Node.js socket in the CLI. The ios-device-lib will expose the device socket on a specific port in the localhost.
After we connect to the exposed socket we can continue to work like we used to.
@TsvetanMilanov TsvetanMilanov force-pushed the milanov/remove-ios-native-dependencies branch from a170d90 to c9d03b1 Compare March 10, 2017 17:46
@TsvetanMilanov TsvetanMilanov force-pushed the milanov/remove-ios-native-dependencies branch from 84ed8ae to 0280bd9 Compare March 14, 2017 10:13
@TsvetanMilanov TsvetanMilanov force-pushed the milanov/remove-ios-native-dependencies branch from 0280bd9 to 9e30d2b Compare March 14, 2017 12:05
@TsvetanMilanov TsvetanMilanov merged commit 242cd3b into master Mar 14, 2017
@TsvetanMilanov TsvetanMilanov deleted the milanov/remove-ios-native-dependencies branch March 14, 2017 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants