These are chat archives for canjs/canjs

29th
Apr 2016
Guido Smeets
@gsmeets
Apr 29 2016 07:09
Is there any way to do "one time" binding parent -> child component?
i.e. just initialize the child value, no other updates after that
I can just bind to foo and in the init do this.attr( "bar", options.foo) ofcourse
but it's a bit akward
Christopher Oliphant
@RALifeCoach
Apr 29 2016 12:55
Question regarding web workers. Does CanJS play nicely with web workers? Can I run the following in a web worker?
            var container = can.stache('<leaderboard-new-table ' +
                '{player-rows}="playerRows" {cut-line}="cutLine" ' +
                '{has-favourites}="hasFavourites" ' +
                '{players-to-add}="playersToAdd" ' +
                '{rounds}="rounds"></leaderboard-new-table>');
            var fragment = container({
                cutLine: cutLine,
                hasFavourites: this.hasFavourites(),
                playerRows: this.playerRowData,
                playersToAdd: playersToAdd,
                rounds: this.context.leaderboardModel.rounds
            });
Matthew Phillips
@matthewp
Apr 29 2016 13:16
No, web workers do not have access to the DOM
It's for running pure JavaScript code
Christopher Oliphant
@RALifeCoach
Apr 29 2016 13:17
Okay, I was hoping that those two statements just built html. It is the next statement that adds the fragment to the page.
Matthew Phillips
@matthewp
Apr 29 2016 13:19
Well it builds a documentfragment
Justin Meyer
@justinbmeyer
Apr 29 2016 13:19
@matthewp you've gotten this to work no?
Matthew Phillips
@matthewp
Apr 29 2016 13:19
Yeah, I was just going to say, I did work on a worker rendering library
Justin Meyer
@justinbmeyer
Apr 29 2016 13:19
that @RALifeCoach can house his whole app in a web-worker
it's been a while since I used it
look at the index.html and main.js as the important parts
I really loved that project, kind of sad that we ran into some roadblocks (mostly with dev experience)
What this project does is, it creates a virtual dom in the worker, like we do with SSR, and your app renders into that vdom
Then it sends patches back to the window which are applied to the real dom
Christopher Oliphant
@RALifeCoach
Apr 29 2016 13:23
is there a way to use the library without using stealjs?
Matthew Phillips
@matthewp
Apr 29 2016 13:24
yes of course
that example just uses importScripts
Christopher Oliphant
@RALifeCoach
Apr 29 2016 13:25
thanks - I’ll see if I can get it to work
Matthew Phillips
@matthewp
Apr 29 2016 13:26
cool
Christopher Oliphant
@RALifeCoach
Apr 29 2016 13:46
I am getting an error running npm install worker-render. And when it completes there is no list/gobal directory.
Matthew Phillips
@matthewp
Apr 29 2016 13:46
file an issue with your error and i'll take a look
Christopher Oliphant
@RALifeCoach
Apr 29 2016 13:47
can I build the dist folder from the git repo?
I have created the issue
Matthew Phillips
@matthewp
Apr 29 2016 13:49
maybe i just forgot in the last release
looks like 1.1.8 has it
I don't get that error in a new install
going to do a new tag with the dist
Christopher Oliphant
@RALifeCoach
Apr 29 2016 13:57
Thanks
I installed in an empty folder and it installed just fine. The problem must be some other dependency. I can extract the dist folder files from there.
Matthew Phillips
@matthewp
Apr 29 2016 14:02
I released 1.2.2 which should have the dist
Christopher Oliphant
@RALifeCoach
Apr 29 2016 14:03
I am looking at 1.2.2, but I don’t see a dist folder
Matthew Phillips
@matthewp
Apr 29 2016 14:04
Screen Shot 2016-04-29 at 10.04.04 AM.png
don't see this?
Christopher Oliphant
@RALifeCoach
Apr 29 2016 14:08
yes I see the dist files when I install via npm
Christopher Oliphant
@RALifeCoach
Apr 29 2016 14:33
Can I communicate with the worker - I don’t want to run my whole app inside the worker
Matthew Phillips
@matthewp
Apr 29 2016 14:34
if you only want to run part
well, I guess you can't currently
because it syncs the entire dom
Christopher Oliphant
@RALifeCoach
Apr 29 2016 14:35
okay
Matthew Phillips
@matthewp
Apr 29 2016 14:35
we should have an api like windowRender.updateWith("#section", worker);
that would only sync that element or something
yeah it's definitely a good iea
Christopher Oliphant
@RALifeCoach
Apr 29 2016 14:36
yes and then the ability to pass data to the worker as the backend makes changes
Matthew Phillips
@matthewp
Apr 29 2016 14:36
I think that would be the main use case
Christopher Oliphant
@RALifeCoach
Apr 29 2016 14:38
ETA to complete? :-)
Matthew Phillips
@matthewp
Apr 29 2016 14:56
hah, I don't know to be honest
Matthew Phillips
@matthewp
Apr 29 2016 15:10
I implemented textContent for our vdom: canjs/can-simple-dom#33
Going to hold off on merging this because friday releases = disaster
but this would make $("<div>").text("hello world"); work in ssr
Julian
@pYr0x
Apr 29 2016 15:20
friday releases = disaster
:D
Mohamed Cherif Bouchelaghem
@cherifGsoul
Apr 29 2016 15:24
@pYr0x what happened?
Julian
@pYr0x
Apr 29 2016 15:26
nothing... i just laughing, beacuse matthew wont release on friday
Matthew Phillips
@matthewp
Apr 29 2016 15:26
i'm setting up the hangout now
Julian
@pYr0x
Apr 29 2016 15:26
link`?
Matthew Phillips
@matthewp
Apr 29 2016 15:26
if i can figure out how
give me a minute
Julian
@pYr0x
Apr 29 2016 15:30
i am ready ;)
Mohamed Cherif Bouchelaghem
@cherifGsoul
Apr 29 2016 15:30
Im trying
Julian
@pYr0x
Apr 29 2016 15:31
as very week ;)
Mohamed Cherif Bouchelaghem
@cherifGsoul
Apr 29 2016 15:32
every week they have problem
Matthew Phillips
@matthewp
Apr 29 2016 15:33
creating hangouts is really hard
david is doing it
Julian
@pYr0x
Apr 29 2016 15:33
lol
Matthew Phillips
@matthewp
Apr 29 2016 15:35
@pYr0x @cherifGsoul it is in your email
Matthew Phillips
@matthewp
Apr 29 2016 16:18
@pYr0x Yeah, especially with justin having a training this weekend, we've had a couple of weekend emergencies because of friday releases gone bad ;)
Guido Smeets
@gsmeets
Apr 29 2016 16:25
We release on Sunday
This Sunday actually, hoping for a quiet next week :)
Matthew Phillips
@matthewp
Apr 29 2016 16:27
oh man, sorry to hear it @gsmeets !
Guido Smeets
@gsmeets
Apr 29 2016 17:01
We release every 9-10 weeks, so generally it's painful ;)
I want to get to continuous delivery in the next 3 years, but there's some legacy to clean up first
Gerard Finnerty
@halcyonandon
Apr 29 2016 21:18
@RALifeCoach We use systemjs and babel, writing everything in ES6 modules, no stealjs (though I think it also uses systemjs?)
Matthew Phillips
@matthewp
Apr 29 2016 21:20
it's a fork