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

Commit d831512

Browse files
committed
refactor(deep-linking): rename decorator to
rename decorator to
1 parent e097d4e commit d831512

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ npm run build --rollup ./config/rollup.config.js
131131
| 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 |
132132
| 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 |
133133
| print webpack dependency tree | `ionic_print_webpack_dependency_tree` | `--printWebpackDependencyTree` | `null` | Set to `true` to print out a dependency tree after running Webpack |
134-
| parse deeplink config | `ionic_parse_deeplinks` | `--parseDeepLinks` | `true` | Parses and extracts data from the `@DeepLink` decorator |
134+
| parse deeplink config | `ionic_parse_deeplinks` | `--parseDeepLinks` | `true` | Parses and extracts data from the `@IonicPage` decorator |
135135
| experimental manual tree shaking | `ionic_experimental_manual_treeshaking` | `--experimentalManualTreeshaking` | `null` | Set to `true` to purge unused Ionic components/code (Experimental) |
136136
| experimental purge decorators | `ionic_experimental_purge_decorators` | `--experimentalPurgeDecorators` | `null` | Set to `true` to purge unneeded decorators to improve tree shakeability of code (Experimental) |
137137
| experimental closure compiler | `ionic_use_experimental_closure` | `--useExperimentalClosure` | `null` | Set to `true` to use closure compiler to minify the final bundle |

