Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 24 18:56

    brianmhunt on main

    Update CHANGELOG.md (compare)

  • May 24 18:49

    danieldickison on main

    v4.0.0-beta1.3 (compare)

  • May 24 18:49

    danieldickison on v4.0.0-beta1.3

    (compare)

  • May 24 18:47

    danieldickison on main

    v4.0.0-beta1.2 Merge remote-tracking branch 'o… (compare)

  • May 24 18:19

    danieldickison on main

    Create non-minified browser.js Merge remote-tracking branch 'b… Merge branch 'main' of https://… (compare)

  • May 20 19:39
    chuanqisun commented #168
  • May 12 20:20
    brianmhunt commented #171
  • May 12 20:20

    brianmhunt on main

    Update CHANGELOG.md (compare)

  • May 12 18:19

    brianmhunt on 172-build-exports-2

    v4.0.0-beta1.2 (compare)

  • May 12 18:19

    brianmhunt on v4.0.0-beta1.2

    (compare)

  • May 12 15:53

    brianmhunt on 172-build-exports-2

    (compare)

  • May 12 15:53

    brianmhunt on main

    make) update the package compil… build/reference) fix missing @t… v4.0.0-beta1.1 and 1 more (compare)

  • May 12 15:53
    brianmhunt closed #174
  • May 12 15:53
    brianmhunt edited #174
  • May 12 15:49
    brianmhunt opened #174
  • May 12 15:45

    brianmhunt on v4.0.0-beta1.1

    (compare)

  • May 12 15:45

    brianmhunt on 172-build-exports-2

    v4.0.0-beta1.1 (compare)

  • May 12 15:43

    brianmhunt on 172-build-exports-2

    make) update the package compil… build/reference) fix missing @t… (compare)

  • May 12 14:50

    brianmhunt on v4.0.0-beta1.0

    (compare)

  • May 12 14:50

    brianmhunt on main

    v4.0.0-beta1.0 (compare)

