You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://gitter.im/knockout/tko?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
<!-- [](https://saucelabs.com/u/tko) -->
11
12
12
13
**TKO** houses the monorepo of [Knockout](https://github.com/knockout/knockout).
14
+
TKO, or Technical Knockout, is a JavaScript web framework for data binding and templating. It is a fork of the original Knockout.js, which was created to enhance and modernize the framework while maintaining its core principles. TKO and Knockout implement the [MVVM pattern](http://en.wikipedia.org/wiki/Model_View_ViewModel) (a modern variant of MVC) as a zero-dependency and small sized library. TKO makes it easy to create rich, desktop-like user interfaces with JavaScript/Typescript and HTML. It uses *observers* to automatically keep your UI in sync with an underlying data model, along with a powerful and extensible set of *declarative bindings* to enable productive development.
15
+
16
+
TKO aims to provide developers with a more robust, modular, and maintainable codebase in [Typescript](https://www.typescriptlang.org/), making it easier to build rich, responsive, and maintainable web applications.
17
+
18
+
13
19
14
20
## Getting Started
15
21
16
22
To install use one of the usual package managers e.g.
| $ `git clone [email protected]:knockout/tko`| Clone the repository. |
38
-
| $ `npm install -g yarn`| Ensure yarn is globally available |
39
-
| $ `yarn`| Install local node packages and link tko modules |
40
-
| $ `make`|**Currently TKO use a make file**|
41
-
| $ `yarn test`| Run all tests. See below. |
42
-
| $ `yarn watch`| Run all tests and watch for changes. See below. |
43
-
| $ `yarn build`| Build tko\[.module\]\[.es6\]\[.min\].js files, where `.es6` version has not been transpiled |
53
+
| $ `npm install`| Ensure that all packages available |
54
+
| $ `make`|**Currently TKO use a make file** / no scripts at package.json |
55
+
| $ `make test`| Run all tests with electron. See below. |
56
+
| $ `make test-headless`| Run all tests with chromium. See below. |
44
57
| $ `lerna publish`| Bump versions and publish to npm registry |
45
58
46
-
Checkout `package.json => scripts` for more commands that can be executed with `yarn {command}`.
59
+
Checkout the `Makefile` for more commands that can be executed with `make {command}`.
47
60
48
-
In each individual `packages/*/` directory, you can also run (presuming `rollup` and `karma` are installed globally):
61
+
In each individual `packages/*/` directory, you can also run:
49
62
50
63
| Command | Effect |
51
64
| --- | --- |
52
65
| $ `karma COMMAND ../../karma.conf.js [--once]`| Test the local package, where COMMAND is e.g. `start` or `run`|
53
-
| $ `rollup -c ../../rollup.config.js`| Build the package into the local `dist/`|
66
+
| $ `make test-debug`| Runs all tests in the current package in debug- and watch-mode: Attach vscode, set a breakpoint, press save and debug|
54
67
55
-
#### Testing with `yarn test` and `yarn watch`
56
-
57
-
### NEW
68
+
### Testing
58
69
59
70
Start tests with electron: `make test`
60
71
61
72
Start tests with headless-chrome: `make test-headless`
62
73
63
-
### OLD
64
-
65
-
The `yarn test` and `yarn watch` commands can be used in the root directory, where it will run across all tests, or alternatively in any `packages/*/` directory to run tests
66
-
specific to that package.
74
+
The test setup has naturally grown and been ported from knockout.js. Some tests use Jasmine 1.3, newer ones use Mocha, Chai and Sinon. Karma is used as test runner rather as test pipeline
67
75
68
-
Optional arguments to `yarn test` include:
76
+
Other options:
69
77
70
-
-`--sauce` — use Sauce Labs to test a variety of platforms; requires an account at Sauce Labs and `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` to be set in the environment.
71
-
-`--noStartConnect` — Do not start a new Sauce Connect proxy instance for every
72
-
test; requires that Sauce Connect be already running.
78
+
-`make ci` — use Sauce Labs to test a variety of platforms; requires an account at Sauce Labs and `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` to be set in the environment.
73
79
74
-
#### `visual.html`
80
+
#### `visual.html` (possibly outdated)
75
81
76
-
Note that running `karma`or `rollup`will create a `visual.html` file that shows the proportional size of imports into each package.
82
+
Note that running `karma` will create a `visual.html` file that shows the proportional size of imports into each package.
77
83
78
-
###Objectives
84
+
## Objectives
79
85
80
86
TKO aims to become a base for future versions of Knockout. The objectives include:
81
87
82
-
- Modularization into ES6 and separate projects, with compilation using an ES6 compiler like [Rollup](http://rollupjs.org/). This solves several problems with Knockout, including:
88
+
- Modularization into ES6 and separate projects, with compilation using an ES6 compiler like [Esbuild](https://esbuild.github.io/). This solves several problems with Knockout, including:
83
89
- Some folks want to roll-their-own with e.g. removing components
84
90
- Compilation is now with Closure compiler, which is actually transliterating – meaning the *debug* and *minified* versions have different code paths (mostly in the form of things exposed in *debug* being missing in the *minified* version)
85
91
- The compilation of Knockout is just concatenation, leading to difficulties with maintainance, severance, and replacement
@@ -90,6 +96,27 @@ TKO aims to become a base for future versions of Knockout. The objectives inclu
90
96
- What should be simple plugins (e.g. binding handlers or providers) are complex, including:
91
97
- Built-ins have first-class access to quite a bit of good Knockout code, but plugins generally have second-class access and often have to duplicate Knockout internals
92
98
- Quality plugins have lots of boilerplate for compilation, release, documentation, and testing
99
+
- Type-safe with Typescript
100
+
- CSP compliant
101
+
- JSX/TSX support
102
+
103
+
## Overview of the development stack
104
+
105
+
-**make** -> Build tasks
106
+
-**npm** -> Node Package Manager
107
+
-**esbuild** -> ts/js compiler and bundler
108
+
-**lerna** -> mono-repo build-chain
109
+
110
+
---
111
+
112
+
- Test-Runner -> Karma
113
+
- Test-Environment -> electron and headless-chrome
114
+
- TDD/BDD-Frameworks ->
115
+
- Jasmine 1.3
116
+
- Mocha + Chai
117
+
- sinon (Mocks)
118
+
- Testing-Cloud-Service -> sauce
119
+
- standard -> Code-Style (outdated for typescript)
93
120
94
121
## Some WSL tricks
95
122
@@ -118,10 +145,16 @@ There's an [issue for that](https://github.com/knockout/tko/issues/1).
118
145
119
146
MIT license - [http://www.opensource.org/licenses/mit-license.php.](http://www.opensource.org/licenses/mit-license.php)
120
147
148
+
## Credits
149
+
- Knockout Type Definitions by: [Maxime LUCE](https://github.com/SomaticIT), [Michael Best](https://github.com/mbest)
0 commit comments