From e097d4e5ff3c3a74c3f7d5a53db4e7b5453adf84 Mon Sep 17 00:00:00 2001 From: Dan Bucholtz Date: Fri, 17 Mar 2017 16:04:28 -0500 Subject: [PATCH] feat(deep-linking): parsing deeplink decorator is now enabled by default, no longer experimental parsing deeplink decorator is now enabled by default, no longer experimental --- README.md | 4 ++-- src/preprocess.ts | 4 ++-- src/util/config.spec.ts | 2 +- src/util/config.ts | 6 +++--- src/util/constants.ts | 3 ++- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 80ea78bb..727c96a3 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ npm run build --rollup ./config/rollup.config.js | print dependency tree | `ionic_print_original_dependency_tree` | `--printOriginalDependencyTree` | `null` | Set to `true` to print out the original dependency tree calculated during the optimize step | | print modified dependency tree | `ionic_print_modified_dependency_tree` | `--printModifiedDependencyTree` | `null` | Set to `true` to print out the modified dependency tree after purging unused modules | | print webpack dependency tree | `ionic_print_webpack_dependency_tree` | `--printWebpackDependencyTree` | `null` | Set to `true` to print out a dependency tree after running Webpack | -| experimental parse deeplink config | `ionic_experimental_parse_deeplinks` | `--experimentalParseDeepLinks` | `null` | Set to `true` to parse the Ionic 3.x deep links API for lazy loading (Experimental) | +| parse deeplink config | `ionic_parse_deeplinks` | `--parseDeepLinks` | `true` | Parses and extracts data from the `@DeepLink` decorator | | experimental manual tree shaking | `ionic_experimental_manual_treeshaking` | `--experimentalManualTreeshaking` | `null` | Set to `true` to purge unused Ionic components/code (Experimental) | | experimental purge decorators | `ionic_experimental_purge_decorators` | `--experimentalPurgeDecorators` | `null` | Set to `true` to purge unneeded decorators to improve tree shakeability of code (Experimental) | | experimental closure compiler | `ionic_use_experimental_closure` | `--useExperimentalClosure` | `null` | Set to `true` to use closure compiler to minify the final bundle | @@ -176,7 +176,7 @@ These environment variables are automatically set to [Node's `process.env`](http | `IONIC_PRINT_ORIGINAL_DEPENDENCY_TREE` | boolean to print out the original dependency tree calculated during the optimize step | | `IONIC_PRINT_MODIFIED_DEPENDENCY_TREE` | boolean to print out the modified dependency tree after purging unused modules | | `IONIC_PRINT_WEBPACK_DEPENDENCY_TREE` | boolean to print out a dependency tree after running Webpack | -| `IONIC_EXPERIMENTAL_PARSE_DEEPLINKS` | boolean to enable parsing the Ionic 3.x deep links API for lazy loading (Experimental) | +| `IONIC_PARSE_DEEPLINKS` | boolean to enable parsing the Ionic 3.x deep links API for lazy loading | | `IONIC_EXPERIMENTAL_MANUAL_TREESHAKING` | boolean to enable purging unused Ionic components/code (Experimental) | | `IONIC_EXPERIMENTAL_PURGE_DECORATORS` | boolean to enable purging unneeded decorators from source code (Experimental) | | `IONIC_USE_EXPERIMENTAL_CLOSURE` | boolean to enable use of closure compiler to minify the final bundle | diff --git a/src/preprocess.ts b/src/preprocess.ts index d0382eee..510e8417 100644 --- a/src/preprocess.ts +++ b/src/preprocess.ts @@ -22,7 +22,7 @@ export function preprocess(context: BuildContext) { } function preprocessWorker(context: BuildContext) { - const deepLinksPromise = getBooleanPropertyValue(Constants.ENV_EXPERIMENTAL_PARSE_DEEPLINKS) ? deepLinking(context) : Promise.resolve(); + const deepLinksPromise = getBooleanPropertyValue(Constants.ENV_PARSE_DEEPLINKS) ? deepLinking(context) : Promise.resolve(); return deepLinksPromise .then(() => { if (context.optimizeJs) { @@ -51,7 +51,7 @@ export function writeFilesToDisk(context: BuildContext) { } export function preprocessUpdate(changedFiles: ChangedFile[], context: BuildContext) { - if (getBooleanPropertyValue(Constants.ENV_EXPERIMENTAL_PARSE_DEEPLINKS)) { + if (getBooleanPropertyValue(Constants.ENV_PARSE_DEEPLINKS)) { return deepLinkingUpdate(changedFiles, context); } return Promise.resolve(); diff --git a/src/util/config.spec.ts b/src/util/config.spec.ts index 8038b810..5eccad32 100644 --- a/src/util/config.spec.ts +++ b/src/util/config.spec.ts @@ -146,7 +146,7 @@ describe('config', () => { expect(fakeConfig[Constants.ENV_TOAST_VIEW_CONTROLLER_PATH]).toEqual(join(context.ionicAngularDir, 'components', 'toast', 'toast.js')); expect(fakeConfig[Constants.ENV_TOAST_COMPONENT_FACTORY_PATH]).toEqual(join(context.ionicAngularDir, 'components', 'toast', 'toast-component.ngfactory.js')); - expect(fakeConfig[Constants.ENV_EXPERIMENTAL_PARSE_DEEPLINKS]).toBeFalsy(); + expect(fakeConfig[Constants.ENV_PARSE_DEEPLINKS]).toBeTruthy(); expect(fakeConfig[Constants.ENV_EXPERIMENTAL_MANUAL_TREESHAKING]).toBeFalsy(); expect(fakeConfig[Constants.ENV_EXPERIMENTAL_PURGE_DECORATORS]).toBeFalsy(); expect(fakeConfig[Constants.ENV_USE_EXPERIMENTAL_CLOSURE]).toBeFalsy(); diff --git a/src/util/config.ts b/src/util/config.ts index 47c7263b..1af4aecd 100644 --- a/src/util/config.ts +++ b/src/util/config.ts @@ -268,9 +268,9 @@ export function generateContext(context?: BuildContext): BuildContext { setProcessEnvVar(Constants.ENV_TOAST_COMPONENT_FACTORY_PATH, join(context.ionicAngularDir, 'components', 'toast', 'toast-component.ngfactory.js')); /* Experimental Flags */ - const experimentalParseDeepLinks = getConfigValue(context, '--experimentalParseDeepLinks', null, Constants.ENV_EXPERIMENTAL_PARSE_DEEPLINKS, Constants.ENV_EXPERIMENTAL_PARSE_DEEPLINKS.toLowerCase(), null); - setProcessEnvVar(Constants.ENV_EXPERIMENTAL_PARSE_DEEPLINKS, experimentalParseDeepLinks); - Logger.debug(`experimentalParseDeepLinks set to ${experimentalParseDeepLinks}`); + const parseDeepLinks = getConfigValue(context, '--parseDeepLinks', null, Constants.ENV_PARSE_DEEPLINKS, Constants.ENV_PARSE_DEEPLINKS.toLowerCase(), 'true'); + setProcessEnvVar(Constants.ENV_PARSE_DEEPLINKS, parseDeepLinks); + Logger.debug(`parseDeepLinks set to ${parseDeepLinks}`); const experimentalManualTreeshaking = getConfigValue(context, '--experimentalManualTreeshaking', null, Constants.ENV_EXPERIMENTAL_MANUAL_TREESHAKING, Constants.ENV_EXPERIMENTAL_MANUAL_TREESHAKING.toLowerCase(), null); setProcessEnvVar(Constants.ENV_EXPERIMENTAL_MANUAL_TREESHAKING, experimentalManualTreeshaking); diff --git a/src/util/constants.ts b/src/util/constants.ts index 39c14636..d5bedd78 100644 --- a/src/util/constants.ts +++ b/src/util/constants.ts @@ -69,9 +69,10 @@ export const ENV_NG_MODULE_FILE_NAME_SUFFIX = 'IONIC_NG_MODULE_FILENAME_SUFFIX'; export const ENV_PRINT_ORIGINAL_DEPENDENCY_TREE = 'IONIC_PRINT_ORIGINAL_DEPENDENCY_TREE'; export const ENV_PRINT_MODIFIED_DEPENDENCY_TREE = 'IONIC_PRINT_MODIFIED_DEPENDENCY_TREE'; export const ENV_PRINT_WEBPACK_DEPENDENCY_TREE = 'IONIC_PRINT_WEBPACK_DEPENDENCY_TREE'; +export const ENV_PARSE_DEEPLINKS = 'IONIC_PARSE_DEEPLINKS'; /* Flags for experimental stuff */ -export const ENV_EXPERIMENTAL_PARSE_DEEPLINKS = 'IONIC_EXPERIMENTAL_PARSE_DEEPLINKS'; + export const ENV_EXPERIMENTAL_MANUAL_TREESHAKING = 'IONIC_EXPERIMENTAL_MANUAL_TREESHAKING'; export const ENV_EXPERIMENTAL_PURGE_DECORATORS = 'IONIC_EXPERIMENTAL_PURGE_DECORATORS'; export const ENV_USE_EXPERIMENTAL_CLOSURE = 'IONIC_USE_EXPERIMENTAL_CLOSURE';