Brian M Hunt
@brianmhunt
Hi @modeler42 I don't have any suggestions offhand, and I don't even have an easy way to test IE11. Given that Microsoft has dropped support for IE11, and the bandwidth needed for backwards compat, I don't think it'll be something KO4 will reasonably be able to support, I'm sorry to say.
Daniel Dickison
@danieldickison
Hello! I'm curious if anybody is watching this chat. We recently successfully upgraded knockout-heavy bandcamp.com to tko in order to improve our CSP settings. We ended up fixing a handful of bugs and compatibility issues along the way, and was hoping to get some feedback on those from the maintainers or anyone else currently working on a ko->tko migration. The PRs are here:
https://github.com/knockout/tko/pulls/danieldickison
Brian M Hunt
@brianmhunt
Hi Daniel! Im here - just swamped but saw your PRs. Im going to try to get to them this weekend. Would love to touch base and catch up!
Daniel Dickison
@danieldickison
that'll be great! hit me up when you've had a chance to catch up, and maybe we can get on a call next week
Brian M Hunt
@brianmhunt
@danieldickison I just had a chance to leave a few thoughts on the PRs but generally they look great! Feel free to reply in the PRs or we can touch base some other way too!
Daniel Dickison
@danieldickison
thanks Brian. I'll check out the PR comments later today
Daniel Dickison
@danieldickison
@brianmhunt fyi only those with write access can merge PRs so you'll need to do that after approval.
Daniel Dickison
@danieldickison
I think i've address each of your comments. I'm curious what you think of the CodeML failure for #150 — as I mentioned in a comment, I think it's benign but I'm not sure how to ack and silence CodeML.
Brian M Hunt
@brianmhunt
Thanks @danieldickison ! I'm hoping to look at this today or soon, but in any case by the weekend (including the CodeML failure -- I just saw that last night).
Brian M Hunt
@brianmhunt
@danieldickison ive looked at the PRs and im hoping to have some time this week to review everything in detail. But so far it looks great, thank you Daniel!
Daniel Dickison
@danieldickison
i'm getting a handful of build errors now when running make:
@tko/provider: ✘ [ERROR] Could not resolve "@tko/utils"
@tko/provider:     src/Provider.ts:4:7:
@tko/provider:       4 │ } from '@tko/utils'
@tko/provider:         ╵        ~~~~~~~~~~~~
does't appear to be anything that's changed recently in the repo, as my dev branch that used to build fine a few months ago is now similarly broken
Matt Lacey
@mattlacey
That's the same that I was getting the other day while trying to build - weird
Brian M Hunt
@brianmhunt
This may be a missing peer dependency or a change in lerna. Re-running lerna should fix it, but if not let me know.
Daniel Dickison
@danieldickison
i trued removing the cjs build targets and running npx lerna init -- it gets further now but still fails with a similar issue:
e.g.
@tko/build.reference: ✘ [ERROR] Could not resolve "@tko/builder"
@tko/build.reference:     src/index.js:1:24:
@tko/build.reference:       1import { Builder } from '@tko/builder'
@tko/build.reference:         ╵                         ~~~~~~~~~~~~~~
@tko/build.reference:   You can mark the path "@tko/builder" as external to exclude it from the bundle, which will remove this error.
but i'm having trouble figuring out how @tko is defined in terms of js import path
i'm totally new to lerna and esbuild so i'm slowly trying to grok where things are defined
Matt Lacey
@mattlacey
I'd never heard of lerna until the other day... my first thought was that it was a typo of learn!
I did however merge my TKO migration into our develop branch today, so it'll be going live to our clients in our next major release - pretty sure I've got a few bindings to find and fix still first but nice to have moved everything away from bower and gulp, onto npm, webpack and TKO
Matt Lacey
@mattlacey
ran lerna bootstrap and then make clean && make but hit the same. Will play a bit more tomorrow - late here now!
Brian M Hunt
@brianmhunt
Just checking @mattlacey -- any luck?
❯ git rev-parse head
cf1e41326fafb9f6b83d1d042eb251ff0df9118f
Matt Lacey
@mattlacey
Unfortunately been bogged down in prospect calls and other bug fixes today :(
Matt Lacey
@mattlacey
So I can confirm that v4.0.0-alpha9.0 builds ok, but the following commit (knockout/tko@e9c39cc) throws the same errors as seen now, which isn't surprising because it introduces a lot of big changes to the build files don't think anything with those has changed since - unfortunately it's such a big change the reason isn't immediately apparent to me but I suspect while doing the work you may have had had some local files that made it work for you Brian?
can't imagine you'd have made that commit without it building
Matt Lacey
@mattlacey
ok so I think You can mark the path "@tko/builder" as external to exclude it from the bundle, which will remove this error. is the clue here - pretty sure we can build each module with others marked as external as the end-developer's build tool will take care of bundling requirements at that time
Matt Lacey
@mattlacey
nope, wrong tree there - that generates the build with the imports left in place rather than resolved to actually include everything meaning everything would need to be installed independently
Matt Lacey
@mattlacey
Ok, modifying tsconfig.json to add another path for @tko/ got a lot further: "@tko/": ["packages/*"]
now I'm running into case sensitivity issues due to a case-sensitive file system, need to get packages like Provider building to lower case output filenames
Matt Lacey
@mattlacey

getting errors like this:

@tko/build.reference:  > ../../packages/builder/src/Builder.ts:49:7: error: Could not read from file: /home/matt/work/tko/packages/lifecycle/dist/lifecycle.js
@tko/build.reference:     49 │ } from '@tko/lifecycle'

because the filename is actually LifeCycle.js which comes from the .ts source file being LifeCycle. I believe we want the typescript files named that way, but need to transform the output. In this case changing builder to import @tko/LifeCycle doesn't work because then the package name doesn't resolve, and I'm pretty sure we want the package names all in lowercase right?

Matt Lacey
@mattlacey
if I manually rename the output files, then I get other errors:
@tko/build.knockout:  > ../../packages/bind/src/BindingHandler.ts:4:9: error: No matching export in "../../packages/lifecycle/dist/lifecycle.js" for import "LifeCycle"
@tko/build.knockout:     4 │ import { LifeCycle } from '@tko/lifecycle'
Which makes sense because this is in that JS file:
var LifeCycle_default = LifeCycle;
   1 export {
1801   LifeCycle_default as default
   1 };
