Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript) fix errors #202

Draft
wants to merge 211 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 198 commits
Commits
Show all changes
211 commits
Select commit Hold shift + click to select a range
18ea310
configure typescript
phillipc Dec 20, 2024
91eb802
+resolved the frist 1000 warnings
phillipc Dec 23, 2024
2b994e4
add some global types
phillipc Jan 2, 2025
2b40fa0
fix: check text/textcontent for comments / add test
phillipc Jan 2, 2025
f105406
fix some typescript warnings
phillipc Jan 3, 2025
11fd46e
fix some types:
phillipc Jan 3, 2025
617c335
Merge branch 'dockercontainer_and_fixed_deps_for_testing' into strong…
phillipc Jan 3, 2025
4b0b47f
Readme) some updates for the current stack
phillipc Jan 3, 2025
4a25a08
Observable Typings ...
mcselle Jan 3, 2025
1081dfb
Fixed TSC errors in utils
mcselle Jan 7, 2025
b4f4e98
Utils.Parser fixed tsc error
mcselle Jan 7, 2025
b47a40a
Fixed Typo
mcselle Jan 7, 2025
8b53a0e
fix tsc error
Auge19 Jan 9, 2025
d0b3ee6
Merge branch 'knockout:main' into strong_typed
phillipc Jan 9, 2025
f3abdd4
Merge remote-tracking branch 'origin/fixbrokenTest' into strong_typed
phillipc Jan 9, 2025
4c95467
TS)
phillipc Jan 9, 2025
5c1be03
ts) add assertion
phillipc Jan 9, 2025
cdcc9e4
Merge branch 'strong_typed' of https://github.com/Auge19/tko into str…
Auge19 Jan 10, 2025
5838247
fixing tsc errors
mcselle Jan 9, 2025
309b9f9
functionrewrite fix
mcselle Jan 9, 2025
26b3f73
more tsc fixes
mcselle Jan 10, 2025
9ceaf34
adding props to bindinghandler
Auge19 Jan 10, 2025
44b374b
Merge branch 'strong_typed' of https://github.com/Auge19/tko into str…
Auge19 Jan 10, 2025
a1124a2
fixed bindingDependencyBehaviors
Auge19 Jan 10, 2025
ed5e0cd
utils.component fixes
mcselle Jan 10, 2025
0392314
componentBindingBehaviour tsc fixed
Auge19 Jan 10, 2025
c9deeff
tsc fixes
mcselle Jan 10, 2025
1324f71
Merge commit '03923144a2ecb72fc8d41150c1707ae8badf4d24' into strong_t…
mcselle Jan 10, 2025
a08a992
foreach tsc fixed
Auge19 Jan 10, 2025
b978ee0
slotBinding tsc fixed
Auge19 Jan 10, 2025
03c30f9
optionsBehaviour tsc fixed
Auge19 Jan 10, 2025
30d2de4
tsc fixes
mcselle Jan 10, 2025
52d8568
tsc fixes
mcselle Jan 10, 2025
446a470
tsc fixes
mcselle Jan 10, 2025
b34e054
ts) fix some error / cleanup jasmine-helpers
phillipc Jan 11, 2025
7c2dda1
ts) fix tsc error
phillipc Jan 11, 2025
aa4826a
ts) fix errors -> only 343 errors left
phillipc Jan 12, 2025
9e380ad
ts) fix - 313 errors left
phillipc Jan 12, 2025
3d3670b
Merge branch 'knockout:main' into strong_typed
phillipc Jan 12, 2025
262c21a
applyBindings fixed tsc
Auge19 Jan 13, 2025
e555b8d
arrayToDomNodeChildren tsc fixed
Auge19 Jan 13, 2025
5541804
attrBehaviors tsc fixed
Auge19 Jan 13, 2025
d9b4f96
bindingHandlerBehaviors tsc fixed
Auge19 Jan 13, 2025
86c1571
eventBehaviors fixed tsc
Auge19 Jan 13, 2025
b30d474
hasfocusBehaviors fixed tsc
Auge19 Jan 13, 2025
871efb6
selectedOptionsBehaviors tsc fixed
Auge19 Jan 13, 2025
f79dc45
textBehaviors tixed tsc
Auge19 Jan 13, 2025
5691e2d
uniqueNameBehaviors fixed tsc
Auge19 Jan 13, 2025
f9e455f
usingBehaviors fixed tsc
Auge19 Jan 13, 2025
645393c
options fixed tsc
Auge19 Jan 13, 2025
97d49de
value fixed tsc
Auge19 Jan 13, 2025
f0dc912
ifBehaviors fixed tsc
Auge19 Jan 13, 2025
e31a1c3
fix tsc errors in foreachBehaviors
mcselle Jan 13, 2025
f32e418
fix more tsc issues
mcselle Jan 13, 2025
42047c9
deleted duplicated knockout typings
mcselle Jan 13, 2025
21df852
Moved Computed Types to packages/computed/types
mcselle Jan 13, 2025
0eac0bb
removed duplication
mcselle Jan 13, 2025
2d7062f
Merge branch 'strong_typed' of https://github.com/Auge19/tko into str…
Auge19 Jan 13, 2025
57bc24d
ifnotBehaviors tsc fixed
Auge19 Jan 13, 2025
7d4c442
withBehaviors fixed tsc
Auge19 Jan 13, 2025
b68fea7
ConditionalBindingHandler fixed tsc
Auge19 Jan 13, 2025
e937c18
else fixed tsc
Auge19 Jan 13, 2025
874514f
ifUnless tsc fixed
Auge19 Jan 13, 2025
6a0bdc9
with fixed tsc
Auge19 Jan 13, 2025
3608713
Moved types to package observabel
mcselle Jan 13, 2025
c78c758
added imports and added function to observable interface
mcselle Jan 13, 2025
5eaddd7
fixing tsc errors
mcselle Jan 13, 2025
949fce4
ts) fix errors - Found 158 errors in 31 files.
phillipc Jan 13, 2025
da0e02e
ts) fixes
phillipc Jan 13, 2025
b1f3b5a
ConditionalBindingHandler
Auge19 Jan 14, 2025
b07e22a
optionsBehaviors fixed tsc
Auge19 Jan 14, 2025
052db22
usingBehaviors fixed tsc
Auge19 Jan 14, 2025
2a212a5
dummyTemplateEngine fixed tsc
Auge19 Jan 14, 2025
09fff65
textinput fixed tsc, removed some Legacy IE Support => simply does no…
Auge19 Jan 14, 2025
52dd5e8
tsc error fixes
mcselle Jan 14, 2025
fe10cdd
Merge branch 'strong_typed' of https://github.com/Auge19/tko into str…
Auge19 Jan 14, 2025
0539723
componentBindingBehaviors fixed tsc
Auge19 Jan 14, 2025
25a5623
dummyTemplateEngine fixed tsc
Auge19 Jan 14, 2025
47f1a95
foreachBehaviors fixed tsc
Auge19 Jan 14, 2025
f17d603
templatingBehaviors fixed tsc
Auge19 Jan 14, 2025
68c692a
nativeTemplateEngine fixed tsc
Auge19 Jan 14, 2025
e971a07
templateEngine fixed tsc
Auge19 Jan 14, 2025
66b058b
templateSources fixed tsc
Auge19 Jan 14, 2025
77c7534
templating fixed tsc
Auge19 Jan 14, 2025
c54464b
asyncBehaviors fixed tsc
Auge19 Jan 14, 2025
4199362
computedObservableBehaviors fixed tsc
Auge19 Jan 14, 2025
6b65549
proxyBehavior fixed tsc
Auge19 Jan 14, 2025
0be6364
computed fixed tsc
Auge19 Jan 14, 2025
599b59c
mappingHelperBehaviors fixed tsc
Auge19 Jan 14, 2025
b1d53fa
BindingStringProviderBehaviors fixed tsc
Auge19 Jan 14, 2025
4d070f3
attributeInterpolationSpec fixed tsc
Auge19 Jan 14, 2025
8d660a6
AttributeMustacheProvider fixed tsc
Auge19 Jan 14, 2025
4dd0c3e
test fix
mcselle Jan 14, 2025
70aedb2
ComponentABCBehaviors fixed
Auge19 Jan 14, 2025
8781b75
jsxBehaviors fixed tsc
Auge19 Jan 14, 2025
81a0f4b
parserBehaviors fixed tsc
Auge19 Jan 14, 2025
c332264
loaderRegistryBehaviors fixed tsc
Auge19 Jan 14, 2025
374010f
LegacyBindingHandler fixed tsc
Auge19 Jan 14, 2025
9db040a
Merge branch 'knockout:main' into strong_typed
phillipc Jan 14, 2025
d077cee
Merge branch 'strong_typed' of https://github.com/Auge19/tko into str…
Auge19 Jan 14, 2025
e9c5bc2
eachBehavior fixed tsc over tsconfig
Auge19 Jan 14, 2025
36c3e87
eachBehavior fixed tsc
Auge19 Jan 14, 2025
2dd14b3
proxy fixed tsc
Auge19 Jan 14, 2025
20a71df
loaderRegistryBehaviors fixed tsc
Auge19 Jan 14, 2025
2f61cbc
subscribable fixed tsc
Auge19 Jan 14, 2025
1d6ee1e
NativeProviderBehaviors fixed tsc
Auge19 Jan 14, 2025
5325ed6
fix failure message
phillipc Jan 14, 2025
c8b3687
remove esModuleInterop
phillipc Jan 15, 2025
d9409a8
observable fixed tsc
Auge19 Jan 15, 2025
7fdeac4
forgot one tsc error
Auge19 Jan 15, 2025
c46b663
review changes | removed testNode in spec fixed types
mcselle Jan 15, 2025
bafc2ee
remove line break
phillipc Jan 15, 2025
3cb5653
code review | removed testNode
mcselle Jan 15, 2025
349f964
ts) remove testnode declaration
phillipc Jan 15, 2025
e539dc9
remove duplicated declaration: it's global
phillipc Jan 15, 2025
0b78eb9
code review | optional parameter
mcselle Jan 15, 2025
76784ff
code review | optional param
mcselle Jan 15, 2025
34d6676
code review | Timeout type set
mcselle Jan 15, 2025
f7b97de
optional parameter
mcselle Jan 15, 2025
b395db2
set functions as const to remove runtime error after bundling. Functi…
Auge19 Jan 17, 2025
d32f283
Merge remote-tracking branch 'origin/github_actions' into strong_type…
phillipc Jan 17, 2025
1687ffe
action) switch on tsc check
phillipc Jan 17, 2025
186f3db
ts) mv globale "options" to options.ts
phillipc Jan 17, 2025
3c2889b
ts) mv global defs
phillipc Jan 17, 2025
3ddfe8a
ts) mv globales to tko
phillipc Jan 17, 2025
aa514d0
ts) mv globales to TKO
phillipc Jan 17, 2025
aa5c0fb
ts) mv globals
phillipc Jan 17, 2025
9ea2eaf
ts) mv typings
phillipc Jan 17, 2025
f92a010
add return type
phillipc Jan 17, 2025
5386572
ts) fix review findings
phillipc Jan 20, 2025
faf6e56
types for bind
Auge19 Jan 20, 2025
1cda6b0
Merge branch 'strong_typed' of https://github.com/Auge19/tko into str…
Auge19 Jan 20, 2025
7965be7
types for binding.component
Auge19 Jan 20, 2025
79c7f85
ts) switching type to avoid down casts
phillipc Jan 20, 2025
b8d6680
ts) remove down cast
phillipc Jan 20, 2025
7757821
Merge branch 'knockout:main' into strong_typed
phillipc Jan 20, 2025
5e3deda
merge .d.ts into global
Auge19 Jan 21, 2025
1f0fb42
ts) add test cases
phillipc Jan 21, 2025
c0bb24e
moved util typings into corrosponding functions
mcselle Jan 21, 2025
594efcd
applied typings from global.d.ts => defaultLoader
mcselle Jan 22, 2025
1695010
aplly typings of global.d.ts to files
Auge19 Jan 22, 2025
3dfc00a
set bindingcontext in constructor function
Auge19 Jan 22, 2025
f39fb0b
typings for nativeTemplateEngine
mcselle Jan 22, 2025
15b27e7
comment unused tests
mcselle Jan 22, 2025
550a3f5
templateEngine moved
mcselle Jan 22, 2025
3edbcb9
first step setting type for bindingContext
Auge19 Jan 22, 2025
b6e4948
Merge branch 'strong_typed' of https://github.com/Auge19/tko into str…
Auge19 Jan 22, 2025
b806758
applied BindingContextExtendCallback as type
Auge19 Jan 22, 2025
70d10e1
add types to bindinghandler
Auge19 Jan 22, 2025
b1cb101
set context as any
Auge19 Jan 22, 2025
7d72037
utils arraychange update
mcselle Jan 22, 2025
9557972
Moved typings into arrayToDomNodeChildren
mcselle Jan 22, 2025
795ea72
review | applyBindings types
mcselle Jan 23, 2025
a3b89ea
review | componentBindingBehaviors removed unnecessary undefined
mcselle Jan 23, 2025
6de9e96
review | changed HTMLElement To Node ?
mcselle Jan 23, 2025
9b2b587
review | removed Function
mcselle Jan 23, 2025
59f4f4e
review | jsxobserver formatted + JSX interface bindingContext useing …
mcselle Jan 23, 2025
3db4b52
types for computed and subscribable from global
Auge19 Jan 23, 2025
d2a9d01
Merge branch 'strong_typed' of https://github.com/Auge19/tko into str…
Auge19 Jan 23, 2025
b153f3c
update observable types
Auge19 Jan 23, 2025
cc6b36b
add types to observablearray
Auge19 Jan 23, 2025
ab408be
ts) correct some types
phillipc Jan 24, 2025
7b649f3
ts) delete portet d.ts types / fix loaders and registry
phillipc Jan 24, 2025
a1807b9
ts) port templating types / order globales
phillipc Jan 24, 2025
067a46c
ts) add comment
phillipc Jan 24, 2025
a91603d
review | more types some formatting
mcselle Jan 24, 2025
3b55d6a
review | nativeprovider type
mcselle Jan 24, 2025
3202a5d
review | removed yarn.lock
mcselle Jan 24, 2025
be57808
review | better type
mcselle Jan 24, 2025
0c464c5
adjusted import path
Auge19 Jan 24, 2025
2127974
set types to dataprovider
Auge19 Jan 24, 2025
0682e9d
review | more types in foreach
mcselle Jan 24, 2025
b240067
add types to providers
Auge19 Jan 24, 2025
544572a
Merge branch 'strong_typed' of https://github.com/Auge19/tko into str…
Auge19 Jan 24, 2025
5196ab5
set types to virtualprovider
Auge19 Jan 24, 2025
b9f0238
ts) some type corrections
phillipc Jan 26, 2025
f3a3950
set types to disposal
Auge19 Jan 27, 2025
0e28005
ts) Provider: HTMLElement | Node -> to Element
phillipc Jan 27, 2025
b596be2
ts) remove wrong import
phillipc Jan 27, 2025
3756af4
ts) extend BaseExtendersType interface
phillipc Jan 27, 2025
49341b8
undo signature change
Auge19 Jan 27, 2025
289dd4f
set type for mappingInvocations
Auge19 Jan 27, 2025
b10a721
handler is optional
Auge19 Jan 27, 2025
e8a2c1a
enable IE 8 and 9 support again
Auge19 Jan 27, 2025
6400abb
ts) the interface "ProviderParamsInput" must be global
phillipc Jan 27, 2025
44868d3
ts) no static dependency to AttributeMustacheProvider |and TextMustac…
phillipc Jan 27, 2025
d78868f
ts) remove mocha from src
phillipc Jan 27, 2025
d486835
Merge branch 'strong_typed' of https://github.com/Auge19/tko into str…
Auge19 Jan 27, 2025
a0f6478
ts) fix import
phillipc Jan 27, 2025
e51d20d
remove any
Auge19 Jan 27, 2025
74e783d
Merge branch 'strong_typed' of https://github.com/Auge19/tko into str…
Auge19 Jan 27, 2025
3cedcfd
add types to async
Auge19 Jan 27, 2025
5b5c411
add types to event
Auge19 Jan 27, 2025
9f414cb
simplyfied testnode
Auge19 Jan 27, 2025
56eea9d
fixed tsc
Auge19 Jan 27, 2025
0e83f16
ts) bindingprovider is typed
phillipc Jan 27, 2025
fffce59
mv code
phillipc Jan 27, 2025
6470a54
ts) please, no ts-ignore / IE8 to 9 may not have worked
phillipc Jan 27, 2025
c48c110
rm obsolete comment
phillipc Jan 27, 2025
a5756b4
ts) fix import
phillipc Jan 27, 2025
21406d5
set types to textInputBehaviour
Auge19 Jan 28, 2025
3daf3ca
review | Bindinghandler typings
mcselle Jan 28, 2025
b7b294b
use ReturnType<typeof setTimeout>;
phillipc Jan 28, 2025
8f92625
fix: isInputElement -> isInput
phillipc Jan 28, 2025
ce1f543
ts) remove unused imports
phillipc Jan 28, 2025
e391b71
hasFocus fix
Auge19 Jan 30, 2025
83c2337
Merge commit 'e391b71b40c2065771bc7ccd21ac581825fb0ace' into strong_t…
mcselle Jan 30, 2025
2127388
ts) jsx-constructor properties
phillipc Jan 30, 2025
0238738
Merge branch 'main' into strong_typed
phillipc Jan 30, 2025
b7e9f99
format) spaces after merging
phillipc Jan 31, 2025
2e14bc9
add test-case for focus
phillipc Jan 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/run-tsc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ jobs:

