These are chat archives for canjs/canjs

21st
Nov 2017
Frank Lemanschik
@frank-dspeed
Nov 21 2017 09:19
@phillipskevin i debuged promises a lot and there is no issue in canjs the only issue is that you need to do isRejected in the template to get the error if you have no catch in the promise
you need to point out catch is not a option
its needed
Gregg Roemhildt
@roemhildtg
Nov 21 2017 16:17
Does anyone run into these errors (recently) after trying to update canjs packages? Error: You can't have two versions of can-dom-data-state, check your dependencies
+-- can-admin@0.2.0 (github:roemhildtg/can-admin#7717811339289ac4152f848e203bcd8a36cf49b2)
| +-- can-jquery@3.2.3
| | `-- can-event-dom-enter@1.0.4
| |   `-- can-dom-data-state@0.2.0  deduped
| `-- can-util@3.10.15
|   +-- can-dom-data-state@0.2.0
|   `-- can-event-dom-radiochange@1.0.4
|     `-- can-dom-data-state@0.2.0  deduped
+-- can-component@3.3.6
| `-- can-stache-bindings@3.9.5
|   `-- can-event-dom-radiochange@1.0.2
|     `-- can-dom-data-state@0.1.1  deduped
+-- can-define@1.5.4
| `-- can-test-helpers@1.1.0
|   `-- can-util@3.10.15
|     +-- can-dom-data-state@0.2.0
|     +-- can-event-dom-enter@1.0.4
|     | `-- can-dom-data-state@0.2.0  deduped
|     `-- can-event-dom-radiochange@1.0.4
|       `-- can-dom-data-state@0.2.0  deduped
+-- can-jquery@3.2.3
| `-- can-event-dom-enter@1.0.2
|   `-- can-dom-data-state@0.1.1
`-- can-util@3.10.15
  +-- can-dom-data-state@0.2.0
  +-- can-event-dom-enter@1.0.4
  | `-- can-dom-data-state@0.2.0  deduped
  `-- can-event-dom-radiochange@1.0.4
    `-- can-dom-data-state@0.2.0  deduped
Gregg Roemhildt
@roemhildtg
Nov 21 2017 16:25
What's annoying is I'm not requiring the package with the error. I've done a complete removal of node_modules and package-lock.json and the error is occuring using the packages versions defined in the canjs package.json
Can't the dom-data-state package simply check to see if its defined already, and just return null or something? Does it really need to throw an error?
Frank Lemanschik
@frank-dspeed
Nov 21 2017 16:27
@roemhildtg if its any how possible
try to install can-* modules flat
Gregg Roemhildt
@roemhildtg
Nov 21 2017 16:27
Not sure, what do you mean?
Gregg Roemhildt
@roemhildtg
Nov 21 2017 16:37
Am I supposed to npm install can-dom-data-state even though my project isn't using it (directly)
k, well that doesn't fix it either...both versions are still getting imported
Frank Lemanschik
@frank-dspeed
Nov 21 2017 16:39
yes that does not fix it
if you want a good 100% fix
set all package versions like the once in the github.com/canjs/canjs repo
only of the dependencys your directly using
Gregg Roemhildt
@roemhildtg
Nov 21 2017 16:40
I do. It seems like every time I upgrade packages I run into this.
Frank Lemanschik
@frank-dspeed
Nov 21 2017 16:40
that repo is dedublicated
Gregg Roemhildt
@roemhildtg
Nov 21 2017 16:40
I am using the versions from the canjs/canjs repo
Frank Lemanschik
@frank-dspeed
Nov 21 2017 16:40
yes never upgrade packages
fresh install is always the best
Gregg Roemhildt
@roemhildtg
Nov 21 2017 16:41
I do. I remove node_modules/package-lock.json
Frank Lemanschik
@frank-dspeed
Nov 21 2017 16:41
yes all lock files
and also all resolutions in you package.json
if you want a really good tip from me
:)
i only always upgrade one donejs app
and then copy that over all others
that helps most
if you ask now why donejs app because it installs the can dependencys flat
:D
the generator copys over the donejs cli and installs the canjs packages flat
that makes sure that this errors can't come up
so you can simply use the resulting node_modules folder then as base and npm should install the rest correctly
Gregg Roemhildt
@roemhildtg
Nov 21 2017 16:44
That's my goal! I have a code mod to update all my packages to the canjs/canjs versions. It does that. And I hadn't had an issue like this for a while until I encountered this new can-dom-data-state
Frank Lemanschik
@frank-dspeed
Nov 21 2017 16:45
awsome module by the way
:D
Gregg Roemhildt
@roemhildtg
Nov 21 2017 16:45
It seems that can-jquery -> can-event-dom-enter@1.0.2 is the culperate
Frank Lemanschik
@frank-dspeed
Nov 21 2017 16:45
yes you should maybe think about less frequently updates
or directly update from the gitrepos like i do
and submit pr if something is broken
thats the most stable way
never upgrade your current projects your self
Gregg Roemhildt
@roemhildtg
Nov 21 2017 16:46
I'd submit a pr to upgrade can-jquery, but I'm not sure if it'll break something else
Frank Lemanschik
@frank-dspeed
Nov 21 2017 16:46
only update one example project if that works copy that over
ya thats not a great idea then :)
but we will see if it brakes or not
can-jquery is on its way to get deprecated i think
as jquery does
the browser api's are now more stable
Gregg Roemhildt
@roemhildtg
Nov 21 2017 16:48
So I could just get rid of it
Frank Lemanschik
@frank-dspeed
Nov 21 2017 16:48
stable enough for basic jquery replacment
Gregg Roemhildt
@roemhildtg
Nov 21 2017 16:48
I thought can-jquery was required if you use jquery
Frank Lemanschik
@frank-dspeed
Nov 21 2017 16:48
yes jquery was a pollifill for browser api's
nope it is only required if you interact with jquery bindings
Kevin Phillips
@phillipskevin
Nov 21 2017 16:48
can-jquery hasn't been deprecated
Frank Lemanschik
@frank-dspeed
Nov 21 2017 16:49
but normal you should not have stuff using jquery bindings
if you don't massiv use jquery plugins
Gregg Roemhildt
@roemhildtg
Nov 21 2017 16:49
I just use it for ajax and a couple of plugins like datepickers
Frank Lemanschik
@frank-dspeed
Nov 21 2017 16:49
and if you use jquery plugins that you like transform them to nativ
the selectors need replacment and the bindings
i am working on a polifill for that already
why ajax?
why not browser fetch
its the new nativ api
only as migration suggestion :)
Kevin Phillips
@phillipskevin
Nov 21 2017 16:50
is there an issue in can-jquery?
Gregg Roemhildt
@roemhildtg
Nov 21 2017 16:50
There seems to be
Frank Lemanschik
@frank-dspeed
Nov 21 2017 16:51
@phillipskevin no he only supplyed a pull request to update the jquery version and was not sure if that brakes anything
Gregg Roemhildt
@roemhildtg
Nov 21 2017 16:51
Because can-jquery requires an old version of can-dom-data-state
Kevin Phillips
@phillipskevin
Nov 21 2017 16:51
ok, we'd be happy to accept a PR
Frank Lemanschik
@frank-dspeed
Nov 21 2017 16:51
no @roemhildtg thats not because a issue
Gregg Roemhildt
@roemhildtg
Nov 21 2017 16:51
And now I get an error about having two versions of can-dom-data-state
Frank Lemanschik
@frank-dspeed
Nov 21 2017 16:51
you can make a PR to upgrade that
can-dom-data-state is needed from can-util/data/domData
thats it
Kevin Phillips
@phillipskevin
Nov 21 2017 16:52
if can-jquery can't be used with other can- packages, that's an issue
Frank Lemanschik
@frank-dspeed
Nov 21 2017 16:52
its only a storage
@phillipskevin oh yes your right
then it has a issue that is fix able via upgrading can-dom-data-state
:D
Kevin Phillips
@phillipskevin
Nov 21 2017 16:53
@roemhildtg are you going to submit a PR?
otherwise I can see if someone else can fix it
Gregg Roemhildt
@roemhildtg
Nov 21 2017 16:53
Yup
Kevin Phillips
@phillipskevin
Nov 21 2017 16:53
ok thanks
Gregg Roemhildt
@roemhildtg
Nov 21 2017 16:53
I can in a few
Kevin Phillips
@phillipskevin
Nov 21 2017 16:53
:thumbsup:
Frank Lemanschik
@frank-dspeed
Nov 21 2017 16:53
:+1:
Gregg Roemhildt
@roemhildtg
Nov 21 2017 17:11
canjs/can-jquery#148 canjs/can-stache-bindings#359
Austin Kurpuis
@imaustink
Nov 21 2017 21:55
@nriesco would it be possible to get a JSBin/JSFiddle to replicate the @index issue you came across? I am so far unable to replicate it.