These are chat archives for canjs/canjs

4th
May 2018
Justin Meyer
@justinbmeyer
May 04 2018 03:08
@eben-roux validate.js doesn’t have any examples on their site?
Jeroen Cornelissen
@jeroencornelissen
May 04 2018 11:17
I’ve installed the CanJS Devtools extension in Chrome. But how do you get the extra tab (CanJS Viewmodel) in Chrome Devtools?
Eben
@eben-roux
May 04 2018 11:17
@justinbmeyer : yip, they do.
The issue is it is shown like so:
image.png
which is great for the "default" installation scenarios:
image.png
Since it is something that is going to be a once-off setting I need to get to that darn validate()business and that has tripped me up... probably a steal issue of sorts which is why a simple example would've been a quick copy/paste as opposed to the long and arduous journey that is steal/canjs configuration :(
Justin Meyer
@justinbmeyer
May 04 2018 14:28
@eben-roux I feel like I'm missing something ... can't you just:
  1. Install validate.js into your dependencies
  2. Create a module (configured-define-validate) that imports validate.js and does what's in your first code example and exports the can-define-validate-validatejs module
  3. Import configured-define-validate
@/all I've put up the docs for can-query-logic (which replaces can-set in 5.0). Please read through its docs and let me know what you find confusing, don't like, etc.
Chasen Le Hara
@chasenlehara
May 04 2018 15:54
@jeroencornelissen We’ll have docs on this soon, but in short:
Well I guess there’s no step 2… can-debug will set window.can so the DevTools can work.
When it’s working, go to the Elements tab in Chrome DevTools and look for CanJS ViewModel in the pane on the right.
You can go to the CanJS home page and inspect the counter component here to see an example: https://canjs.com/index.html#Easytodothecommonstuff
Eben
@eben-roux
May 04 2018 16:07
@justinbmeyer for some odd reason I previously tried to use map in the stache configuration for validate.js which seems like bit of a brain fart.
in any event, I had the dependency and referencing it like:
image.png
the first issue is this:
image.png
now, I guess I could create another module but since it is "global" I reckoned that setting it once should do but I still get the original error:
image.png
I cannot see that a separate module would make a difference but I'll give it a go anyway
Chasen Le Hara
@chasenlehara
May 04 2018 16:11
@eben-roux That warning makes it look like you have validate.js 0.12 installed and can-validate-validatejs is looking for 0.11: https://github.com/canjs/can-validate-validatejs/blob/50e56494f54d0f57ca3775a6cd60833b4ee0827a/package.json#L41
Eben
@eben-roux
May 04 2018 16:13
@chasenlehara thanks... what is the recommendation for scenarios like this?
should I just "downgrade" to the lowest common denominator --- v0.11 in this case?
Eben
@eben-roux
May 04 2018 16:22
I installed v0.11.0 and now I have this:
image.png
Chasen Le Hara
@chasenlehara
May 04 2018 16:23
Same issue: the first line shows that your main.js is importing 0.11.0 but can-validate-validatejs wants ^0.11.1
Eben
@eben-roux
May 04 2018 16:23
pffft... nvm... see it is 0.11.1
lol
Chasen Le Hara
@chasenlehara
May 04 2018 16:23
Ha yeah you got it
Eben
@eben-roux
May 04 2018 16:24
if you can read you can excel
Chasen Le Hara
@chasenlehara
May 04 2018 16:25
For that specific warning, it’d be kinda nice if it pointed out that two different versions were being depended on.
Eben
@eben-roux
May 04 2018 16:25
but would one then be required to use the lowest one in the whole project?
from the links provided in the warning I cannot quite see any proposed solution...
Chasen Le Hara
@chasenlehara
May 04 2018 16:27
Yeah, maybe I’m wrong, but I don’t think the suggestion in the warning is how you would fix that issue.
Does it work correctly when you install 0.11.1?
Eben
@eben-roux
May 04 2018 16:27
it did now use the configured datetime business, so yeah... thanks :)
Chasen Le Hara
@chasenlehara
May 04 2018 16:29
Ok cool, I’ll file an issue to maybe improve that warning
Chasen Le Hara
@chasenlehara
May 04 2018 16:42
stealjs/steal#1391