Skip to content

Commit

Permalink
refactor: optimize plugins for angular treeshaking
Browse files Browse the repository at this point in the history
BREAKING CHANGE: You can remove the plugin import from the app.module.ts because of the changed Inject decorator
  • Loading branch information
danielsogl committed Feb 20, 2019
1 parent 6423031 commit 8b53c04
Show file tree
Hide file tree
Showing 238 changed files with 735 additions and 245 deletions.
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/abbyy-rtr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ export interface DataCaptureResult {
install: 'ionic cordova plugin add cordova-plugin-abbyy-rtr-sdk',
platforms: ['Android', 'iOS']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AbbyyRTR extends IonicNativePlugin {
/**
* Opens a modal dialog with controls for the Text Capture scenario.
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/action-sheet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ export interface ActionSheetOptions {
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-actionsheet',
platforms: ['Android', 'Browser', 'iOS', 'Windows', 'Windows Phone 8']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class ActionSheet extends IonicNativePlugin {
/**
* Convenience property to select an Android theme value
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/adjust/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ export enum AdjustLogLevel {
repo: 'https://github.com/adjust/cordova_sdk',
platforms: ['Android', 'iOS']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class Adjust extends IonicNativePlugin {
/**
* This method initializes Adjust SDK
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/admob-free/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ export interface AdMobFreeRewardVideoConfig {
repo: 'https://github.com/ratson/cordova-plugin-admob-free',
platforms: ['Android', 'iOS']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AdMobFree extends IonicNativePlugin {
/**
* Convenience object to get event names
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/admob-plus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ export class RewardVideo {
pluginRef: 'admob',
repo: 'https://github.com/admob-plus/admob-plus',
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AdMob extends IonicNativePlugin {
banner = new Banner();
interstitial = new Interstitial();
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/admob-pro/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ export interface AdExtras {
repo: 'https://github.com/floatinghotpot/cordova-admob-pro',
platforms: ['Android', 'iOS', 'Windows Phone 8']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AdMobPro extends IonicNativePlugin {
AD_POSITION: {
NO_CHANGE: number;
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/admob/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ export interface AdmobOptions {
repo: 'https://github.com/appfeel/admob-google-cordova',
platforms: ['Android', 'iOS']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class Admob extends IonicNativePlugin {
/**
* This enum represents AdMob's supported ad sizes.
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/aes-256/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
platforms: ['Android', 'iOS'],
install: 'ionic cordova plugin add cordova-plugin-aes256-encryption'
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AES256 extends IonicNativePlugin {
/**
* This function used to perform the aes256 encryption
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/alipay/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
installVariables: ['APP_ID'],
platforms: ['Android', 'iOS']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class Alipay extends IonicNativePlugin {
/**
* Open Alipay to perform App pay
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/analytics-firebase/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-nati
repo: 'https://github.com/appfeel/analytics-google',
platforms: ['Android', 'iOS']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AnalyticsFirebase extends IonicNativePlugin {
/**
* This enum represents AnalyticsFirebase default events.
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/android-exoplayer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ export interface AndroidExoPlayerControllerConfig {
repo: 'https://github.com/frontyard/cordova-plugin-exoplayer',
platforms: ['Android']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AndroidExoplayer extends IonicNativePlugin {
/**
* Show the player.
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/android-fingerprint-auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ export interface AFADeleteOptions {
repo: 'https://github.com/mjwheatley/cordova-plugin-android-fingerprint-auth',
platforms: ['Android']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AndroidFingerprintAuth extends IonicNativePlugin {
/**
* Convenience property containing all possible errors
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/android-full-screen/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export enum AndroidSystemUiFlags {
repo: 'https://github.com/mesmotronic/cordova-plugin-fullscreen',
platforms: ['Android']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AndroidFullScreen extends IonicNativePlugin {
/**
* Is this plugin supported?
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/android-permissions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
repo: 'https://github.com/NeoLSN/cordova-plugin-android-permissions',
platforms: ['Android']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AndroidPermissions extends IonicNativePlugin {
PERMISSION: any = {
ACCESS_CHECKIN_PROPERTIES: 'android.permission.ACCESS_CHECKIN_PROPERTIES',
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/app-availability/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
repo: 'https://github.com/ohh2ahh/AppAvailability',
platforms: ['Android', 'iOS']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AppAvailability extends IonicNativePlugin {

/**
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/app-center-analytics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export interface StringMap {
'https://github.com/Microsoft/appcenter-sdk-cordova/tree/master/cordova-plugin-appcenter-analytics',
platforms: ['Android', 'iOS']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AppCenterAnalytics extends IonicNativePlugin {
/**
* Tracks an custom event.
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/app-center-crashes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ export interface AppCenterCrashReportDevice {
'https://github.com/Microsoft/appcenter-sdk-cordova/tree/master/cordova-plugin-appcenter-crashes',
platforms: ['Android', 'iOS']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AppCenterCrashes extends IonicNativePlugin {
/**
* App Center Crashes provides you with an API to generate a test crash for easy testing of the SDK.
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/app-center-push/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ import { Observable } from 'rxjs';
'https://github.com/Microsoft/appcenter-sdk-cordova/tree/master/cordova-plugin-appcenter-push',
platforms: ['Android', 'iOS']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AppCenterPush extends IonicNativePlugin {
/**
* Subscribe to an event
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/app-launcher/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export interface AppLauncherOptions {
repo: 'https://github.com/nchutchind/cordova-plugin-app-launcher',
platforms: ['Android', 'iOS']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AppLauncher extends IonicNativePlugin {
/**
* Check if any apps are installed that can launch via a specified URI or Package Name.
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/app-minimize/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ import { Injectable } from '@angular/core';
repo: 'https://github.com/tomloprod/cordova-plugin-appminimize',
platforms: ['Android']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AppMinimize extends IonicNativePlugin {

/**
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/app-preferences/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ import { Injectable } from '@angular/core';
'Windows Phone'
]
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AppPreferences extends IonicNativePlugin {
/**
* Get a preference value
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/app-rate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ export interface AppUrls {
repo: 'https://github.com/pushandplay/cordova-plugin-apprate',
platforms: ['Android', 'BlackBerry 10', 'iOS', 'Windows']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AppRate extends IonicNativePlugin {
/**
* Configure various settings for the Rating View.
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/app-update/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ export interface AppUpdateOptions {
repo: 'https://github.com/vaenow/cordova-plugin-app-update',
platforms: ['Android']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AppUpdate extends IonicNativePlugin {
/**
* Check and update
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/app-version/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
repo: 'https://github.com/whiteoctober/cordova-plugin-app-version',
platforms: ['Android', 'iOS', 'Windows']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AppVersion extends IonicNativePlugin {

/**
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/apple-pay/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ export interface ISelectedShippingContact {
repo: 'https://github.com/samkelleher/cordova-plugin-applepay',
platforms: ['iOS']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class ApplePay extends IonicNativePlugin {
/**
* Detects if the current device supports Apple Pay and has any capable cards registered.
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/apple-wallet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ export interface CardData {
repo: 'https://github.com/tomavic/cordova-apple-wallet',
platforms: ['iOS']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AppleWallet extends IonicNativePlugin {
/**
* Detects if the current device supports Apple Wallet
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/appodeal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ import { Observable } from 'rxjs';
repo: 'https://github.com/appodeal/appodeal-cordova-plugin',
platforms: ['iOS', 'Android']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class Appodeal extends IonicNativePlugin {
// available types of advertisements
readonly AD_TYPES = {
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/appsflyer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ export interface AppsflyerInviteOptions {
platforms: ['iOS', 'Android'],
install: 'Add to config.xml like stated on github and then start'
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class Appsflyer extends IonicNativePlugin {
/**
* initialize the SDK
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/audio-management/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
repo: 'https://github.com/clovelCed/cordova-plugin-audiomanagement',
platforms: ['Android']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class AudioManagement extends IonicNativePlugin {
/**
* Sets the `AudioManagement.AudioMode` for the device.
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/autostart/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
repo: 'https://github.com/ToniKorin/cordova-plugin-autostart',
platforms: ['Android']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class Autostart extends IonicNativePlugin {

/**
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/background-fetch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ export interface BackgroundFetchConfig {
repo: 'https://github.com/transistorsoft/cordova-plugin-background-fetch',
platforms: ['iOS']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class BackgroundFetch extends IonicNativePlugin {


Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/background-geolocation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,9 @@ export declare enum BackgroundGeolocationIOSActivity {
repo: 'https://github.com/mauron85/cordova-plugin-background-geolocation',
platforms: ['Android', 'iOS']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class BackgroundGeolocation extends IonicNativePlugin {
/**
* Configure the plugin.
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/background-mode/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ export interface BackgroundModeConfiguration {
repo: 'https://github.com/katzer/cordova-plugin-background-mode',
platforms: ['AmazonFire OS', 'Android', 'Browser', 'iOS', 'Windows']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class BackgroundMode extends IonicNativePlugin {
/**
* Enable the background mode.
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/backlight/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
repo: 'https://github.com/mebibou/cordova-plugin-backlight',
platforms: ['Android']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class Backlight extends IonicNativePlugin {

/**
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/badge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
repo: 'https://github.com/katzer/cordova-plugin-badge',
platforms: ['Android', 'Browser', 'iOS', 'Windows']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class Badge extends IonicNativePlugin {
/**
* Clear the badge of the app icon.
Expand Down
4 changes: 3 additions & 1 deletion src/@ionic-native/plugins/baidu-push/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ export interface NotificationData {
repo: 'https://github.com/Ti-webdev/cordova-plugin-push-baidu.git',
platforms: ['Android', 'iOS']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class BaiduPush extends IonicNativePlugin {
/**
* This method registers the device to Baidu Cloud Push services.
Expand Down
Loading

0 comments on commit 8b53c04

Please sign in to comment.