- name: Run tsc
run: npx tsc
continue-on-error: true
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ ci:
lint:
$(NPX) standard

tsc:
$(NPX) tsc

docker-build:
$(DOCKER) build . --tag tko

Expand Down
61 changes: 36 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,51 +35,41 @@ It's available as `@tko/build.knockout`, and over CDN:
| Command | Effect |
| ------- | ------ |
| $ `git clone git@github.com:knockout/tko` | Clone the repository. |
| $ `npm install -g yarn` | Ensure yarn is globally available |
| $ `yarn` | Install local node packages and link tko modules |
| $ `make` | **Currently TKO use a make file** |
| $ `yarn test` | Run all tests. See below. |
| $ `yarn watch` | Run all tests and watch for changes. See below. |
| $ `yarn build` | Build tko\[.module\]\[.es6\]\[.min\].js files, where `.es6` version has not been transpiled |
| $ `npm install` | Ensure that all packages available |
| $ `make` | **Currently TKO use a make file** / no scripts at package.json |
| $ `make test` | Run all tests with electron. See below. |
| $ `make test-headless` | Run all tests with chromium. See below. |
| $ `lerna publish` | Bump versions and publish to npm registry |

Checkout `package.json => scripts` for more commands that can be executed with `yarn {command}`.
Checkout the `Makefile` for more commands that can be executed with `make {command}`.

