63 Commits

Author SHA1 Message Date
8756b3da16 refactor: HMR and webpack improvements (#7462)
* chore: update project

* refactor: clear module-name cache on orientation

* feat: add custom component in qualifiers app

* feat: enable HMR for custom components

* refactor: remove redundant check

* chore: clean console.log
2019-07-08 11:11:14 +03:00
4f39fb728b chore: update tslint rules (#7391) 2019-06-26 15:13:48 +03:00
d402c05b2f Merge branch 'master' into mdonev/release-to-master20190621 2019-06-25 16:52:27 +03:00
b20e771552 chore: remove deprecated apis for ns 6.0 (#7382) 2019-06-25 16:52:01 +03:00
dfe76213dd fix: clear the resolvedPage when entry is being cleared, change the passed View to be a weak reference (#7327)
* fix: clear the `resolvedPage` when entry is being cleared
fix: change the passed `View` to be a weak reference

* chore: add trace logs when weak ref has been cleared but is continuing to be used
chore: add condition to check if weak ref has not been cleared when it is being used

* chore: refactor the way the `resolvedPage` is cleared

* chore: add backward compatible property to avoid breaking changes

* chore: refactor condition to check if WeakRef is not cleared
chore: add tracelogs

* chore: refactor condition to check if WeakRef is not cleared
chore: add tracelogs

* refactor: weakRef usages

* chore: change the way WeakRef type check is done
2019-06-21 01:48:49 -07:00
6d36041823 fix back navigation 2019-06-04 17:50:26 +03:00
7c22ffed45 fix(hmr): support for multi module replacement 2019-05-31 16:17:55 +03:00
8a2f592df9 refactor(HMR): Refactor livesync propagaton 2019-05-03 17:48:44 +03:00
d35e14ed0f feat(hmr): preserve navigation history on applying changes (#7146) 2019-04-23 17:47:29 +03:00
3c2c1d9b69 feat(HMR): style views at runtime (#7012)
* feat(HMR): style view at runtime

test: module root view component

test: update livesync tests

refactor: _onLivesync function

* style: remove a comment

* refactor: rename the property
2019-03-13 13:24:49 +02:00
44b8acd79c feat(HMR): apply changes in page styles at runtime when app root is a frame (#6857)
* feat(HMR): apply changes in page styles at runtime

* fix: livesync tests

* test: changeCssFile method

* refactor: address comments

Add a comment.
Update `let` to `const`.
Update `changesCssFile` test.

* test: add an assert
2019-02-14 14:03:13 +02:00
c084660d0b fix(android): nested fragment disappears on parent fragment removal (#6677) 2018-12-12 14:16:10 +02:00
fc1f8c1e42 fix(back-navigation): app freeze on going back in parent frame with states (#6595)
Endless loop while searching for parent frame that can go back.
Caught in Angular app when trying to go back from nested named lazy loaded outlet using the android hadrware back button.
2018-11-23 10:05:49 +02:00
7df8038d09 fix: nested frames order with tabs & suspend/resume (#6528) 2018-11-14 10:20:52 +02:00
0002624d3c feat(frame): add new actionBarVisibility property (#6449) 2018-10-24 14:51:43 +03:00
af651d6e83 feat(frame): hardware back in parent frame when back states available (#6446) 2018-10-24 10:18:50 +03:00
71107533bb refactor: guard livesync for cases the app is not yet started (#6276) 2018-09-20 09:47:53 +03:00
2fc1d8a8d4 chore(tsc): enable noUnusedLocals compiler option for tns-core-modules (#5755) 2018-05-10 16:12:59 +03:00
cf950e1ebb fix(navigation): fix frame.navigate call inside page.navigatedTo handler (#5649) 2018-04-11 11:25:54 +03:00
70f01123df feat(frame): handle back navigation when common layout is used as a root element (#5608)
* test(e2e): update modal navigation app

Add layout as root.
Add show modal layout.

* chore(frame): move frame stack modifiers in a separate frame-stack module

* feat(frame): handle back navigation when using common layout as root element
2018-04-02 22:27:44 +03:00
dfa70dd384 feat(frame): rework frame retrieval api (#5527)
Rework the frame api to support working with multiple Frames.
* frameModule.topmost() - now returns the last navigated Frame or
the currently selected tab item's Frame if the tab item's view is a
Frame.
* frameModule.getFrameById(id: string) - returns a navigated Frame by id.
* args.object.page.frame - can be used in page elements event handlers.
Returns the Frame of the current element's page.
* chore: Update madge-android npm script path
2018-03-13 18:10:45 +02:00
1cbb1e8d0d feat(webpack): mark the CSS type for stylable views explicitly (#5257)
We want webpack's uglification to mangle function and class names
but that's what the current implementation of the CSS in {N} relys on
to get the CSS type for each view when targeted by CSS type selectors.

The implementation is changed a little so now the CSS type can be set
directly on the prototype of each View class or for TS, through decorator.

BREAKING CHANGES:


Extending classes requires marking the derived class with @CSSType
The root classes are not marked with CSSType and classes derived from ViewBase and View
will continue to work as expected. More concrete view classes (Button, Label, etc.) are
marked with @CSSType now and store their cssType on the prototype suppressing the previous
implementation that looked up the class function name. So clien classes that derive from one of
our @CSSType decorated classes will now have to be marked with @CSSType.
2018-03-12 16:34:25 +02:00
2704915384 fix(frame): add generic frame cleanup logic after modal dialog close (#5479) 2018-03-01 10:37:26 +02:00
4ce45666a5 test: add reset root view tests (#5437) 2018-02-21 11:38:37 +02:00
2edef3de3b fix(frame): root tabview with modal frame when suspend/resume app (#5408) 2018-02-12 16:09:51 +02:00
85dc75e09a fix-next: navigation events' workflow in modal dialog scenarios (#5341) 2018-02-06 19:18:28 +02:00
af934ccabf feature(frame): introduce src property (#5320) 2018-01-25 10:57:13 +02:00
016c64fe04 showModal & closeModal can be called on any View
fix livesync implementation to be compatible with 3.4 and to replace mainEntry for 4.0 when root is not Frame
some refactoring of page.ios in order to allow showing multiple modal dialogs
2018-01-18 13:34:25 +02:00
3384112ce8 When application start is called we don't set Frame to be styleScope
Added requestLayout for TextView
Round desiredSize in nativeMeasure
2018-01-09 13:17:50 +02:00
4e74c37313 Fix android crash TabViewItem canBeLoaded was true even when TabView was destroyed
Fix android crash modal view was not destroyed even though his dialog was
2017-12-15 13:08:15 +02:00
ac04ede97e Implemented showModal on View 2017-12-15 13:08:15 +02:00
28f1a5875e Fix crash on android where we queue few back navigations an exception is thrown.
Fix https://github.com/NativeScript/NativeScript/issues/4986
2017-12-15 13:06:34 +02:00
af034089ca iOS Frame, Page and TabView measure/layout methods removed. We now rely on the framework positioning. This will result in a change that width, height, minWidth, minHeight, margins not respected on these controls
iOS layout positioning now respects native properties like automaticallyAdjustsScrollViewInsets, edgesForExtendedLayout, extendedLayoutIncludesOpaqueBars, navigationBar.translucent, tabBar.translucent
Removed frame-tests.ios.ts - those tests are now invalid
Added new layout tests inside page-tests.ios.ts
Commented few asserts in scroll-view-tests
View now expose ios namespace with layoutView method and UILayoutViewController used by page, tab-view and application module
ViewBase now expose viewController property that should be set from all widgets that are using viewcontrollers internally (like Page, Frame, TabView)
ViewBase now sets ios property to either the view returned from createNativeView or to nativeViewProptected
fragment.transitions now use animation/transition start to add fragments to waitingQueue. Before we did it manually in navigate/goBack. This way we can reuse the fragment.transition when calling showDialog. Also when animation/transition ends we check the animation/transition to see if this fragment should be set as current.
Frame expose new loadViewFromEntry method (to load a view from URI)
Frame navigation happens once frame is loaded
Frame now supports Page as a child in XML
Fixed GridLayout row, rowSpan, column, columnSpan properties type
Fixed bug in GridLayout where add/remove of columns/rows won't update the internal state of the grid (backport from android when GridLayout is recycled)
ListView will no longer invalidate layout when cell is removed
Fixed bug in ScrollView ios where effectiveMinWidth/Height was multiplied to density (it is already on device pixels so no need to multiply)
TabView android now calls loaded only on the selected child (not all)
Core refactoring
2017-12-15 13:06:34 +02:00
43fbabb5e9 Fixed most module cyclic references. There is one left for ios and android: (#4978)
- http -> http-request -> image-source
that can't be fixed easily and will be removed once we delete image-source module because it is obsolete anyway.
There is one more for android:
- frame -> fragment that could be removed if we use global object.
Updated madge bersion
2017-11-10 15:47:02 +02:00
f7a3a36b9c Housekeeping node tests, renamed to unit-tests (#4936)
Add parsers for the background css shorthand property, make ViewBase unit testable in node environment

Add background parser and linear-gradient parser

Use sticky regexes

Simplify some types, introduce generic Parsed<T> instead of & TokenRange

Apply each parser to return a { start, end, value } object

Move the css selector parser to the css/parser and unify types

Add the first steps toward building homegrown css parser

Add somewhat standards compliant tokenizer, add baseline, rework and shady css parsers

Enable all tests again, skip flaky perf test

Improve css parser tokenizer by converting some char token types to simple string

Implement 'parse a stylesheet'

Add gonzales css-parser

Add parseLib and css-tree perf

Add a thin parser layer that will convert CSS3 tokens to values, for now output is compatible with rework

Make root tsc green

Return the requires of tns-core-modules to use relative paths for webpack to work

Implement support for '@import 'url-string';

Fix function parser, function-token is no-longer neglected

Make the style-scope be able to load from "css" and "css-ast" modules

Add a loadAppCss event so theme can be added to snapshot separately from loaded
2017-10-20 10:42:07 +03:00
7c68953009 Fix clear history transition (#4951)
* fix: Navigation test app added

* Removed native popToBackstack call.
Implemented custom fragment save/restore state.
When navigating back we reverse manually transitions/animations because we no longer add them to navite backstack.
Fragment instance stored on entry.
Animation and Transition listeners now holds reference to entry instead of fragment for easier update of fragment.
Animation and Transition listeners removed when entry removed from backstack.
Animation and Transition removed from fragment when fragment activity is destroyed.

* Revert package.json start up entry
Fixed bug where goBack took the last element in backstack while navigationQueue is not empty.
Fixed bug where goBack to specific entry in the backstack was removing that entry...
Removed duplicated method
Refactored method name
Fixed TS
2017-10-20 08:37:36 +03:00
374f31cbf7 fix(minor): reword missing-xml-error to be clearer (#4947) 2017-10-18 10:43:17 +03:00
cb029225c3 Elements tab support for iOS Chrome DevTools (#4930)
* add initial implementation of the dom agent for ios

* add implementation of the css agent for ios

* refactor devtools inspector methods to somewhat accomodate ios and android

patch elements dom-node tests to test for ios too

* fix android dom-node test

* fix ios dom-node-tests to mock the ios devtools inspector properly

* fix: minor changes
2017-10-12 11:32:31 +03:00
6d7c1ff295 Avoid applying CSS multiple times (#4784)
* Move the applyStyleFromScope to onLoaded, when the views are created and id or className properties are set the CSS selectors are queried and applied multiple times

* Condense the changes when applying properties
2017-09-25 18:32:00 +03:00
3a447b6f3f Added @profile on several key methods in the Android lifecycle, refactored by extracting into methods a little (#4685) 2017-08-24 13:10:53 +03:00
bba7a82bdf Disable recycling, refactoring & fixes (#4705)
* Added tests for native view recycling
Disabled android native view recycling
Move toString from view-common to view-base
Fix crash on application restore and navigation back on API26
Added setAsRootView method
Added missing logo into perf-tests/recycling app

* additional fix for image-source-tests. ios is case sensitive.

* Add @private to some internal properties
Fix where padding is not respected when background is reset.
2017-08-17 09:15:35 +03:00
075e70e336 cache page on forward navigation (#4652)
* cache page on forward navigation
Still some failing navigation tests

* Current page is kept alive when navigating forward
Refactoring code and removing all hacks and flags
Remove one module circular reference

* Disable Page recycling because when there is transition between pages the nativeView stays animated (e.g. when transition is Fade the hidden page nativeView stays with Alpha 0)
Disable recycling if there is native anitmation

* Fix failing tests on ios & android API17
Fix wrong urls in http tests
Made some timer tests async

* Animations are not stored in BackstackEntry instead of Fragment because fragments could die (activity die) and recreated and we lose animations.

* Fix android crash when activity is recreated.
Refactoring transitionListener.
2017-08-07 17:24:12 +03:00
f2462158fb Chrome devtools elements tab support for Android (#4351)
* Enable chrome-devtools elemets tab

* Trigger updates when property is chaned form native

* Tslint fixes

* Don't run dom-elemet tests in IOS

* fix tests

* Create package.json

* Update package.json

* domNode changed to field for performance
2017-06-12 16:48:27 +03:00
90a0da2863 fix(livesync): attach __onLiveSyncCore to global object (#4215)
That method needs to be exposed because it's used in NativeScript Angular (https://github.com/NativeScript/nativescript-angular/blob/master/nativescript-angular/platform-common.ts#L91).
2017-05-18 17:13:24 +03:00
740d71a238 Apply page css when using nav-entry with create method 2017-04-03 14:51:57 +03:00
629eb6e683 Use relative imports in tns-core-modules.
Use tns-core-modules/* imports in outside code (apps, tests, etc)
2017-03-13 14:37:59 +02:00
789e2e0235 FIX: Livesync event not firing for frame 2017-03-13 10:49:09 +02:00
ea22eb9c20 refactoring circular imports 2017-03-06 14:05:55 +02:00
f3afaf5abe fixed tslint errors 2017-02-20 09:45:10 +02:00
a582adc561 Hhristov/fix (#3653)
* Fix action-bar systemIcon
Fix CSS applying

* refactoring

* fix console

* remove StyleScope import - it is private and cannot be imported in public .d.ts
2017-02-17 17:21:57 +02:00