These are chat archives for canjs/canjs

22nd
Mar 2018
Viktor Busko
@Lighttree
Mar 22 2018 07:37
Guys there is one issue that we faced on the project.
We have pages that use CanJS 2.2.9 and there is no point in updating them for now, since they are working ok.
We started create some new reusable components using Can 4 and they work good for most of apps that use Can 4 only.
New auto-mount feature is awesome, but as soon as we add our bundle with new components to page where 2nd version is used, everything goes wrong (It might be used even in completely different place, but still presented in HTML).
I assume this is because bundle with Can 4 presented on the page it affects Can 2 components as well and auto-mount tries to do something with them.
This is quite critical issue for now, maybe someone have any suggestions ? (Except not use Can 4 components or migrate everything to Can 4 :D)
Matthew Phillips
@matthewp
Mar 22 2018 15:03
@Lighttree how about migrating everything to can 4? j/k :)
I guess it would depend on why you have this issue, can 4 doesn't use the global can so I would think that your 2.2.9 would be unaffected
Viktor Busko
@Lighttree
Mar 22 2018 15:04

@Lighttree how about migrating everything to can 4? j/k :)

@matthewp I wish :)

I guess it would depend on why you have this issue, can 4 doesn't use the global can so I would think that your 2.2.9 would be unaffected

Well my assumption was that this auto-mount feature it scans HTML on presense of can-componetns in markup

And there is custom components written using can2
Kevin Phillips
@phillipskevin
Mar 22 2018 15:06
it will only auto-mount components that get added to the 4.0 version of can-view-callbacks
Viktor Busko
@Lighttree
Mar 22 2018 15:06
So it "doing something" I'm not sure, since I didn't investigated how this works
Matthew Phillips
@matthewp
Mar 22 2018 15:06
what sort of error do you see?
Viktor Busko
@Lighttree
Mar 22 2018 15:11
Well I don't have sources right now so it's hard to tell. I can come back tomorrow with more details. Visually components are broken (markup / non functional), but I can't get to console to tell what the issues are.

it will only auto-mount components that get added to the 4.0 version of can-view-callbacks

@phillipskevin so components from 2 / 3 Can should work fine when presented on the same page ? If so I'll try to investigate the case more, since I don't have ability to do this right now.

Kevin Phillips
@phillipskevin
Mar 22 2018 15:13
I wouldn't go that far... I'm just saying it might not be auto-mount that's causing the problem
Viktor Busko
@Lighttree
Mar 22 2018 15:14
Ah, ok
I'll try to get more details
Kevin Phillips
@phillipskevin
Mar 22 2018 15:15
and make sure none of your 2.x components are running through there
Viktor Busko
@Lighttree
Mar 22 2018 15:16
Great thanks for this ! I'll try to dig and see what happens.
Justin Meyer
@justinbmeyer
Mar 22 2018 20:29
A walk through of what's in 4.0: https://www.youtube.com/watch?v=shX5C2pRLSk
soultrue
@soultrue
Mar 22 2018 20:30
Hi Everyone

Hi,

I am using canjs 1.X version and as per my requirement, I have to remove URL encoding from my application. I checked the code and after removing the below code(encodeURIComponent) from route.js, it is working fine.
if ( route ) {
var cpy = extend({}, data),
// Create the url by replacing the var names with the provided data.
// If the default value is found an empty string is inserted.
res = route.route.replace(matcher, function( whole, name ) {
delete cpy[name];
return data[name] === route.defaults[name] ? "" : encodeURIComponent( data[name] );

But the issue is, I can not update the canjs version or files as I do not have access of library files in server so I have to overwrite or mange it from my application only.

Do you have any suggestion, how can I do that ?

I would appreciate , if you can kindly share some code so that it would be so helpful for me.

Gregg Roemhildt
@roemhildtg
Mar 22 2018 20:34
Is there a potential issue in can-stache@latest with sorting? Calling sort on a define list doesn't update for some reason