-
Notifications
You must be signed in to change notification settings - Fork 421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CanJS 4.0 migration guide #3781
Comments
|
can-view-scope doesn't do implicit scope walking, so change to use |
The You should use |
|
stache's |
These will no longer automatically call
You need to now call them manually:
Also, functions in bindings are not automatically called... so you need to call them if you're doing |
|
Or you should run this to make
|
Should we create |
@matthewp I would prefer a |
The downside to that is it would be harder to remove the compat package if you depend on several of its internal behaviors. |
We could have |
I would favor not allowing importing |
The |
@phillipskevin is it possible to make |
DefineMap's |
|
can-view-model no longer uses domData to get an element's viewModel. Instead it uses the |
Are there any uses cases for keeping can-event in a project @justinbmeyer @phillipskevin? I think everything it did is covered by can-queues.batch and can-event-queue, right? |
@chasenlehara @phillipskevin @m-mujica @justinbmeyer Here is the first version of the migration guide: https://canjs.github.io/next/doc/migrate-4.html . You can leave feedback here and I'll update in a PR. |
Some comments from reviewing the guide:
should be
|
I have been thinking if we should call connected callback on both the component and the VM. Sometimes I feel like it makes more sense on the component. |
Was this not true for 3.0?
If you were using I actually think https://github.com/canjs/can-event-queue/blob/master/map/map.js#L821 These warn, but fix those later ...
I think this section should tell people that upgrading to the latest 3.0 will warn them of where they are using implicit scope walking. |
No, can-define was not part of CanJS 2.3, so it wasn't part of the migration guide. |
This upgrades the migration guide based on feedback provided in #3781. Also adds a section on the old stache symbols such as `%event`.
@matthewp there are a few things missing from the migration guide:
Do you want me to add these? Or do you want to take care of it? |
I'll get it, thanks for the notes! |
@phillipskevin what was the reason for |
stache lookups will now check the context before checking helpers, so |
About #3781 (comment) - I'm going to try to get |
These are all added to https://canjs.github.io/next/doc/migrate-4.html |
Changes to watch for
Stache:
%event
and other special symbols are now onscope
%event
is nowscope.event
../
and whatnot. Or use{{scope.find('foo')}}
Routes:
can.route(":page", { page: "home" });
is nowcan.route("{page}", { page: "home" });
can.route.ready();
is nowcan.route.start();
can.route()
is nowcan.route.register()
Packages
can-stache/helpers/route
is nowcan-stache-route-helpers
Code/ViewModels
can.batch.start()
is nowcan.queues.batch.start()
can.batch.stop()
is nowcan.queues.batch.stop()
The text was updated successfully, but these errors were encountered: