Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 61a6f21

Browse files
authored
fix-next: export original mangle excludes array for backwards compatibility with {N} 3.4 (#478)
1 parent 0893b28 commit 61a6f21

File tree

5 files changed

+145
-2
lines changed

5 files changed

+145
-2
lines changed

Diff for: index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ exports.getAotEntryModule = function (appDirectory = APP_PATH) {
3333
return aotEntry;
3434
}
3535

36-
// Exported for backwards compatibility
37-
exports.uglifyMangleExcludes = [];
36+
// Exported for backwards compatibility with {N} 3
37+
exports.uglifyMangleExcludes = require("./mangle-excludes");
3838

3939
exports.getEntryModule = function (appDirectory = APP_PATH) {
4040
const entry = getPackageJsonEntry(appDirectory);

Diff for: mangle-excludes.js

+140
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
module.exports = [
2+
// Control names
3+
"AbsoluteLayout",
4+
"ActionBar",
5+
"ActivityIndicator",
6+
"Button",
7+
"DatePicker",
8+
"DockLayout",
9+
"EditableTextBase",
10+
"FlexboxLayout",
11+
"GridLayout",
12+
"Image",
13+
"Label",
14+
"Layout",
15+
"LayoutBase",
16+
"ListPicker",
17+
"ListView",
18+
"Page",
19+
"Progress",
20+
"SearchBar",
21+
"SegmentedBar",
22+
"Slider",
23+
"StackLayout",
24+
"Switch",
25+
"TabView",
26+
"TextBase",
27+
"TextField",
28+
"TextView",
29+
"TimePicker",
30+
"View",
31+
"WrapLayout",
32+
33+
// Android native class extenders
34+
"BroadcastReceiver",
35+
"CustomTypefaceSpan",
36+
"DialogFragmentClassInner",
37+
"FragmentClass",
38+
"ListViewAdapter",
39+
"LruBitmapCache",
40+
"NativeScriptActivity",
41+
"OurTabHost",
42+
"PageChangedListener",
43+
"PagerAdapterClassInner",
44+
"PinchGestureListener",
45+
"SegmentedBarColorDrawable",
46+
"SwipeGestureListener",
47+
"TapAndDoubleTapGestureListener",
48+
"WebViewClientClassInner",
49+
50+
// tns 3.0
51+
"DisableUserInteractionListener",
52+
"EditorActionListener",
53+
"FocusChangeListener",
54+
"TextWatcher",
55+
"ValueChangeListenerImpl",
56+
57+
"AnimationListnerImpl",
58+
"AnimationListenerImpl",
59+
"TransitionListenerImpl",
60+
"CheckedChangeListenerImpl",
61+
"ClickListenerImpl",
62+
"CompatCloseListenerImpl",
63+
"CloseListenerImpl",
64+
"DateChangedListenerImpl",
65+
"DialogFragmentImpl",
66+
"EditTextListenersImpl",
67+
"FormatterImpl",
68+
"ImageLoadedListenerImpl",
69+
"ItemClickListenerImpl",
70+
"MenuItemClickListenerImpl",
71+
"NSCacheDelegateImpl",
72+
"NativeViewGroupImpl",
73+
"PageChangedListenerImpl",
74+
"PagerAdapterImpl",
75+
"PinchGestureListenerImpl",
76+
"CompatQueryTextListenerImpl",
77+
"QueryTextListenerImpl",
78+
"SeekBarChangeListenerImpl",
79+
"SwipeGestureListenerImpl",
80+
"TabChangeListenerImpl",
81+
"TabContentFactoryImpl",
82+
"TabHostImpl",
83+
"TapAndDoubleTapGestureListenerImpl",
84+
"TextTransformationImpl",
85+
"TimeChangedListenerImpl",
86+
"TouchListenerImpl",
87+
"WebViewClientImpl",
88+
89+
// iOS native class extenders
90+
"AnimatedTransitioning",
91+
"AnimationDelegateImpl",
92+
"DataSource",
93+
"FrameHandlerImpl",
94+
"ListPickerDataSource",
95+
"ListPickerDelegateImpl",
96+
"ListViewCell",
97+
"LocationListenerImpl",
98+
"NSURLSessionTaskDelegateImpl",
99+
"NotificationObserver",
100+
"ObserverClass",
101+
"Responder",
102+
"SelectionHandlerImpl",
103+
"SliderChangeHandlerImpl",
104+
"SwitchChangeHandlerImpl",
105+
"TapBarItemHandlerImpl",
106+
"TapHandlerImpl",
107+
"TimerTargetImpl",
108+
"TouchGestureRecognizer",
109+
"TransitionDelegate",
110+
"UIActionSheetDelegateImpl",
111+
"UIAlertViewDelegateImpl",
112+
"UIDatePickerChangeHandlerImpl",
113+
"UIDocumentInteractionControllerDelegateImpl",
114+
"UIGestureRecognizerDelegateImpl",
115+
"UIGestureRecognizerImpl",
116+
"UIImagePickerControllerDelegateImpl",
117+
"UINavigationControllerAnimatedDelegate",
118+
"UINavigationControllerDelegateImpl",
119+
"UINavigationControllerImpl",
120+
"UIScrollViewDelegateImpl",
121+
"UISearchBarDelegateImpl",
122+
"UITabBarControllerDelegateImpl",
123+
"UITabBarControllerImpl",
124+
"UITableViewDelegateImpl",
125+
"UITableViewRowHeightDelegateImpl",
126+
"UITextFieldDelegateImpl",
127+
"UITextFieldImpl",
128+
"UITextViewDelegateImpl",
129+
"UITimePickerChangeHandlerImpl",
130+
"UIViewControllerImpl",
131+
"UIWebViewDelegateImpl",
132+
"Window",
133+
134+
// Sidedrawer transitions
135+
// Should be removed after {N} 4.0 is released
136+
// See: https://github.com/telerik/nativescript-ui-feedback/issues/477#issuecomment-360772046
137+
"PushTransition",
138+
"FadeTransition",
139+
"SlideInOnTopTransition",
140+
];

Diff for: templates/webpack.angular.js

+1
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ module.exports = env => {
194194
const compress = platform !== "android";
195195
config.plugins.push(new UglifyJsPlugin({
196196
uglifyOptions: {
197+
mangle: { reserved: nsWebpack.uglifyMangleExcludes }, // Deprecated. Remove if using {N} 4+.
197198
compress,
198199
}
199200
}));

Diff for: templates/webpack.javascript.js

+1
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ module.exports = env => {
169169
const compress = platform !== "android";
170170
config.plugins.push(new UglifyJsPlugin({
171171
uglifyOptions: {
172+
mangle: { reserved: nsWebpack.uglifyMangleExcludes }, // Deprecated. Remove if using {N} 4+.
172173
compress,
173174
}
174175
}));

Diff for: templates/webpack.typescript.js

+1
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ module.exports = env => {
171171
const compress = platform !== "android";
172172
config.plugins.push(new UglifyJsPlugin({
173173
uglifyOptions: {
174+
mangle: { reserved: nsWebpack.uglifyMangleExcludes }, // Deprecated. Remove if using {N} 4+.
174175
compress,
175176
}
176177
}));

0 commit comments

Comments
 (0)