Skip to content

Conversation

rosen-vladimirov
Copy link
Contributor

Remove unused code and interfaces, particularly the lib/common/appbuilder directory and several other files and interfaces related to it.

Notable changes:

  • remove the whole lib/common/appbuilder directory
  • remove unused interfaces
  • remove unused .d.ts files
  • remove npm-service and related npm search services from lib/common - they were used in the past for tns plugin search command
  • remove isLiveSyncSupported methods and properties - they were used in the past for AppBuilder and had been implemented in the DeviceApplicationManagers, DevicesService, etc.
  • remove mobile-platform-capabilities and related logic - in AppBuilder there was support for LiveSync over the network and some other different use cases, so we had an object containing the information what is supported for each OS. Now, we do not need this logic.
  • remove commandsServiceProvider - it was used in AppBuilder to provide the dynamic ScreenBuilder commands. Now we do not have dynamic commands
  • remove dynamicHelpService and dynamicHelpProvider - again used in the past for AppBuilder and ScreenBuilder
  • remove basic classes for Config and StaticConfig - they were used to share code between AppBuilder CLI and NativeScript CLI.
  • remove gaze as a dependency - it is currently used in the Cancellation service, but it can be replaced with chokidar - we do not need two file system watchers as dependencies

PR Checklist

The COMMAND_HELP_FILE_NAME had been used in the past to show the name of the file where the help of all commands is located.
Since several years such file does not exist, so remove the variable and its usage in the code.
AB_SERVER and AB_SERVER_PROTO properties were used in the past, we do not need them anymore.
Remove ConfigBase and StaticConfigBase classes to simplify the usage of both `$staticConfig` and `$config` - we do not need the base classes - just move the implementation to the current inheritors
Move deviceEmitter out of appbuilder dir. Also remove all `companion` related services as they are not required anymore.
Move the device-log-provider out of appbuilder dir. The purpose of the file is to be used instead of the original deviceLogProvider when CLI is used as a library. This provider emits the device logs instead of writing them on the stdout.
To separate the two log providers, rename the one coming from appbuilder dir to `device-log-emitter`. Keep the registration in the `$injector` to be `deviceLogProvider` as it is the only way to keep the current behavior when CLI is used as a library.
Remove deviceAppDataFactory and deviceAppDataProviders which were used in old LiveSync logic.
Remove `$projectConstants` as it has been used in the past, but we no longer need it.
`typeScriptService` was required in the past for `Proton` product (Universal AppBuilder Desktop Client). As this product does not exist anymore, we do not need this service.
Remove `printPluginsService`, `npmPluginsService` and `npmService` - they were used for a product that is no longer supported - Proton.
The implementation had been used for old product that we do not support anymore.
Remove pathFilteringService as it was used in a product that we no longer support - Proton.
The implementation has been used for a product that is no longer supported - Proton.
Remove Project.IProjectCapabilities interface and all of its implementations. They were used for a product that is no longer supported - Proton.
Remove all `Project.` interfaces and their implementations as they were used in a product that is no longer supported - Proton.
Remove all LiveSync related services from appbuilder dir (and the whole dir). Cleanup interfaces and classes used only in the deleted files.
Remove unused `isLiveSyncSupported` methods, which were checking if the application can be LiveSynced via AppBuilder's LiveSync plugin that is no longer supported.
In older implementation there was a requirement to have different capabilities for each platform (Android, iOS, WP8) like deploy via cable, deploy over wi-fi with companion app, etc.
This code is no longer used, so delete the capabilities implementation from the codebase.
There's no such module `nativescript-cli` and `AppDataProvider`, so the `$injector.require` is just incorrect and not needed.
The `commandsServiceProvider` has been used when code was shared between AppBuilder CLI and NativeScript CLI. At the moment, we do not share the code with any other library, so we can safely remove the `commandsServiceProvider` as it is not used in NativeScript CLI.
Remove `dynamicHelpService` and `dynamicHelpProvider` - they were used when the code between AppBuilder CLI and NativeScript CLI was shared. The idea of the service was to get the help content of ScreenBuilder commands. Now we do not need such logic, so just remove it and clean the code from the unused interfaces.
Remove `parse5.d.ts` as this package is not used by CLI.
Clean some unused interfaces
Remove `gaze` dependency, which was used for the Cancellation service - use chokidar instead as we already use it for LiveSync watcher and there's no point of having two different watchers.
Copy link
Contributor

@DimitarTachev DimitarTachev left a comment

Choose a reason for hiding this comment

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

🥇 🥇 🥇

@rosen-vladimirov rosen-vladimirov merged commit fd68fbc into master Jan 28, 2019
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/clean-unused-code branch January 28, 2019 17:45
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.

2 participants