In each individual `packages/*/` directory, you can also run (presuming `rollup` and `karma` are installed globally):
In each individual `packages/*/` directory, you can also run:

| Command | Effect |
| --- | --- |
| $ `karma COMMAND ../../karma.conf.js [--once]` | Test the local package, where COMMAND is e.g. `start` or `run` |
| $ `rollup -c ../../rollup.config.js` | Build the package into the local `dist/` |

#### Testing with `yarn test` and `yarn watch`

### NEW
### Testing

Start tests with electron: `make test`

Start tests with headless-chrome: `make test-headless`

### OLD

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
specific to that package.
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

Optional arguments to `yarn test` include:
Other options:

- `--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.
- `--noStartConnect` — Do not start a new Sauce Connect proxy instance for every
test; requires that Sauce Connect be already running.
- `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.

#### `visual.html`
#### `visual.html` (possibly outdated)

Note that running `karma` or `rollup` will create a `visual.html` file that shows the proportional size of imports into each package.
Note that running `karma` will create a `visual.html` file that shows the proportional size of imports into each package.

### Objectives
## Objectives

TKO aims to become a base for future versions of Knockout. The objectives include:

- Modularization into ES6 and separate projects, with compilation using an ES6 compiler like [Rollup](http://rollupjs.org/). This solves several problems with Knockout, including:
- 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:
- Some folks want to roll-their-own with e.g. removing components
- 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)
- The compilation of Knockout is just concatenation, leading to difficulties with maintainance, severance, and replacement
Expand All @@ -90,6 +80,27 @@ TKO aims to become a base for future versions of Knockout. The objectives inclu
- What should be simple plugins (e.g. binding handlers or providers) are complex, including:
- 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
- Quality plugins have lots of boilerplate for compilation, release, documentation, and testing
- Type-safe with Typescript
- CSP compliant
- JSX/TSX support

