-
Notifications
You must be signed in to change notification settings - Fork 10
Conversation
0df9669
to
98fa47a
Compare
declarations.d.ts
Outdated
@@ -1246,7 +1246,11 @@ interface IProfileDir { | |||
profileDir: string; | |||
} | |||
|
|||
interface ICommonOptions extends IRelease, IDeviceIdentifier, IJustLaunch, IAvd, IAvailableDevices, IProfileDir { | |||
interface IEmulator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IEmulator -> IHasEmulator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved the interface from NativeScript CLI. The idea of such interfaces is to wrap the properties used in $options
(the ones that you can pass with --
on the terminal).In this case, the option the user can pass is --emulator
, so the interface became IEmulator
.
Ping @KristianDD , @Fatme - what do you think - should we change this to IHasEmulator (without changing the --
option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IEmulatorTarget also sounds good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I mean is that IEmulator should be an interface for something that wanna call itself an Emulator. Here we need an interface for something that just has an emulator property => we need something like IHasEmulator or IHasEmulatorOption/IOptionsWithEmulator if we wanna specify that these interfaces are wrapping some options values.
Speed up device detection by: * removing duplicate calls to all device detection services * cache the Promise of initialize method - this way even when multiple calls are executed simultaneously, the result of the first one will be used. This allows Sidekick to call the method asynchronously. * do not execute iOS device detection login in case `--emulator` is passed Remove several public methods from the service - make them protected as we already have tests for them. Remove all calls to detectCurrentlyAttachedDevices method outside of the service - the initialize method will do it anyway, so no need to call it externally. Remove duplicate calls in the startLookingForDevices method - previously it had to filter which device detection services to call. As now each device detection service checks its platform, we can safely call all of them and rely on their filters to skip the execution.
98fa47a
to
7cbf6c9
Compare
Speed up device detection by:
--emulator
is passedRemove several public methods from the service - make them protected as we already have tests for them.
Remove all calls to detectCurrentlyAttachedDevices method outside of the service - the initialize method will do it anyway, so no need to call it externally.
Remove duplicate calls in the startLookingForDevices method - previously it had to filter which device detection services to call. As now each device detection service checks its platform, we can safely call all of them and rely on their filters to skip the execution.