Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Commit

Permalink
feat(deep-linking): parsing deeplink decorator is now enabled by defa…
Browse files Browse the repository at this point in the history
…ult, no longer experimental

parsing deeplink decorator is now enabled by default, no longer experimental
  • Loading branch information
danbucholtz committed Mar 17, 2017
1 parent 2943188 commit e097d4e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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 |
Expand Down
4 changes: 2 additions & 2 deletions src/preprocess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/util/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions src/util/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion src/util/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit e097d4e

Please sign in to comment.