canjs / can-util

Essential utilities used by lots of CanJS's projects.
https://canjs.com/doc/can-util.html
MIT License
10 stars 8 forks source link

Fix: can-dom-data-state #409

Closed frank-dspeed closed 6 years ago

matthewp commented 6 years ago

This shouldn't be needed, nothing in canjs 4.0 depends on can-util/dom/data any more.

frank-dspeed commented 6 years ago

@matthewp it is because ;) they depend on can-dom-data-state

needs to get upgraded else it has wrong version of that because the lower versions of that packages are requiring 0.2.0

frank-dspeed commented 6 years ago

@matthewp i tested it in production at present 👍 i have installed the new releases and that was erroring you can't have 2 ... versions of ... you know :)

matthewp commented 6 years ago

Yeah, but nothing should be using 'can-event-dom-enter' or 'can-event-dom-radiochange' either. If you look at where they are used like here: https://github.com/canjs/can-util/blob/bc329003ee09f39f2bdadebf0f1a3c3dcf4939c0/dom/events/radiochange/radiochange.js#L30 . it is deprecated.

So if any 4.0 package is using this stuff in can-util, that is what should be fixed. can-util/dom is essentially all deprecated.

frank-dspeed commented 6 years ago

@matthewp @phillipskevin this needs merge!

Error: You can't have two versions of can-dom-data-state, check your dependencies
    at Object.<anonymous> (file:/media/sf_peep-server/applications/node_modules/can-util/node_modules/can-dom-data-state/can-dom-data-state.js:80:8)
    at file:/media/sf_peep-server/applications/node_modules/can-util/node_modules/can-dom-data-state/can-dom-data-state.js:85:4
    at file:/media/sf_peep-server/applications/node_modules/can-util/node_modules/can-dom-data-state/can-dom-data-state.js:85:98
    at Script.runInThisContext (vm.js:65:33)
    at Object.runInThisContext (vm.js:199:38)
    at doEval (/media/sf_peep-server/applications/node_modules/steal/main.js:3942:10)
    at __eval (/media/sf_peep-server/applications/node_modules/steal/main.js:3990:7)
    at Loader.exec [as __exec] (/media/sf_peep-server/applications/node_modules/steal/main.js:2115:5)
    at load.metadata.execute (/media/sf_peep-server/applications/node_modules/steal/main.js:3058:12)
    at linkDynamicModule (/media/sf_peep-server/applications/node_modules/steal/main.js:2449:32) errors: [ [Circular] ] }
  finalhandler default 500 +0ms
  compression gzip compression +0ms
TypeError: Converting circular structure to JSON
    at JSON.stringify (<anonymous>)
    at GeneralError.FeathersError [as constructor] (/media/sf_peep-server/node_modules/@feathersjs/errors/lib/index.js:28:31)
    at new GeneralError (/media/sf_peep-server/node_modules/@feathersjs/errors/lib/index.js:170:17)
    at /media/sf_peep-server/node_modules/@feathersjs/errors/lib/error-handler.js:33:15
    at Layer.handle_error (/media/sf_peep-server/node_modules/express/lib/router/layer.js:71:5)
    at trim_prefix (/media/sf_peep-server/node_modules/express/lib/router/index.js:315:13)
    at /media/sf_peep-server/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/media/sf_peep-server/node_modules/express/lib/router/index.js:335:12)
    at SafeStream.next (/media/sf_peep-server/node_modules/express/lib/router/index.js:275:10)
    at SafeStream.emit (events.js:160:13)
frank-dspeed commented 6 years ago

@matthewp @phillipskevin

├─┬ can-util@3.11.1
│ ├── 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.5
│   └── can-dom-data-state@0.2.0  deduped
matthewp commented 6 years ago

Yeah, I understand, the question is where is can-util/dom/data/data being merged from? Is it your code? if so use can-dom-data-state directly.

phillipskevin commented 6 years ago

The other point is that this cannot be merged. It would break all CanJS@3.0 apps because of this same reason.

frank-dspeed commented 6 years ago

@matthewp when can-util gets installed it self ships with wrong version of can-dom-data-state

frank-dspeed commented 6 years ago

@matthewp then we are forced to update can-util@4

phillipskevin commented 6 years ago

@frank-dspeed yes, we understand. But the error only gets thrown when that wrong version is imported. Can you figure out what is importing it in your app?

frank-dspeed commented 6 years ago

@matthewp @phillipskevin found the places they are donejs related will submit prs

phillipskevin commented 6 years ago

Thanks. Going to close this.