Daniel Dickison
@danieldickison
I don't know how, but I tried a build just now on the latest main cf1e4132 again and it built successfully
I had updated nodejs and npm over the weekend, so perhaps it was some kind of npm bug or incompatibility?
Matt Lacey
@mattlacey
weird! I'll try a newer version to see if anything changes
Matt Lacey
@mattlacey
No go with these versions:
matt@Thebe:~/dev/tko(main)$ node --version
v14.15.0
matt@Thebe:~/dev/tko(main)$ npx --version
6.14.8
matt@Thebe:~/dev/tko(main)$ npm --version
6.14.8
Updated and this combination works:
matt@Thebe:~/dev/tko(main)$ node --version
v16.13.2
matt@Thebe:~/dev/tko(main)$ npm --version
8.1.2
matt@Thebe:~/dev/tko(main)$ npx --version
8.1.2
Daniel Dickison
@danieldickison
fwiw the versions that worked for me are node 17.3.1 and npm 8.3.0
Matt Lacey
@mattlacey
@brianmhunt @danieldickison Do you have an opinion on whether forEach should fail when operating on null/undefined or if it should handle it gracefully? KO just treated it as an empty list, TKO throws an error pretty far down the stack when it attempts to call .length on the value - clearly quite an easy fix but unsure if this was a conscious decision?
Daniel Dickison
@danieldickison
I can't comment on the design intent. My weakly-held opinion is to prefer the old KO behavior (treat null/undefined as an empty list). Strictness is nice, but in this case I don't think it adds much in the way of safety or efficiency, while the old behavior is convenient.
Matt Lacey
@mattlacey
Yeah, even though an empty array is technically correct JavaScript be JavaScript and it's all too easy to end up with other falsey values. I'll have a go at doing a change with tests and raise a PR
jfrank14
@jfrank14
I'm not sure if this is the right place for a general question like this, so sorry if off-topic. I've been using knockout for many years and have always stayed with it, because whenever I look into other frameworks, they always seem so opinionated or klunky or both. Vue seems closest to knockout, although it seems less elegant to me. So I want to continue with knockout, but it feels hard to resist the argument that Vue has a larger community, more activity on Github, and more certainty that it will continue to be supported in the future. I'm using ko 3.x, and so I will probably have some learning curve in the transition to 4 and it's not even clear to me if ko 4 has actually been released. I know that the people here love and believe in knockout, and I do as well, but does it have the support needed to base new and mission critical development on it?
Matt Lacey
@mattlacey
@jfrank14 It's kind of a tough call - you're right about the community sizes, it's practically non-existent for KO. I do know though that @brianmhunt is using TKO in a production environment, as is @danieldickison and I recently updated our code base to use it over the aging 3.x versions. I like it for the same reasons as you - it's not opinionated, works well and just generally stays out of the way. I couldn't move our whole code base to something else right now even if I wanted to, but I'm still not sure I would even if the resources were available
The way I look at it is that it's stable, works and should push really come to shove the code is open

You're right about the releases, it's confusing, as is the current state of documentation, but overall I found moving it o it to be quite painless

If you're using npm the way to include the latest version (alpha 9) is via "@tko/build.reference": "^4.0.0-alpha9.0",

the biggest catch is reworking bindings that use javascript expressions - a smaller subset of JS available, but as eval is no longer used, things like indexOf inside of a binding don't work - instead you need to move such logic into a computed and reference that (arguably where it should have been in the first place)
The other thing I'd call out is that while tko.io has a "new" site, there's another WIP site linked to in the readme for TKO which is here: https://brianmhunt.github.io/knockout/a/intro.html
Matt Lacey
@mattlacey
I put a little starter template up on Github here: https://github.com/mattlacey/tko_webpack
haven't touched it for a few months because I had to work on getting my main code base upgraded after getting it going, but will make some more changes soon!