From d4cd0329f7af4a8cf12b43e8c8ed8bd6beeb8a17 Mon Sep 17 00:00:00 2001 From: Daniel Dickison Date: Fri, 6 May 2022 12:10:30 -0700 Subject: [PATCH 01/10] Re-enable knockout build tests and fix dummyTemplateEngine import --- builds/knockout/Makefile | 3 --- builds/knockout/spec/crossWindowBehaviors.js | 2 +- builds/knockout/spec/templatingBehaviors.js | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/builds/knockout/Makefile b/builds/knockout/Makefile index de40db9f..7f84d6b2 100644 --- a/builds/knockout/Makefile +++ b/builds/knockout/Makefile @@ -3,9 +3,6 @@ include ../../tools/build.mk iife-global-name := ko -test: - @echo "Disabled pending fixes to build process" - default:: $(MAKE) browser diff --git a/builds/knockout/spec/crossWindowBehaviors.js b/builds/knockout/spec/crossWindowBehaviors.js index afcaaaf2..e4a4dd04 100644 --- a/builds/knockout/spec/crossWindowBehaviors.js +++ b/builds/knockout/spec/crossWindowBehaviors.js @@ -1,4 +1,4 @@ - +import { dummyTemplateEngine } from "./templatingBehaviors"; describe('Cross-window support', function() { it('Should work in another window', function () { diff --git a/builds/knockout/spec/templatingBehaviors.js b/builds/knockout/spec/templatingBehaviors.js index eee622bc..0e4741ac 100644 --- a/builds/knockout/spec/templatingBehaviors.js +++ b/builds/knockout/spec/templatingBehaviors.js @@ -1,5 +1,5 @@ -var dummyTemplateEngine = function (templates) { +export var dummyTemplateEngine = function (templates) { var inMemoryTemplates = templates || {}; var inMemoryTemplateData = {}; From 69f79818f7ae8f348d32d387293b4d31318f1410 Mon Sep 17 00:00:00 2001 From: Brian M Hunt Date: Tue, 10 May 2022 16:37:27 -0400 Subject: [PATCH 02/10] observable) replace `objectLookup` with canonical `Map` --- packages/observable/src/mappingHelpers.ts | 29 ++--------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/packages/observable/src/mappingHelpers.ts b/packages/observable/src/mappingHelpers.ts index e7beb4a0..78a78e69 100644 --- a/packages/observable/src/mappingHelpers.ts +++ b/packages/observable/src/mappingHelpers.ts @@ -3,9 +3,6 @@ // --- // toJS & toJSON // -import { - arrayIndexOf -} from '@tko/utils' import { isObservable } from './observable' @@ -27,15 +24,13 @@ export function toJSON (rootObject, replacer, space) { // replacer and space return JSON.stringify(plainJavaScriptObject, replacer, space) } -function mapJsObjectGraph (rootObject, mapInputCallback, visitedObjects) { - visitedObjects = visitedObjects || new objectLookup() - +function mapJsObjectGraph (rootObject, mapInputCallback, visitedObjects = new Map()) { rootObject = mapInputCallback(rootObject) var canHaveProperties = (typeof rootObject === 'object') && (rootObject !== null) && (rootObject !== undefined) && (!(rootObject instanceof RegExp)) && (!(rootObject instanceof Date)) && (!(rootObject instanceof String)) && (!(rootObject instanceof Number)) && (!(rootObject instanceof Boolean)) if (!canHaveProperties) { return rootObject } var outputProperties = rootObject instanceof Array ? [] : {} - visitedObjects.save(rootObject, outputProperties) + visitedObjects.set(rootObject, outputProperties) visitPropertiesOrArrayEntries(rootObject, function (indexer) { var propertyValue = mapInputCallback(rootObject[indexer]) @@ -72,23 +67,3 @@ function visitPropertiesOrArrayEntries (rootObject, visitorCallback) { } } } - -function objectLookup () { - this.keys = [] - this.values = [] -} - -objectLookup.prototype = { - constructor: objectLookup, - save: function (key, value) { - var existingIndex = arrayIndexOf(this.keys, key) - if (existingIndex >= 0) { this.values[existingIndex] = value } else { - this.keys.push(key) - this.values.push(value) - } - }, - get: function (key) { - var existingIndex = arrayIndexOf(this.keys, key) - return (existingIndex >= 0) ? this.values[existingIndex] : undefined - } -} From 34a53e5f914b050d2141be76061bac26bdc33026 Mon Sep 17 00:00:00 2001 From: Brian M Hunt Date: Wed, 11 May 2022 09:42:20 -0400 Subject: [PATCH 03/10] changelog) add note re. objectLookup => `Map` --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16b3e329..0d1bc0a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ For TODO between alpha and release, see https://github.com/knockout/tko/issues/1 ## upcoming +- replace `objectLookup` with `Map` in `toJS` for O(n) instead of O(n²) computational complexity (#170 @brianmhunt) - fix equality comparison for select option values (#155/#163 @danieldickison) - fix identifier set_value in parser (#157/#161 @danieldickison) - remove mustache from text/attr bindings by default (#156 @danieldickison) From 5b72d0a8e9b9fbf306502f60ab8601da8e8b1199 Mon Sep 17 00:00:00 2001 From: Brian M Hunt Date: Thu, 12 May 2022 10:38:52 -0400 Subject: [PATCH 04/10] builds) fix build exports for ESM --- CHANGELOG.md | 4 ++-- builds/knockout/src/{index.js => index.ts} | 0 builds/reference/src/{index.js => index.ts} | 0 tools/build.mk | 4 ++-- 4 files changed, 4 insertions(+), 4 deletions(-) rename builds/knockout/src/{index.js => index.ts} (100%) rename builds/reference/src/{index.js => index.ts} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d1bc0a3..bb531adc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,13 @@ For TODO between alpha and release, see https://github.com/knockout/tko/issues/1 ## upcoming -- replace `objectLookup` with `Map` in `toJS` for O(n) instead of O(n²) computational complexity (#170 @brianmhunt) +- replace `objectLookup` with `Map` in `toJS` for O(n) instead of O(n²) computational complexity (#170 @felipesantoz) - fix equality comparison for select option values (#155/#163 @danieldickison) - fix identifier set_value in parser (#157/#161 @danieldickison) - remove mustache from text/attr bindings by default (#156 @danieldickison) - knockout function rewrite improvements (#156 @danieldickison) - change parsing algorithm to Shunting Yard (#151 @danieldickison) -- Switch to `esbuild` +- Switch to `esbuild` (likely breaks existing imports/require/etc) - add `preventDefault` to event handler bindings - switch source to Typescript (but no types exported yet) - change build.reference & build.knockout build export strategy diff --git a/builds/knockout/src/index.js b/builds/knockout/src/index.ts similarity index 100% rename from builds/knockout/src/index.js rename to builds/knockout/src/index.ts diff --git a/builds/reference/src/index.js b/builds/reference/src/index.ts similarity index 100% rename from builds/reference/src/index.js rename to builds/reference/src/index.ts diff --git a/tools/build.mk b/tools/build.mk index ed44b927..41bdd809 100644 --- a/tools/build.mk +++ b/tools/build.mk @@ -43,7 +43,7 @@ dist/index.js: $(src) package.json --define:BUILD_VERSION='"${version}"' \ --sourcemap=external \ --outdir=dist/ \ - $(src) + src/index.ts # Build a CommonJS bundle, targetting ES6. dist/index.cjs: $(src) package.json @@ -75,7 +75,7 @@ dist/browser.min.js: $(src) package.json --minify \ --sourcemap=external \ --outfile=$@ \ - ./src/index.js + ./src/index.ts repackage: $(tools_dir)/repackage.mjs ../../lerna.json node $(tools_dir)/repackage.mjs From 8e17e4205cba2603dfe6bc99806cdfaa1daa34a4 Mon Sep 17 00:00:00 2001 From: Brian M Hunt Date: Thu, 12 May 2022 10:48:51 -0400 Subject: [PATCH 05/10] make) Add comments to top-level Makefile --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 5a30e290..892008d3 100644 --- a/Makefile +++ b/Makefile @@ -28,9 +28,12 @@ ci: lint: $(NPX) standard +# Run the `repackage` target in every directory. Essentially +# homogenizes the `package.json`. repackage: tools/repackage.mjs $(LERNA) exec --stream -- $(MAKE) repackage +# Run to update the versions of all the package.json files, before publishing. bump: $(LERNA) version From fd4b325856a0ec1ebe10ffff11cc046e5830b26e Mon Sep 17 00:00:00 2001 From: Brian M Hunt Date: Thu, 12 May 2022 10:50:40 -0400 Subject: [PATCH 06/10] v4.0.0-beta1.0 --- builds/knockout/package.json | 32 ++++++++--------- builds/reference/package.json | 36 ++++++++++---------- lerna.json | 2 +- packages/bind/package.json | 12 +++---- packages/binding.component/package.json | 16 ++++----- packages/binding.core/package.json | 12 +++---- packages/binding.foreach/package.json | 12 +++---- packages/binding.if/package.json | 12 +++---- packages/binding.template/package.json | 10 +++--- packages/builder/package.json | 16 ++++----- packages/computed/package.json | 8 ++--- packages/filter.punches/package.json | 6 ++-- packages/lifecycle/package.json | 6 ++-- packages/observable/package.json | 6 ++-- packages/provider.attr/package.json | 6 ++-- packages/provider.bindingstring/package.json | 8 ++--- packages/provider.component/package.json | 16 ++++----- packages/provider.databind/package.json | 6 ++-- packages/provider.multi/package.json | 6 ++-- packages/provider.mustache/package.json | 14 ++++---- packages/provider.native/package.json | 6 ++-- packages/provider.virtual/package.json | 8 ++--- packages/provider/package.json | 6 ++-- packages/utils.component/package.json | 8 ++--- packages/utils.functionrewrite/package.json | 4 +-- packages/utils.jsx/package.json | 16 ++++----- packages/utils.parser/package.json | 6 ++-- packages/utils/package.json | 4 +-- 28 files changed, 150 insertions(+), 150 deletions(-) diff --git a/builds/knockout/package.json b/builds/knockout/package.json index 5bd15e98..f6e9ee8a 100644 --- a/builds/knockout/package.json +++ b/builds/knockout/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha9.0", + "version": "4.0.0-beta1.0", "name": "@tko/build.knockout", "description": "Knockout makes it easier to create rich, responsive UIs with JavaScript", "homepage": "https://tko.io", @@ -46,21 +46,21 @@ } ], "dependencies": { - "@tko/binding.component": "^4.0.0-alpha9.0", - "@tko/binding.core": "^4.0.0-alpha9.0", - "@tko/binding.foreach": "^4.0.0-alpha9.0", - "@tko/binding.if": "^4.0.0-alpha9.0", - "@tko/binding.template": "^4.0.0-alpha9.0", - "@tko/builder": "^4.0.0-alpha9.0", - "@tko/filter.punches": "^4.0.0-alpha8.0", - "@tko/provider.attr": "^4.0.0-alpha8.4", - "@tko/provider.bindingstring": "^4.0.0-alpha9.0", - "@tko/provider.component": "^4.0.0-alpha9.0", - "@tko/provider.databind": "^4.0.0-alpha9.0", - "@tko/provider.multi": "^4.0.0-alpha8.4", - "@tko/provider.virtual": "^4.0.0-alpha9.0", - "@tko/utils.component": "^4.0.0-alpha9.0", - "@tko/utils.functionrewrite": "^4.0.0-alpha8.2", + "@tko/binding.component": "^4.0.0-beta1.0", + "@tko/binding.core": "^4.0.0-beta1.0", + "@tko/binding.foreach": "^4.0.0-beta1.0", + "@tko/binding.if": "^4.0.0-beta1.0", + "@tko/binding.template": "^4.0.0-beta1.0", + "@tko/builder": "^4.0.0-beta1.0", + "@tko/filter.punches": "^4.0.0-beta1.0", + "@tko/provider.attr": "^4.0.0-beta1.0", + "@tko/provider.bindingstring": "^4.0.0-beta1.0", + "@tko/provider.component": "^4.0.0-beta1.0", + "@tko/provider.databind": "^4.0.0-beta1.0", + "@tko/provider.multi": "^4.0.0-beta1.0", + "@tko/provider.virtual": "^4.0.0-beta1.0", + "@tko/utils.component": "^4.0.0-beta1.0", + "@tko/utils.functionrewrite": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "exports": { diff --git a/builds/reference/package.json b/builds/reference/package.json index 1cb9b8e3..33f703d8 100644 --- a/builds/reference/package.json +++ b/builds/reference/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha9.0", + "version": "4.0.0-beta1.0", "name": "@tko/build.reference", "description": "The TKO Reference Build", "repository": { @@ -15,23 +15,23 @@ }, "license": "MIT", "dependencies": { - "@tko/binding.component": "^4.0.0-alpha9.0", - "@tko/binding.core": "^4.0.0-alpha9.0", - "@tko/binding.foreach": "^4.0.0-alpha9.0", - "@tko/binding.if": "^4.0.0-alpha9.0", - "@tko/binding.template": "^4.0.0-alpha9.0", - "@tko/builder": "^4.0.0-alpha9.0", - "@tko/filter.punches": "^4.0.0-alpha8.0", - "@tko/provider.attr": "^4.0.0-alpha8.4", - "@tko/provider.bindingstring": "^4.0.0-alpha9.0", - "@tko/provider.component": "^4.0.0-alpha9.0", - "@tko/provider.databind": "^4.0.0-alpha9.0", - "@tko/provider.multi": "^4.0.0-alpha8.4", - "@tko/provider.mustache": "^4.0.0-alpha9.0", - "@tko/provider.native": "^4.0.0-alpha8.4a", - "@tko/provider.virtual": "^4.0.0-alpha9.0", - "@tko/utils.component": "^4.0.0-alpha9.0", - "@tko/utils.jsx": "^4.0.0-alpha9.0", + "@tko/binding.component": "^4.0.0-beta1.0", + "@tko/binding.core": "^4.0.0-beta1.0", + "@tko/binding.foreach": "^4.0.0-beta1.0", + "@tko/binding.if": "^4.0.0-beta1.0", + "@tko/binding.template": "^4.0.0-beta1.0", + "@tko/builder": "^4.0.0-beta1.0", + "@tko/filter.punches": "^4.0.0-beta1.0", + "@tko/provider.attr": "^4.0.0-beta1.0", + "@tko/provider.bindingstring": "^4.0.0-beta1.0", + "@tko/provider.component": "^4.0.0-beta1.0", + "@tko/provider.databind": "^4.0.0-beta1.0", + "@tko/provider.multi": "^4.0.0-beta1.0", + "@tko/provider.mustache": "^4.0.0-beta1.0", + "@tko/provider.native": "^4.0.0-beta1.0", + "@tko/provider.virtual": "^4.0.0-beta1.0", + "@tko/utils.component": "^4.0.0-beta1.0", + "@tko/utils.jsx": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "files": [ diff --git a/lerna.json b/lerna.json index b0250bd2..e4b4e7cf 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "useWorkspaces": true, - "version": "4.0.0-alpha9.0", + "version": "4.0.0-beta1.0", "lerna": "4.0.0" } diff --git a/packages/bind/package.json b/packages/bind/package.json index 69163d8f..a3ea1ac9 100644 --- a/packages/bind/package.json +++ b/packages/bind/package.json @@ -1,14 +1,14 @@ { - "version": "4.0.0-alpha9.0", + "version": "4.0.0-beta1.0", "name": "@tko/bind", "description": "TKO DOM-Observable Binding", "module": "dist/bind.js", "dependencies": { - "@tko/computed": "^4.0.0-alpha8.0", - "@tko/lifecycle": "^4.0.0-alpha9.0", - "@tko/observable": "^4.0.0-alpha8.0", - "@tko/provider": "^4.0.0-alpha8.4", - "@tko/utils": "^4.0.0-alpha8.0", + "@tko/computed": "^4.0.0-beta1.0", + "@tko/lifecycle": "^4.0.0-beta1.0", + "@tko/observable": "^4.0.0-beta1.0", + "@tko/provider": "^4.0.0-beta1.0", + "@tko/utils": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "peerDependencies": { diff --git a/packages/binding.component/package.json b/packages/binding.component/package.json index f66bcbc5..6bef1e86 100644 --- a/packages/binding.component/package.json +++ b/packages/binding.component/package.json @@ -1,17 +1,17 @@ { - "version": "4.0.0-alpha9.0", + "version": "4.0.0-beta1.0", "name": "@tko/binding.component", "description": "component: binding for web components", "module": "dist/binding.component.js", "license": "MIT", "dependencies": { - "@tko/bind": "^4.0.0-alpha9.0", - "@tko/lifecycle": "^4.0.0-alpha9.0", - "@tko/observable": "^4.0.0-alpha8.0", - "@tko/provider": "^4.0.0-alpha8.4", - "@tko/utils": "^4.0.0-alpha8.0", - "@tko/utils.jsx": "^4.0.0-alpha8.0", - "@tko/utils.component": "^4.0.0-alpha9.0", + "@tko/bind": "^4.0.0-beta1.0", + "@tko/lifecycle": "^4.0.0-beta1.0", + "@tko/observable": "^4.0.0-beta1.0", + "@tko/provider": "^4.0.0-beta1.0", + "@tko/utils": "^4.0.0-beta1.0", + "@tko/utils.component": "^4.0.0-beta1.0", + "@tko/utils.jsx": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "files": [ diff --git a/packages/binding.core/package.json b/packages/binding.core/package.json index 37064989..2f4f243a 100644 --- a/packages/binding.core/package.json +++ b/packages/binding.core/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha9.0", + "version": "4.0.0-beta1.0", "name": "@tko/binding.core", "description": "TKO Core bindings", "module": "dist/binding.core.js", @@ -23,10 +23,10 @@ }, "homepage": "https://tko.io", "dependencies": { - "@tko/bind": "^4.0.0-alpha9.0", - "@tko/computed": "^4.0.0-alpha8.0", - "@tko/observable": "^4.0.0-alpha8.0", - "@tko/utils": "^4.0.0-alpha8.0", + "@tko/bind": "^4.0.0-beta1.0", + "@tko/computed": "^4.0.0-beta1.0", + "@tko/observable": "^4.0.0-beta1.0", + "@tko/utils": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "karma": { @@ -47,4 +47,4 @@ }, "./helpers/*": "./helpers/*" } -} \ No newline at end of file +} diff --git a/packages/binding.foreach/package.json b/packages/binding.foreach/package.json index 78ca7870..831ff8ec 100644 --- a/packages/binding.foreach/package.json +++ b/packages/binding.foreach/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha9.0", + "version": "4.0.0-beta1.0", "name": "@tko/binding.foreach", "description": "Knockout Foreach Binding", "module": "dist/binding.foreach.js", @@ -23,10 +23,10 @@ }, "homepage": "https://tko.io", "dependencies": { - "@tko/bind": "^4.0.0-alpha9.0", - "@tko/observable": "^4.0.0-alpha8.0", - "@tko/provider": "^4.0.0-alpha8.4", - "@tko/utils": "^4.0.0-alpha8.0", + "@tko/bind": "^4.0.0-beta1.0", + "@tko/observable": "^4.0.0-beta1.0", + "@tko/provider": "^4.0.0-beta1.0", + "@tko/utils": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "karma": { @@ -49,4 +49,4 @@ }, "./helpers/*": "./helpers/*" } -} \ No newline at end of file +} diff --git a/packages/binding.if/package.json b/packages/binding.if/package.json index ff9a12ac..e187e714 100644 --- a/packages/binding.if/package.json +++ b/packages/binding.if/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha9.0", + "version": "4.0.0-beta1.0", "name": "@tko/binding.if", "description": "TKO conditional (if/ifnot/unless/with/else) bindings", "module": "dist/binding.if.js", @@ -23,10 +23,10 @@ }, "homepage": "https://tko.io", "dependencies": { - "@tko/bind": "^4.0.0-alpha9.0", - "@tko/computed": "^4.0.0-alpha8.0", - "@tko/observable": "^4.0.0-alpha8.0", - "@tko/utils": "^4.0.0-alpha8.0", + "@tko/bind": "^4.0.0-beta1.0", + "@tko/computed": "^4.0.0-beta1.0", + "@tko/observable": "^4.0.0-beta1.0", + "@tko/utils": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "karma": { @@ -47,4 +47,4 @@ }, "./helpers/*": "./helpers/*" } -} \ No newline at end of file +} diff --git a/packages/binding.template/package.json b/packages/binding.template/package.json index a272d679..5bae5390 100644 --- a/packages/binding.template/package.json +++ b/packages/binding.template/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha9.0", + "version": "4.0.0-beta1.0", "name": "@tko/binding.template", "description": "TKO Template bindings", "module": "dist/binding.template.js", @@ -23,10 +23,10 @@ }, "homepage": "https://tko.io", "dependencies": { - "@tko/bind": "^4.0.0-alpha9.0", - "@tko/computed": "^4.0.0-alpha8.0", - "@tko/observable": "^4.0.0-alpha8.0", - "@tko/utils": "^4.0.0-alpha8.0", + "@tko/bind": "^4.0.0-beta1.0", + "@tko/computed": "^4.0.0-beta1.0", + "@tko/observable": "^4.0.0-beta1.0", + "@tko/utils": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "karma": { diff --git a/packages/builder/package.json b/packages/builder/package.json index 4efc7e3c..03c5dbc0 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha9.0", + "version": "4.0.0-beta1.0", "name": "@tko/builder", "description": "Compile a customized instance of Knockout.", "repository": { @@ -9,13 +9,13 @@ "author": "The Knockout Team", "license": "MIT", "dependencies": { - "@tko/bind": "^4.0.0-alpha9.0", - "@tko/computed": "^4.0.0-alpha8.0", - "@tko/filter.punches": "^4.0.0-alpha8.0", - "@tko/lifecycle": "^4.0.0-alpha9.0", - "@tko/observable": "^4.0.0-alpha8.0", - "@tko/utils": "^4.0.0-alpha8.0", - "@tko/utils.parser": "^4.0.0-alpha9.0", + "@tko/bind": "^4.0.0-beta1.0", + "@tko/computed": "^4.0.0-beta1.0", + "@tko/filter.punches": "^4.0.0-beta1.0", + "@tko/lifecycle": "^4.0.0-beta1.0", + "@tko/observable": "^4.0.0-beta1.0", + "@tko/utils": "^4.0.0-beta1.0", + "@tko/utils.parser": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "homepage": "https://tko.io", diff --git a/packages/computed/package.json b/packages/computed/package.json index a0006bc1..e3561a7d 100644 --- a/packages/computed/package.json +++ b/packages/computed/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha8.0", + "version": "4.0.0-beta1.0", "name": "@tko/computed", "description": "TKO Computed Observables", "module": "dist/computed.js", @@ -8,8 +8,8 @@ "helpers/" ], "dependencies": { - "@tko/observable": "^4.0.0-alpha8.0", - "@tko/utils": "^4.0.0-alpha8.0", + "@tko/observable": "^4.0.0-beta1.0", + "@tko/utils": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "repository": { @@ -44,4 +44,4 @@ }, "./helpers/*": "./helpers/*" } -} \ No newline at end of file +} diff --git a/packages/filter.punches/package.json b/packages/filter.punches/package.json index 224ecb6c..64ceac6f 100644 --- a/packages/filter.punches/package.json +++ b/packages/filter.punches/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha8.0", + "version": "4.0.0-beta1.0", "name": "@tko/filter.punches", "description": "TKO filters from knockout punches", "module": "dist/filter.punches.js", @@ -23,7 +23,7 @@ }, "homepage": "https://tko.io", "dependencies": { - "@tko/observable": "^4.0.0-alpha8.0", + "@tko/observable": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "karma": { @@ -44,4 +44,4 @@ }, "./helpers/*": "./helpers/*" } -} \ No newline at end of file +} diff --git a/packages/lifecycle/package.json b/packages/lifecycle/package.json index d3a48361..2556d53f 100644 --- a/packages/lifecycle/package.json +++ b/packages/lifecycle/package.json @@ -1,9 +1,9 @@ { - "version": "4.0.0-alpha9.0", + "version": "4.0.0-beta1.0", "module": "dist/lifecycle.js", "dependencies": { - "@tko/computed": "^4.0.0-alpha8.0", - "@tko/utils": "^4.0.0-alpha8.0", + "@tko/computed": "^4.0.0-beta1.0", + "@tko/utils": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "peerDependencies": { diff --git a/packages/observable/package.json b/packages/observable/package.json index 4391d61d..98ea2287 100644 --- a/packages/observable/package.json +++ b/packages/observable/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha8.0", + "version": "4.0.0-beta1.0", "name": "@tko/observable", "description": "TKO subscribables and observables", "repository": { @@ -31,7 +31,7 @@ }, "homepage": "https://tko.io", "dependencies": { - "@tko/utils": "^4.0.0-alpha8.0", + "@tko/utils": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "karma": { @@ -45,4 +45,4 @@ "url": "https://opensource.org/licenses/MIT" } ] -} \ No newline at end of file +} diff --git a/packages/provider.attr/package.json b/packages/provider.attr/package.json index 6d890049..eced34d8 100644 --- a/packages/provider.attr/package.json +++ b/packages/provider.attr/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha8.4", + "version": "4.0.0-beta1.0", "name": "@tko/provider.attr", "description": "Link HTML attributes (e.g. ko-handler-name) to binding handlers", "module": "dist/provider.attr.js", @@ -9,7 +9,7 @@ ], "license": "MIT", "dependencies": { - "@tko/provider": "^4.0.0-alpha8.4", + "@tko/provider": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "karma": { @@ -40,4 +40,4 @@ "type": "git", "url": "git+https://github.com/knockout/tko.git" } -} \ No newline at end of file +} diff --git a/packages/provider.bindingstring/package.json b/packages/provider.bindingstring/package.json index c444adb8..445df038 100644 --- a/packages/provider.bindingstring/package.json +++ b/packages/provider.bindingstring/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha9.0", + "version": "4.0.0-beta1.0", "name": "@tko/provider.bindingstring", "description": "Abstract Base Class for providers that parse a binding string", "module": "dist/provider.bindingString.js", @@ -9,8 +9,8 @@ ], "license": "MIT", "dependencies": { - "@tko/provider": "^4.0.0-alpha8.4", - "@tko/utils.parser": "^4.0.0-alpha9.0", + "@tko/provider": "^4.0.0-beta1.0", + "@tko/utils.parser": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "karma": { @@ -41,4 +41,4 @@ "type": "git", "url": "git+https://github.com/knockout/tko.git" } -} \ No newline at end of file +} diff --git a/packages/provider.component/package.json b/packages/provider.component/package.json index 0fa5bd20..0ee950b9 100644 --- a/packages/provider.component/package.json +++ b/packages/provider.component/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha9.0", + "version": "4.0.0-beta1.0", "name": "@tko/provider.component", "description": "Bind custom web components e.g. ", "module": "dist/provider.component.js", @@ -9,12 +9,12 @@ ], "license": "MIT", "dependencies": { - "@tko/computed": "^4.0.0-alpha8.0", - "@tko/observable": "^4.0.0-alpha8.0", - "@tko/provider": "^4.0.0-alpha8.4", - "@tko/utils": "^4.0.0-alpha8.0", - "@tko/utils.component": "^4.0.0-alpha9.0", - "@tko/utils.parser": "^4.0.0-alpha9.0", + "@tko/computed": "^4.0.0-beta1.0", + "@tko/observable": "^4.0.0-beta1.0", + "@tko/provider": "^4.0.0-beta1.0", + "@tko/utils": "^4.0.0-beta1.0", + "@tko/utils.component": "^4.0.0-beta1.0", + "@tko/utils.parser": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "karma": { @@ -44,4 +44,4 @@ "type": "git", "url": "git+https://github.com/knockout/tko.git" } -} \ No newline at end of file +} diff --git a/packages/provider.databind/package.json b/packages/provider.databind/package.json index ee788f58..f9645f4e 100644 --- a/packages/provider.databind/package.json +++ b/packages/provider.databind/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha9.0", + "version": "4.0.0-beta1.0", "name": "@tko/provider.databind", "description": "Link HTML attributes based on a `data-bind` HTML attribute", "module": "dist/provider.databind.js", @@ -9,7 +9,7 @@ ], "license": "MIT", "dependencies": { - "@tko/provider.bindingstring": "^4.0.0-alpha9.0", + "@tko/provider.bindingstring": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "karma": { @@ -41,4 +41,4 @@ "type": "git", "url": "git+https://github.com/knockout/tko.git" } -} \ No newline at end of file +} diff --git a/packages/provider.multi/package.json b/packages/provider.multi/package.json index 24fb1c70..88c80bdf 100644 --- a/packages/provider.multi/package.json +++ b/packages/provider.multi/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha8.4", + "version": "4.0.0-beta1.0", "name": "@tko/provider.multi", "description": "Combine multiple other providers into one", "module": "dist/provider.multi.js", @@ -9,7 +9,7 @@ ], "license": "MIT", "dependencies": { - "@tko/provider": "^4.0.0-alpha8.4", + "@tko/provider": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "karma": { @@ -40,4 +40,4 @@ "type": "git", "url": "git+https://github.com/knockout/tko.git" } -} \ No newline at end of file +} diff --git a/packages/provider.mustache/package.json b/packages/provider.mustache/package.json index fc1ec859..cc80ee62 100644 --- a/packages/provider.mustache/package.json +++ b/packages/provider.mustache/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha9.0", + "version": "4.0.0-beta1.0", "name": "@tko/provider.mustache", "description": "Interpolate text/node attributes {{ }}", "module": "dist/provider.mustache.js", @@ -23,11 +23,11 @@ }, "homepage": "https://tko.io", "dependencies": { - "@tko/binding.template": "^4.0.0-alpha9.0", - "@tko/observable": "^4.0.0-alpha8.0", - "@tko/provider": "^4.0.0-alpha8.4", - "@tko/utils": "^4.0.0-alpha8.0", - "@tko/utils.parser": "^4.0.0-alpha9.0", + "@tko/binding.template": "^4.0.0-beta1.0", + "@tko/observable": "^4.0.0-beta1.0", + "@tko/provider": "^4.0.0-beta1.0", + "@tko/utils": "^4.0.0-beta1.0", + "@tko/utils.parser": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "karma": { @@ -48,4 +48,4 @@ }, "./helpers/*": "./helpers/*" } -} \ No newline at end of file +} diff --git a/packages/provider.native/package.json b/packages/provider.native/package.json index ceab1f61..ccfbaeed 100644 --- a/packages/provider.native/package.json +++ b/packages/provider.native/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha8.4a", + "version": "4.0.0-beta1.0", "name": "@tko/provider.native", "description": "Link binding handlers whose value is already attached to the node", "module": "dist/provider.native.js", @@ -9,7 +9,7 @@ ], "license": "MIT", "dependencies": { - "@tko/provider": "^4.0.0-alpha8.4", + "@tko/provider": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "karma": { @@ -40,4 +40,4 @@ "type": "git", "url": "git+https://github.com/knockout/tko.git" } -} \ No newline at end of file +} diff --git a/packages/provider.virtual/package.json b/packages/provider.virtual/package.json index c20cbe5c..73f6bc52 100644 --- a/packages/provider.virtual/package.json +++ b/packages/provider.virtual/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha9.0", + "version": "4.0.0-beta1.0", "name": "@tko/provider.virtual", "description": "Binding provider for virtual elements", "module": "dist/provider.virtual.js", @@ -10,8 +10,8 @@ "author": "The Knockout Team", "license": "MIT", "dependencies": { - "@tko/provider.bindingstring": "^4.0.0-alpha9.0", - "@tko/utils": "^4.0.0-alpha8.0", + "@tko/provider.bindingstring": "^4.0.0-beta1.0", + "@tko/utils": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "karma": { @@ -41,4 +41,4 @@ "type": "git", "url": "git+https://github.com/knockout/tko.git" } -} \ No newline at end of file +} diff --git a/packages/provider/package.json b/packages/provider/package.json index 062df1a9..bea32a29 100644 --- a/packages/provider/package.json +++ b/packages/provider/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha8.4", + "version": "4.0.0-beta1.0", "name": "@tko/provider", "description": "Abstract base class of tko Provider (HTML <-> Data Binding linker)", "module": "dist/provider.js", @@ -10,7 +10,7 @@ "author": "The Knockout Team", "license": "MIT", "dependencies": { - "@tko/utils": "^4.0.0-alpha8.0", + "@tko/utils": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "karma": { @@ -40,4 +40,4 @@ "type": "git", "url": "git+https://github.com/knockout/tko.git" } -} \ No newline at end of file +} diff --git a/packages/utils.component/package.json b/packages/utils.component/package.json index ecca0be5..82418618 100644 --- a/packages/utils.component/package.json +++ b/packages/utils.component/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha9.0", + "version": "4.0.0-beta1.0", "name": "@tko/utils.component", "description": "Registry and loading utilities for web components", "module": "dist/utils.component.js", @@ -9,9 +9,9 @@ ], "license": "MIT", "dependencies": { - "@tko/lifecycle": "^4.0.0-alpha9.0", - "@tko/observable": "^4.0.0-alpha8.0", - "@tko/utils": "^4.0.0-alpha8.0", + "@tko/lifecycle": "^4.0.0-beta1.0", + "@tko/observable": "^4.0.0-beta1.0", + "@tko/utils": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "peerDependencies": { diff --git a/packages/utils.functionrewrite/package.json b/packages/utils.functionrewrite/package.json index 27d3e6ab..bacd421f 100644 --- a/packages/utils.functionrewrite/package.json +++ b/packages/utils.functionrewrite/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha8.2", + "version": "4.0.0-beta1.0", "name": "@tko/utils.functionrewrite", "description": "Rewrite `function {}` as lambdas (=>)", "module": "dist/utils.functionrewrite.js", @@ -39,4 +39,4 @@ "type": "git", "url": "git+https://github.com/knockout/tko.git" } -} \ No newline at end of file +} diff --git a/packages/utils.jsx/package.json b/packages/utils.jsx/package.json index 26d1e7a0..8e798c93 100644 --- a/packages/utils.jsx/package.json +++ b/packages/utils.jsx/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha9.0", + "version": "4.0.0-beta1.0", "name": "@tko/utils.jsx", "description": "TKO JSX Rendering", "module": "dist/utils.jsx.js", @@ -25,12 +25,12 @@ ] }, "dependencies": { - "@tko/bind": "^4.0.0-alpha8.0", - "@tko/computed": "^4.0.0-alpha8.0", - "@tko/lifecycle": "^4.0.0-alpha8.0", - "@tko/observable": "^4.0.0-alpha8.0", - "@tko/provider.native": "^4.0.0-alpha8.0", - "@tko/utils": "^4.0.0-alpha8.0", + "@tko/bind": "^4.0.0-beta1.0", + "@tko/computed": "^4.0.0-beta1.0", + "@tko/lifecycle": "^4.0.0-beta1.0", + "@tko/observable": "^4.0.0-beta1.0", + "@tko/provider.native": "^4.0.0-beta1.0", + "@tko/utils": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "homepage": "https://tko.io", @@ -50,4 +50,4 @@ "bugs": { "url": "https://github.com/knockout/tko/issues" } -} \ No newline at end of file +} diff --git a/packages/utils.parser/package.json b/packages/utils.parser/package.json index 4748ab30..dd52e400 100644 --- a/packages/utils.parser/package.json +++ b/packages/utils.parser/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha9.0", + "version": "4.0.0-beta1.0", "name": "@tko/utils.parser", "description": "Parse the Javascript-like language used in data-bind and other HTML attributes (CSP-safe)", "module": "dist/utils.parser.js", @@ -9,8 +9,8 @@ ], "license": "MIT", "dependencies": { - "@tko/observable": "^4.0.0-alpha8.0", - "@tko/utils": "^4.0.0-alpha8.0", + "@tko/observable": "^4.0.0-beta1.0", + "@tko/utils": "^4.0.0-beta1.0", "tslib": "^2.2.0" }, "peerDependencies": { diff --git a/packages/utils/package.json b/packages/utils/package.json index 3ce17577..2d8f8969 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-alpha8.0", + "version": "4.0.0-beta1.0", "name": "@tko/utils", "description": "TKO Utilities", "type": "module", @@ -43,4 +43,4 @@ }, "./helpers/*": "./helpers/*" } -} \ No newline at end of file +} From 99114c4deded3fc5dbddd5c7c9c63c845a18263b Mon Sep 17 00:00:00 2001 From: Brian M Hunt Date: Thu, 12 May 2022 11:33:52 -0400 Subject: [PATCH 07/10] make) update the package compilation ... fixing the local builds --- Makefile | 3 ++- builds/knockout/package.json | 2 +- builds/reference/package.json | 2 +- tools/build.mk | 18 +++++++++++++++--- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 892008d3..45548680 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ bump: # from-git "identify packages tagged by lerna version and publish them to npm." # from-package "packages where the latest version is not present in the registry" -publish-unpublished: build +publish-unpublished: all link $(LERNA) publish from-package package-lock.json: package.json packages/*/package.json @@ -58,6 +58,7 @@ outdated-upgrade: install: package-lock.json clean: + rm -rf node_modules/ rm -f package-lock.json rm -rf packages/*/dist/* rm -rf packages/*/package-lock.json diff --git a/builds/knockout/package.json b/builds/knockout/package.json index f6e9ee8a..e0c362dd 100644 --- a/builds/knockout/package.json +++ b/builds/knockout/package.json @@ -66,7 +66,7 @@ "exports": { ".": { "require": "./dist/index.cjs", - "import": "./dist/index.js" + "import": "./dist/index.mjs" }, "./helpers/*": "./helpers/*" } diff --git a/builds/reference/package.json b/builds/reference/package.json index 33f703d8..a1f65729 100644 --- a/builds/reference/package.json +++ b/builds/reference/package.json @@ -48,7 +48,7 @@ "exports": { ".": { "require": "./dist/index.cjs", - "import": "./dist/index.js" + "import": "./dist/index.mjs" }, "./helpers/*": "./helpers/*" }, diff --git a/tools/build.mk b/tools/build.mk index 41bdd809..3954a93a 100644 --- a/tools/build.mk +++ b/tools/build.mk @@ -17,11 +17,12 @@ ESBUILD := npx esbuild .SUFFIXES: .ts .js default:: - $(MAKE) esm commonjs + $(MAKE) esm commonjs mjs -esm: dist/index.js -commonjs: dist/index.cjs browser: dist/browser.min.js +commonjs: dist/index.cjs +esm: dist/index.js +mjs: dist/index.mjs *.ts: @@ -43,6 +44,17 @@ dist/index.js: $(src) package.json --define:BUILD_VERSION='"${version}"' \ --sourcemap=external \ --outdir=dist/ \ + $(src) + +dist/index.mjs: $(src) package.json + @echo "[make] Compiling ${package} => $@" + $(ESBUILD) \ + --platform=neutral \ + --log-level=$(log-level) \ + --banner:js="$(banner) MJS" \ + --define:BUILD_VERSION='"${version}"' \ + --sourcemap=external \ + --outfile=dist/index.mjs \ src/index.ts # Build a CommonJS bundle, targetting ES6. From 0db4f2cede6993ca86e15b77d6a03852d9afca76 Mon Sep 17 00:00:00 2001 From: Brian M Hunt Date: Thu, 12 May 2022 11:42:32 -0400 Subject: [PATCH 08/10] build/reference) fix missing @tko ference --- builds/reference/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builds/reference/src/index.ts b/builds/reference/src/index.ts index b7312206..03d64247 100644 --- a/builds/reference/src/index.ts +++ b/builds/reference/src/index.ts @@ -21,7 +21,7 @@ import { bindings as componentBindings } from '@tko/binding.component' import { filters } from '@tko/filter.punches' import components from '@tko/utils.component' -import { createElement, Fragment } from 'utils.jsx' +import { createElement, Fragment } from '@tko/utils.jsx' const builder = new Builder({ filters, From feb161ff9c4c7cd24985a050b90770e3fa1eea4f Mon Sep 17 00:00:00 2001 From: Brian M Hunt Date: Thu, 12 May 2022 11:45:56 -0400 Subject: [PATCH 09/10] v4.0.0-beta1.1 --- builds/knockout/package.json | 2 +- builds/reference/package.json | 2 +- lerna.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builds/knockout/package.json b/builds/knockout/package.json index e0c362dd..0f55bf35 100644 --- a/builds/knockout/package.json +++ b/builds/knockout/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-beta1.0", + "version": "4.0.0-beta1.1", "name": "@tko/build.knockout", "description": "Knockout makes it easier to create rich, responsive UIs with JavaScript", "homepage": "https://tko.io", diff --git a/builds/reference/package.json b/builds/reference/package.json index a1f65729..96e91367 100644 --- a/builds/reference/package.json +++ b/builds/reference/package.json @@ -1,5 +1,5 @@ { - "version": "4.0.0-beta1.0", + "version": "4.0.0-beta1.1", "name": "@tko/build.reference", "description": "The TKO Reference Build", "repository": { diff --git a/lerna.json b/lerna.json index e4b4e7cf..d3eed03c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "useWorkspaces": true, - "version": "4.0.0-beta1.0", + "version": "4.0.0-beta1.1", "lerna": "4.0.0" } From d5d32ebc53f87e2601268c21f0d8ef45440e08bb Mon Sep 17 00:00:00 2001 From: Brian M Hunt Date: Thu, 12 May 2022 16:20:17 -0400 Subject: [PATCH 10/10] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb531adc..294bef06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ For TODO between alpha and release, see https://github.com/knockout/tko/issues/1 -## upcoming +## Beta1.2 - replace `objectLookup` with `Map` in `toJS` for O(n) instead of O(n²) computational complexity (#170 @felipesantoz) - fix equality comparison for select option values (#155/#163 @danieldickison)