src/deep-linking/util.spec.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ import { Component } from '@angular/core';
5757
5858
import { DeepLink, NavController } from 'ionic-angular';
5959
60-
@DeepLink({
60+
@IonicPage({
6161
name: 'someName',
6262
segment: 'someSegmentBro',
6363
defaultHistory: ['page-one', 'page-two'],
@@ -116,7 +116,7 @@ import { Component } from '@angular/core';
116116
117117
import { DeepLink, NavController } from 'ionic-angular';
118118
119-
@DeepLink({
119+
@IonicPage({
120120
segment: 'someSegmentBro',
121121
defaultHistory: ['page-one', 'page-two'],
122122
priority: 'high'
@@ -174,7 +174,7 @@ import { Component } from '@angular/core';
174174
175175
import { DeepLink, NavController } from 'ionic-angular';
176176
177-
@DeepLink({
177+
@IonicPage({
178178
defaultHistory: ['page-one', 'page-two'],
179179
priority: 'high'
180180
})
@@ -231,7 +231,7 @@ import { Component } from '@angular/core';
231231
232232
import { DeepLink, NavController } from 'ionic-angular';
233233
234-
@DeepLink({
234+
@IonicPage({
235235
priority: 'high'
236236
})
237237
@Component({
@@ -287,7 +287,7 @@ import { Component } from '@angular/core';
287287
288288
import { DeepLink, NavController } from 'ionic-angular';
289289
290-
@DeepLink({
290+
@IonicPage({
291291
})
292292
@Component({
293293
selector: 'page-home',
@@ -342,7 +342,7 @@ import { Component } from '@angular/core';
342342
343343
import { DeepLink, NavController } from 'ionic-angular';
344344
345-
@DeepLink()
345+
@IonicPage()
346346
@Component({
347347
selector: 'page-home',
348348
template: \`
@@ -397,9 +397,9 @@ import { Component } from '@angular/core';
397397
398398
import { DeepLink, NavController } from 'ionic-angular';
399399
400-
@DeepLink({
400+
@IonicPage({
401401
})
402-
@DeepLink({
402+
@IonicPage({
403403
})
404404
@Component({
405405
selector: 'page-home',
@@ -835,7 +835,7 @@ import { Component } from '@angular/core';
835835
import { DeepLink, NavController } from 'ionic-angular';
836836
837837
838-
@DeepLink({
838+
@IonicPage({
839839
name: 'SomeOtherName'
840840
})
841841
@Component({
@@ -945,7 +945,7 @@ export class PageTwoModule {
945945
import { Component } from '@angular/core';
946946
import { DeepLink, NavController } from 'ionic-angular';
947947
948-
@DeepLink({
948+
@IonicPage({
949949
segment: 'someSegmentBro',
950950
defaultHistory: ['page-one', 'page-two'],
951951
priority: 'high'
@@ -1026,7 +1026,7 @@ import { Component } from '@angular/core';
10261026
import { DeepLink, NavController } from 'ionic-angular';
10271027
10281028
1029-
@DeepLink({
1029+
@IonicPage({
10301030
name: 'SomeOtherName'
10311031
})
10321032
@Component({
@@ -1081,7 +1081,7 @@ import { LoadingController, ModalController, NavController, PopoverController }
10811081
selector: 'page-page-two',
10821082
templateUrl: './page-two.html'
10831083
})
1084-
@DeepLink()
1084+
@IonicPage()
10851085
export class PageTwo {
10861086
10871087
constructor(public loadingController: LoadingController, public modalController: ModalController, public navCtrl: NavController, public popoverCtrl: PopoverController) {}
@@ -1138,7 +1138,7 @@ export class PageTwoModule {
11381138
import { Component } from '@angular/core';
11391139
import { DeepLink, NavController } from 'ionic-angular';
11401140
1141-
@DeepLink({
1141+
@IonicPage({
11421142
segment: 'someSegmentBro',
11431143
defaultHistory: ['page-one', 'page-two'],
11441144
priority: 'high'
@@ -1244,7 +1244,7 @@ import { Component } from '@angular/core';
12441244
import { DeepLink, NavController } from 'ionic-angular';
12451245
12461246
1247-
@DeepLink({
1247+
@IonicPage({
12481248
name: 'SomeOtherName'
12491249
})
12501250
@Component({
@@ -1299,7 +1299,7 @@ import { LoadingController, ModalController, NavController, PopoverController }
12991299
selector: 'page-page-two',
13001300
templateUrl: './page-two.html'
13011301
})
1302-
@DeepLink()
1302+
@IonicPage()
13031303
export class PageTwo {
13041304
13051305
constructor(public loadingController: LoadingController, public modalController: ModalController, public navCtrl: NavController, public popoverCtrl: PopoverController) {}
@@ -1356,7 +1356,7 @@ export class PageTwoModule {
13561356
import { Component } from '@angular/core';
13571357
import { DeepLink, NavController } from 'ionic-angular';
13581358
1359-
@DeepLink({
1359+
@IonicPage({
13601360
segment: 'someSegmentBro',
13611361
defaultHistory: ['page-one', 'page-two'],
13621362
priority: 'high'

src/deep-linking/util.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function getNgModuleDataFromPage(appNgModuleFilePath: string, filePath: s
6969
const ngModulePath = getNgModulePathFromCorrespondingPage(filePath);
7070
let ngModuleFile = fileCache.get(ngModulePath);
7171
if (!ngModuleFile) {
72-
throw new Error(`${filePath} has a @DeepLink decorator, but it does not have a corresponding "NgModule" at ${ngModulePath}`);
72+
throw new Error(`${filePath} has a @IonicPage decorator, but it does not have a corresponding "NgModule" at ${ngModulePath}`);
7373
}
7474
// get the class declaration out of NgModule class content
7575
const exportedClassName = getNgModuleClassName(ngModuleFile.path, ngModuleFile.content);
@@ -125,7 +125,7 @@ export function getDeepLinkDecoratorContentForSourceFile(sourceFile: SourceFile)
125125
});
126126

127127
if (list.length > 1) {
128-
throw new Error('Only one @DeepLink decorator is allowed per file.');
128+
throw new Error('Only one @IonicPage decorator is allowed per file.');
129129
}
130130

131131
if (list.length === 1) {
@@ -152,7 +152,7 @@ function getStringValueFromDeepLinkDecorator(sourceFile: SourceFile, propertyNod
152152
Logger.debug(`[DeepLinking util] getNameValueFromDeepLinkDecorator: DeepLink ${identifierToLookFor} set to ${valueToReturn}`);
153153
return valueToReturn;
154154
} catch (ex) {
155-
Logger.error(`Failed to parse the @DeepLink decorator. The ${identifierToLookFor} must be an array of strings`);
155+
Logger.error(`Failed to parse the @IonicPage decorator. The ${identifierToLookFor} must be an array of strings`);
156156
throw ex;
157157
}
158158
}
@@ -180,7 +180,7 @@ function getArrayValueFromDeepLinkDecorator(sourceFile: SourceFile, propertyNode
180180
Logger.debug(`[DeepLinking util] getNameValueFromDeepLinkDecorator: DeepLink ${identifierToLookFor} set to ${valueToReturn}`);
181181
return valueToReturn;
182182
} catch (ex) {
183-
Logger.error(`Failed to parse the @DeepLink decorator. The ${identifierToLookFor} must be an array of strings`);
183+
Logger.error(`Failed to parse the @IonicPage decorator. The ${identifierToLookFor} must be an array of strings`);
184184
throw ex;
185185
}
186186
}
@@ -377,7 +377,7 @@ export class ${className}Module {}
377377

378378

379379

380-
const DEEPLINK_DECORATOR_TEXT = 'DeepLink';
380+
const DEEPLINK_DECORATOR_TEXT = 'IonicPage';
381381
const DEEPLINK_DECORATOR_NAME_ATTRIBUTE = 'name';
382382
const DEEPLINK_DECORATOR_SEGMENT_ATTRIBUTE = 'segment';
383383
const DEEPLINK_DECORATOR_PRIORITY_ATTRIBUTE = 'priority';

src/upgrade-scripts/add-default-ngmodules.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ describe('add default ngmodules upgrade script', () => {
121121
function getClassContent(className: string, folderName: string) {
122122
return `
123123
import { Component } from '@angular/core';
124-
import { DeepLink, NavController } from 'ionic-angular';
124+
import { IonicPage, NavController } from 'ionic-angular';
125125
126-
@DeepLink()
126+
@IonicPage()
127127
@Component({
128128
selector: '${folderName}',
129129
templateUrl: './${folderName}.html'

0 commit comments

Comments
 (0)