These are chat archives for canjs/canjs

20th
Dec 2017
Eben
@eben-roux
Dec 20 2017 07:34
so... sometimes when I change a route the entire application is reloaded
is there something simple that I am doing wrong?
or does this happen under certain conditions?
Eben
@eben-roux
Dec 20 2017 11:41
mmm... come to think of it I have a suspicion it has to do with submit buttons
I probably need to return false on the click or some such
Frank Lemanschik
@frank-dspeed
Dec 20 2017 16:30
@eben-roux this happens only if you don't preserve the propertys
one example where i see that happen by design is if your using stache helper like in bitballs
and don't pass back propertys to your routing viewModel
does that make sense or did i write that unclear? sorry if its unclear
it can also often happen if you don't store your promises as propertys
thats why often you will see usersPrimise propertys
and all kind of promise propertys
if you set them they are preserved persisted for the current running state
in general this is i think one of the most complex parts of canjs if your using the define-map observe able
you can return the same data in diffrent ways and it will get handled diffrent for example setting a object as value gets shared over instances
return the same value from a function then it gets cached
also your can-connect behaviors do matter
Kevin Phillips
@phillipskevin
Dec 20 2017 16:36
if you find things like this confusing, please open issues
for example we're deprecating this:
setting a object as value gets shared over instances
there's a PR in now to do that in 3.0 and I think it is removed already in 4.0
so if there are other confusing things, we can look to remove them
Frank Lemanschik
@frank-dspeed
Dec 20 2017 16:37
@phillipskevin i am only waiting now for justin to explain the view bindings and parsers
then i will implament my nils stream as observable
once i am able to do that
:D
i don't plan to use define-map or observe
i only use it as long as needed
i see convertable streams as the holy gral the only problems are the view updates via the canjs eco system
as that is no where explained all i know i know from reverse engineering the hard way
Frank Lemanschik
@frank-dspeed
Dec 20 2017 16:43
i only need to find a better way as creating fragments for each variable that changes as this feels so useless
as i can archive the same via dom.select and edit
maybe jsx can help but i don't know how that should work i am doomed :)
Kevin Phillips
@phillipskevin
Dec 20 2017 16:47
have you profiled it to confirm there's actually a performance benefit to not creating new fragments?
Frank Lemanschik
@frank-dspeed
Dec 20 2017 16:48
performance nope :(
but i see it as double work
and un needed work
as from my view we return html we have html
so we can use after that the dom api for everything
as easy as select <span id="myName">Mr Myer</span>
and then select myName change innerText done
but i performance benchmarked domDiffing
and i think that could be a alternate i simply check if the dom matches if not sync it up async
that outperforms on bigger apps
as we can handle the view as Whole
it don't matters where the changes come from we only need to make sure that view matches whats expected
and many observations arn't needed this way
only the edit able content
Kevin Phillips
@phillipskevin
Dec 20 2017 16:51
but you're doing a lot more DOM manipulation
Frank Lemanschik
@frank-dspeed
Dec 20 2017 16:51
yes sure but my co workers from chrome and mozilla have improved on that also
and its not about real pefformance
for example often you don't even want to change something in less then a MS
Kevin Phillips
@phillipskevin
Dec 20 2017 16:52
its not about real pefformance
what do you mean?
Frank Lemanschik
@frank-dspeed
Dec 20 2017 16:53
Material design examples and research
they found out that it feels better to show some loading and transition
Kevin Phillips
@phillipskevin
Dec 20 2017 16:53
sure
Frank Lemanschik
@frank-dspeed
Dec 20 2017 16:53
even if its not needed there are also time frames that feel diffrent
Kevin Phillips
@phillipskevin
Dec 20 2017 16:53
but that kind of thing shouldn't be done at the framework level I don't think
otherwise, you can never have things be fast
Frank Lemanschik
@frank-dspeed
Dec 20 2017 16:54
i can via preComputing
i simply prepare what gets computed and insert and change
that dom manipulations are fast
Kevin Phillips
@phillipskevin
Dec 20 2017 16:55
but if you have to make 10,000 changes instead of inserting 1 fragment
it won't ever be fast
Anyway, it's good that you're exploring alternatives. I'll be interested to see how it turns out.
Frank Lemanschik
@frank-dspeed
Dec 20 2017 16:55
yes i am on that :) since more then 2 years
but good idea
do you got a benchmark for the current implamentation
so i can work against that benchmark?
Kevin Phillips
@phillipskevin
Dec 20 2017 16:59
Frank Lemanschik
@frank-dspeed
Dec 20 2017 16:59
maybe you did internaly some benchmarks i only need to know the test cases so i know what to imrove
ok so far so good i understand the example :) i will do the same with some of my alternates
Eben
@eben-roux
Dec 20 2017 17:42
@frank-dspeed thanks for the feedback
I haven't quite narrowed down when it happens but I have a "standard" route with the associated data
I wouldn't expect changing the route.data would result in a refresh of the app
anyway, I am not quite sure when it happens so I'll keep an eye out for something that is reproducible
Frank Lemanschik
@frank-dspeed
Dec 20 2017 17:44
i think its the expected behavior
as soon as you know what exactly happens befor reload
you also have the solution :)
so at last with canjs 4 you will get light
Eben
@eben-roux
Dec 20 2017 17:47
hopefully canjs 4 will not have many breaking changes.
but then again, there is a major version number change
it takes me forever to update everything each time and my current solutions are miniscule
this was one of the things that annoyed me with ember
Kevin Phillips
@phillipskevin
Dec 20 2017 17:47
we're starting to track them here: canjs/canjs#3781
Eben
@eben-roux
Dec 20 2017 17:48
we had to schedule a 300 person team for a 4-6 week period to upgrade our application
Frank Lemanschik
@frank-dspeed
Dec 20 2017 17:48
i understand that part i know what you mean but canjs offers code mods
did you try them @eben-roux ?
Eben
@eben-roux
Dec 20 2017 17:48
the codemods are great but if they don't change absolutely everything then a company is back to spending money for an upgrade
Kevin Phillips
@phillipskevin
Dec 20 2017 17:49
we had to schedule a 300 person team for a 4-6 week period to upgrade our application
wow
Frank Lemanschik
@frank-dspeed
Dec 20 2017 17:49
i can only say
as soon as i have the needed knowleg for a intefration such problems will not happen anymore
streams are so amazing solid and simply logical
:D
you see where the change comes from where it leads to and you can debug easy
Eben
@eben-roux
Dec 20 2017 17:51
@phillipskevin so I just loaded the front-end quickly to see what version they are on:
image.png
now... end of Jan 2018 I have been gone 2 years!
they haven't moved
Frank Lemanschik
@frank-dspeed
Dec 20 2017 17:52
eheheheh ya that happens often
Kevin Phillips
@phillipskevin
Dec 20 2017 17:52
oh, that was for upgrading an Ember app
Frank Lemanschik
@frank-dspeed
Dec 20 2017 17:52
in Africa windows 95 powred ATM still exist
:D
i my self found out that EU and US ATM's now running on chrome
Eben
@eben-roux
Dec 20 2017 17:52
yip... and Ember is on 2.17 at the moment... so they're way behind
Frank Lemanschik
@frank-dspeed
Dec 20 2017 17:52
opened the dev console to surf the net
when i have no wlan :)
i am surfing via window.location in the dev tools on the ATM
:D
Eben
@eben-roux
Dec 20 2017 17:53
just before I left I actually pushed for just picking another option and I was pushing for canjs
Frank Lemanschik
@frank-dspeed
Dec 20 2017 17:53
canjs is still a good option
Eben
@eben-roux
Dec 20 2017 17:53
was negotiating with Justin and... I think Brian or some such... anyway
Frank Lemanschik
@frank-dspeed
Dec 20 2017 17:53
but i have always the same case
some times the apps stop working because of little refactors
and after that it takes ages to recover
thats why i want to use the nativ stuff :)
Eben
@eben-roux
Dec 20 2017 17:54
the point is that companies cannot always afford the time and effort to "upgrade"... and by the time I left they had spent ZAR1,000,000,000 (that's 1 BILLION Rand)
Frank Lemanschik
@frank-dspeed
Dec 20 2017 17:54
Rand is this indian currency right?
Eben
@eben-roux
Dec 20 2017 17:55
now, at the time you paid around 10-12 Rand for a dollar so in the vacinity of a $100 million project
and even they haven't bothered
lol
Kevin Phillips
@phillipskevin
Dec 20 2017 17:55
yeah, definitely understand that
Eben
@eben-roux
Dec 20 2017 17:55
just saying :)
Frank Lemanschik
@frank-dspeed
Dec 20 2017 17:55
@eben-roux your not alone with this :)
i have the same issues thats why i think only the nativ api's can save us
Eben
@eben-roux
Dec 20 2017 17:56
I have seen Justin's post on canjs 4 and perhaps I'll chime in... but stability is key
Frank Lemanschik
@frank-dspeed
Dec 20 2017 17:56
they need to get defined
Eben
@eben-roux
Dec 20 2017 17:56
something like Log4Net hasn't changed in about 100 years and that... is... AWESOME
Kevin Phillips
@phillipskevin
Dec 20 2017 17:56
a lot of what we're doing with breaking things into small packages and separating out stateful packages is driven by exactly this
Frank Lemanschik
@frank-dspeed
Dec 20 2017 17:56
i think its also javascript related at all
as its weak typed
Eben
@eben-roux
Dec 20 2017 17:56
and "awesoem" is a word I don't like so I don't use it much
in the .Net world with ..Net Core there seems to be a tendency to break things into smaller bits as well...
there are pros and cons either way... all about balance
Frank Lemanschik
@frank-dspeed
Dec 20 2017 17:57
ya but mainting this small things leads also to tons of failurs
my most problems are resulting from the modlet structure
Eben
@eben-roux
Dec 20 2017 17:57
it isn't always apparent when to include a package with canjs although it seem "always" should be appropriate :)
Frank Lemanschik
@frank-dspeed
Dec 20 2017 17:57
if i would do that all in a single file i would end in more solid code
:D
all this combining via steal and that all that leads to issues
Eben
@eben-roux
Dec 20 2017 17:58
@frank-dspeed well... with my own projects I have the core define the required interfaces and then you pick the implementation you want
it is the D (dependency inversion) in uncle Bob's SOLID principles
Frank Lemanschik
@frank-dspeed
Dec 20 2017 17:59
i think i will stop the module work flow for some time
because as i don't used such stuff all worked always
:D
Eben
@eben-roux
Dec 20 2017 17:59
so it is a mixture... but then again, my project is not quite as big
Frank Lemanschik
@frank-dspeed
Dec 20 2017 17:59
befor 5 years i did prototypes in jquery
they are still stable running
:D
Eben
@eben-roux
Dec 20 2017 18:00
do you mean "prototype"? as in the library? a la jquery, mootools?
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:00
i mean with that POC of apps
Eben
@eben-roux
Dec 20 2017 18:00
oh
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:00
i simply used jquery for the whole app
and its still running and upgrade able
and performance is not so bad
Eben
@eben-roux
Dec 20 2017 18:01
yes... prototype applications have a tendency to become production solutions once someone gets hold of them
jquery is a rather thin wrapper over the native JS nowadays but very useful... back in the day where you had inconsistent browser implementations it was a godsend
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:02
yes i agree
WASM will solve a lot of that stuff
as we can use C and Rust via LLVM to compile to WASM
Eben
@eben-roux
Dec 20 2017 18:03
I don't quite buy into the WASM thing yet
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:03
its like C for the Web
you get C code wrapped with a javascript interface
Eben
@eben-roux
Dec 20 2017 18:03
JS is too pervasive and really does get the job done... along with nodejs in the mix and... well... we'll see
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:03
so you can send data in and out of the C app
Eben
@eben-roux
Dec 20 2017 18:04
when will C just die!
kidding
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:04
it will die
with rust
rust ist replacing C
thats why mozilla did it
Eben
@eben-roux
Dec 20 2017 18:04
never really used C... fooled around with C++ in 92 --- wrote a b-tree database thingy
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:04
its a C like lang low level you can do mem manegment in rust
Eben
@eben-roux
Dec 20 2017 18:05
I see they (MS) seem to want to re-introduce low-level memory management back into C#
apparently it is very fast
it goes from 0 to broken in 2ms flat!
anyway
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:06
ah i hate C#
i hate MS
Eben
@eben-roux
Dec 20 2017 18:06
at least you'll be able to shoot yourself in both feet
hate is such a strong word
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:06
at present i am shooted from donejs
:D
Eben
@eben-roux
Dec 20 2017 18:06
C# is vewy. vewy, vewy nice :)
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:06
and big routing applications
with tons of undebug able stuff i will try to get hired by a normal F500 company as coder and stop working as freelancer
because my apps are now not deliver able any more and maintainable any more by single persons
as you sayed you putted 300 on that
Eben
@eben-roux
Dec 20 2017 18:07
now you see... therein lies the rub
finding a company that is actually using you particular mix of tech is near impossible nowadays
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:08
yes thats why i want to simply do hourly work
Eben
@eben-roux
Dec 20 2017 18:08
companies in south africa tend to follow the "larger" trends... like angular, and just about anything MS has on offer
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:08
not any success based work any more
:D
10 years befor you got payed for success
Eben
@eben-roux
Dec 20 2017 18:09
I have contracted for more than half of my career... probably around 15 years of it has been contracting... if not more
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:09
nowdays its a good idea to accept any hourly rate
i lost i think last 2 month
round about 10 000 euro
only because of deadlines
  • monthes of work
