46 Commits

Author SHA1 Message Date
d985c33de3 chore: require relative path within tns-core-modules (#7367) 2019-06-28 18:23:39 +03:00
4f39fb728b chore: update tslint rules (#7391) 2019-06-26 15:13:48 +03:00
d35e14ed0f feat(hmr): preserve navigation history on applying changes (#7146) 2019-04-23 17:47:29 +03:00
5449cfa238 fix(docs): Move NativeScriptError declaration to a separate file (#6927)
It is used by `application.d.ts` and needs to be documented. The reason
that it wasn't included in the documentation by now is that `tns-core-modules.d.ts`
(which imports `module.d.ts`) defines types which are part of the internal
modules and runtimes APIs. As such they are excluded from the generation
of API documentation.
2019-02-20 13:58:09 +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
ff476d983d refactor: rename HmrContext to ModuleContext (#6843)
* refactor: rename HmrContext to ModuleContext

* refactor(ModuleContext): rename module to path
2019-01-31 18:32:25 +02:00
8cb726aedf fix-next: avoid circular reference (#6812) 2019-01-22 14:37:29 +02:00
28db2afbd4 feat: OnDiscardedError typings and event (#6777)
* feat: OnDiscardedError typings and event

* remove ios and android from DiscardedErrorEventData
2019-01-09 18:24:25 +02:00
2b7e7d89e0 fix-next: undefined root view when reapplying styles (#6729)
* fix: undefined root view when reapplying styles

Error:
```
JS ERROR TypeError: undefined is not an object (evaluating
'application_1.getRootView()._onCssStateChange')
```

Steps:
- `tns run <platform> --hmr`
- make a change in application styles
- restart the application
2018-12-27 16:44:24 +02:00
790bcfb470 refactor(HMR): apply changes in application styles at runtime 2018-12-14 14:34:50 +02:00
42a1491e6e feat(HMR): apply changes in application styles at runtime
Expose `HmrContext` interface.
Apply changes in `app.css` instantly.
Avoid navigation on livesync when changes in `app.css` have been made.
Apply changes in `app.css` on back navigation.
2018-12-14 14:34:47 +02:00
9ce08196f8 fix: throw if global css file is not found in webpack context (#5186) 2018-03-01 11:05:12 +02:00
4ce45666a5 test: add reset root view tests (#5437) 2018-02-21 11:38:37 +02:00
b113b0021a feat: Add methods to get the root view and set a different root view at run time (#5386)
* feat: add option to set a different root view at run time

* feat: expose application getRootView method

* refactor: Introduce ViewEntry interface

* fix: Respect root view rturned from launch event in Android

* refactor: getRootView() code + caching root view per activity.

* refactor: add app-root.xml in apps

* refactor: http test made async
2018-02-09 16:04:20 +02:00
1c78e4784c feat(ios): fire onDisplayed event when first frame is ready to be displayed (#5344)
* feat: add a 'profiling: lifecycle' to track startup times

* feat: log when displayed event fires

* feat(ios): fire onDisplayed event when first frame is ready to be
displayed
2018-01-29 13:47:35 +02:00
d356339520 feat: Register ./app.css instead of app.css so it can be provided by webpack context (#5158)
This will let us register the app.css in webpack from a context, and potentially
have a configuration such as:
```
const appCssContext = require.context("~/", false, /^\.\/app\.(css|scss|less|sass)$/);
global.registerWebpackModules(appCssContext);
```
That will work with all of the app.css, app.scss, app.less etc. without further manual reconfiguration.
2017-12-12 14:34:38 +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
90d36b26d3 Add 'displayed' event for android, close to the Displayed point logged in the android monitor for activity startup 2017-05-16 10:55:10 +03:00
e6250e718a Disable recycling of native views
createNativeView will set iOS nativeView if it is null/undefined
2017-03-28 18:08:59 +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
d38e99cabd Expose hasLaunched() on the application, style-scope will load css-es if app hasLaunched 2017-03-13 10:57:51 +02:00
b487aa0790 Fix application.cssFile var, promoted to get/set function 2017-03-09 13:47:36 +02:00
b45cbe929b No more ambient modules for tns-core-modules/* subpackages.
- Use path mappings in tsconfig.json to resolve module typings
- Only use ambient mobules for global API's
- Move single-file modules to a subdir with the same name so that
we can provide a hand-written typing next to it (via package.json)
- Delete all mentions of tns-core-modules.d.ts
- Delete reference d.ts assembly build steps. Not needed anymore.
- HACK! Use a <reference> for global typings in application.d.ts
to avoid publishing a separate @types/tns-core-modules package.
- Rename declarations.d.ts to tns-core-modules.d.ts to preserve
JS project mappings in references.d.ts (the only place we use those)
2017-03-07 17:59:02 +02:00
d5bd9be1f2 add missing export in application-common 2017-03-07 10:01:06 +02:00
a6fa0781f7 Observable needs __extends function which comes from globals in the case of Snapshot. 2017-03-06 18:18:31 +02:00
ea22eb9c20 refactoring circular imports 2017-03-06 14:05:55 +02:00
347755367e make tslint happy :( 2017-03-06 14:05:55 +02:00
2224cd6150 Reorganize imports/exports in order to make snapshot happy 2017-03-06 14:05:55 +02:00
7a56197ba7 Observable should be imported first. 2017-03-06 14:05:55 +02:00
6012ea04ba Move global merge in application before any require. 2017-03-06 14:05:55 +02:00
dc25c85e97 addCssFile on application module wasn’t changing the app styles (#3666) 2017-02-21 09:28:51 +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
86481cce4a Make typings compatible with @types/node.
Fixes name clashes and uses Node-compatible typings where possible.

Changes:
 - setTimout et al now return NodeJS.Timer instead of number
 - No "console" module anymore. Everyone uses it through global.console
 anyway.
 - We have a typed "global" instance with exposed properties now. Any
 "freeform" accesses must go through a `(<any>global).blah` cast.
 - remove tns-core-modules.{base,es6,es2015}.d.ts. Those were needed
 as workarounds for the ES6/DOM/Node type clashes.
2017-02-15 13:01:10 +02:00
d8e062da85 Fix: application.setCssFileName does not work 2017-01-04 15:23:59 +02:00
e6d64799d8 Fix: Android platform.screen.mainScreen props are not invalidated after orientation change
Resolves #3270
2017-01-03 11:17:06 +02:00
6feeb140e3 Fixing type errors in tests 2016-12-19 10:36:25 +02:00
19ee47ba24 got to layouts 2016-12-13 15:51:18 +02:00
0b7ea27fd5 Export set function for cssFile and resources. 2016-11-25 14:55:22 +02:00
097367274b Merge pull request #2522 from NativeScript/raikov/fix-livesync-css-angular
Fixed: CSS is not automatically livesynced in angular apps
2016-08-01 16:22:04 +03:00
ce83da8ba3 Fixed: CSS is not automatically livesynced in angular apps 2016-07-28 14:59:16 +03:00
540594454f Add bundle entrypoint registration module. 2016-06-29 15:57:05 +03:00
c1aeeb51a7 Inital by-type split
Split type.class from CssTypeSelector to CssCompositeSelector, probably support type#id.class selectors

Apply review comments, refactor css-selectors internally

Applied refactoring, all tests pass, button does not notify changes

Add tests for the css selectors parser.

Added tests for css-selectors

Added basic implementation of mayMatch and changeMap for css match state

Implemented TKUnit.assertDeepEqual to check key and key/values in Map and Set

Watch for property and pseudoClass changes

Add one child group test

Add typings for animations

Added mechanism to enable/disable listeners for pseudo classes

Count listeners instead of checking handlers, reverse subscription and unsubscription
2016-07-18 17:24:09 +03:00
2ef6757216 builder cached 2016-05-30 15:56:37 +03:00
caebf280ab LiveSync improved 2016-05-27 16:58:46 +03:00
e135c20b14 Rename the files 2016-05-26 14:30:25 +03:00