## Overview of the development stack

- **make** -> Build tasks
- **npm** -> Node Package Manager
- **esbuild** -> ts/js compiler and bundler
- **lerna** -> mono-repo build-chain

---

- Test-Runner -> Karma
- Test-Environment -> electron and headless-chrome
- TDD/BDD-Frameworks ->
- Jasmine 1.3
- Mocha + Chai
- sinon (Mocks)
- Testing-Cloud-Service -> sauce
- standard -> Code-Style (outdated for typescript)

## Some WSL tricks

Expand Down Expand Up @@ -122,6 +133,6 @@ MIT license - [http://www.opensource.org/licenses/mit-license.php.](http://www.o

<div>
<a href='http://browserstack.com'>
<img height=150px src='https://p3.zdusercontent.com/attachment/1015988/gTNrZ9vPjL8ThUHOWP7ucklJi?token=eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0..HkCKDttXKDSGFoV5uaMPQA.ha9NDy63mjLKFcyNeib70TCkqfY0dcwiFwDYpZ8s5h75o-e1_cLjPAHlOUEwvKAbfMUaa1XpOL5F9AQd_B4iyc6JbgvKoKBxxe12aaOdfWFccP7r9iQ2Os6myiqBpP79prDXqFPMSAkF8ybzhVqCnWzxmK-Wvkbav-DGPZm3oS2IPD9ueIvf46bggFsikQhf1pjS5fgmzo07yi9Cf5SzA8zIKAjKX1RKQeFXOhBwxRfh_5SbJprfEZMnKBnGuO_qzP2fsK3BvxbyBKpIEWFdnA.t10i3BbyEpGtFVgyGbvQfw' alt='Browser Stack' />
Browser Stack
</a>
<div>
Loading
Loading