and crashed one company with 1 mio totall invest successfull
as the bank cancled the credit line
:D
Eben
@eben-roux
Dec 20 2017 18:10
well... I work on a time and material basis
if I work 1 hour I get paid 1 hour :)
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:10
thats what i need
but i don't found something like that my head is a bit destroyed last monthes
Eben
@eben-roux
Dec 20 2017 18:11
of course they expect me to work at least 8 hours a day... which is good
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:11
to much bad stuff happend
Eben
@eben-roux
Dec 20 2017 18:11
this work business can be tricky
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:11
yes thats why i think i will search for a F500 company
and simply do what ever they say :)
i get payed and can invest that into my own projects
Eben
@eben-roux
Dec 20 2017 18:12
so the point is that having too many changes requires too much rework and companies have real solution they need to get out and cannot spend weeks (or even days) upgrading to the latest flavour du jour
rather invest in property
he he
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:13
@eben-roux thats true
but they also don't need to upgrade
Eben
@eben-roux
Dec 20 2017 18:13
yip... just look at my previous employer
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:13
thats why security fixes are seperated from braking changes
code once let it last for 5 years
recode
something like that is the only solution
Eben
@eben-roux
Dec 20 2017 18:14
the problem is that folks also don't want to get stuck on an older version
I found that getting support for the older ember code was basically impossible
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:14
thats why webcomponents will solve a lot
they are better exchange able
and solve many version clashes
with webcomponents and isolated dom window objects
we can do one component can 2
other can 3 and so on
Eben
@eben-roux
Dec 20 2017 18:16
I don't know if side-by-side versions are possible... or are they?
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:16
they are i have such stuff running
but you need really to think a lot because the biggest problems are globals
but to make it short yes its today possible to run diffrent steal + canjs versions
and even mix that up
but its more complex then it should be
Eben
@eben-roux
Dec 20 2017 18:18
interesting... would that entail two main scripts for steals... each pointing to a different version?
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:18
yes
thats not a problem
steal assigns to window as global
so you simply need 2 diffrent window objects
for example a iframe generates a secund window object
and there are also diffrent other methods to get that
and a iframed window can controll outer window
Eben
@eben-roux
Dec 20 2017 18:20
ah, ok
iframe (where is the puke emoticon) :P
I thought iframes are dead... they certainly are hacky though
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:21
no they now become one of the most usefull things ever
but more for isolation and controll flow
not for displaying view able content in them
Eben
@eben-roux
Dec 20 2017 18:22
goodness...
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:22
for example i have done the following in production and its stable
i did create a secund html diffrent steal canjs version
that gets imported via html link rel import
and then this window syncs up with the importing document
so your index html requires legay.html
and legacy.html attaches to your index.html view
legacy sorry not legay
lol
Eben
@eben-roux
Dec 20 2017 18:24
but isn't canjs more for displaying things anyway...
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:24
it is for that :)
and it does exactly that
but not in its own window
in this POC
Eben
@eben-roux
Dec 20 2017 18:25
I'm sure there are ways to have different versions load but it may be more effort than it is worth
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:25
sure that also possible to load that in the same window
but there is no need for that
import and iframe are good methods
this way every thing works as befor
Eben
@eben-roux
Dec 20 2017 18:26
iframe is certainly an option
Frank Lemanschik
@frank-dspeed
Dec 20 2017 18:26
needs only some extra lines to target the parent outer window or document
thats it