These are chat archives for canjs/canjs

31st
Jan 2018
Gregg Roemhildt
@roemhildtg
Jan 31 2018 17:51
Is htmlbool types no longer supported in 4.x? like where I could have an attribute active if set becomes true? The warnings in 3.x seem to indicate this should now be active:from="true"
Gregg Roemhildt
@roemhildtg
Jan 31 2018 18:29

btw @frank-dspeed I found the part of code that is causing the error from yesterday: It looks like this:

      {{#if(isSaving)}}
        <div class="loading"></div>
      {{else}}
        <can-slot this:from="this" name="submit">
          <div class="btn-group" role="group" aria-label="Form Buttons">
              <button type="button" class="btn btn-primary" on:el:click="dispatchEvent('submit')">
                <i class="fa fa-floppy-o"></i> Submit</button>            
                <button type="button" class="btn btn-primary" on:el:click="dispatchEvent('cancel')">
                <i class="fa fa-ban"></i> Cancel</button>
          </div>
        </can-slot>
      {{/if}}

https://jsbin.com/ceyixokoce/edit?html,js,output

when isSaving gets set to true, the error occurs.
Gregg Roemhildt
@roemhildtg
Jan 31 2018 18:39
can-stache-bindings.js:257- can-slot element, attributeListener is undefined, which eventually causes the error
Brad Momberger
@bmomberger-bitovi
Jan 31 2018 18:57
@roemhildtg 'htmlbool' still exists. We do still warn about {{#if active}}active="active"{{/if}} forms for component tags but that is meant to discourage using the form for passing string values to components.
I think this has been overlooked in the 3->4 process, that stache bindings can set element attribute values using el:some-attr:from="vmProp" forms but not add and remove the attribute based on truthiness.
Probably a good step for can-stache-bindings is to add :if as a binding
so el:active:if="active" would set the attribute if active was true in the parent scope.
Kevin Phillips
@phillipskevin
Jan 31 2018 19:11
but not add and remove the attribute based on truthiness
@bmomberger-bitovi why do you need bindings for that?
I think what we all want is for can-log to STFU.
The question is how.
Kevin Phillips
@phillipskevin
Jan 31 2018 19:14
that warning should only be displayed if active is a property on the viewModel
which is what is actually deprecated and removed in 4.0
Gregg Roemhildt
@roemhildtg
Jan 31 2018 19:20
Okay, I misspoke. The htmlbool type works as expected. It was the case where active="true" I think.
Gregg Roemhildt
@roemhildtg
Jan 31 2018 19:52
So that error above, it seems like the can-slot element is not getting an attributeListener assigned, but when the element is removed, it looks like can-stache-bindings is trying to remove the undefined attributeListener. Does it sound like I'm on the right track here?
Frank Lemanschik
@frank-dspeed
Jan 31 2018 20:28
guys
in bitballs its updated
you can look into it at any time :D
currentActive is a property now
Frank Lemanschik
@frank-dspeed
Jan 31 2018 21:48
does some one know how to debug such errors Potentially unhandled rejection [4] renderInZone/zonePromise<@http://localhost:8080/src/index.stache:241:17 anonymous/</exports.then/</callback<@http://localhost:8080/node_modules/can-zone/lib/tasks.js:150:12 anonymous/</Task.prototype.run@http://localhost:8080/node_modules/can-zone/lib/zone.js:42:9 anonymous/</Zone.prototype.runTask@http://localhost:8080/node_modules/can-zone/lib/zone.js:184:9 anonymous/</Zone.prototype.waitFor/<@http://localhost:8080/node_modules/can-zone/lib/zone.js:285:10 wrapped@http://localhost:8080/node_modules/can-zone/lib/zones/debug.js:50:17 callWith/<@http://localhost:8080/node_modules/can-zone/lib/tasks.js:161:12 tryCatchReject@http://localhost:8080/node_modules/steal/steal.js:1183:28 runContinuation1@http://localhost:8080/node_modules/steal/steal.js:1142:4 makePromise/Rejected.prototype.when@http://localhost:8080/node_modules/steal/steal.js:963:4 makePromise/Pending.prototype.run@http://localhost:8080/node_modules/steal/steal.js:821:5 [3]</</</Scheduler.prototype._drain@http://localhost:8080/node_modules/steal/steal.js:97:4 Scheduler/this.drain@http://localhost:8080/node_modules/steal/steal.js:62:4 run@http://localhost:8080/node_modules/steal/steal.js:268:4 steal.js:140:22 unhandledRejection/logError< http://localhost:8080/node_modules/steal/steal.js:140:22 report http://localhost:8080/node_modules/steal/steal.js:167:5 flush http://localhost:8080/node_modules/steal/steal.js:189:5
i always have something that fails in zone but i never get to the point where that is
Gregg Roemhildt
@roemhildtg
Jan 31 2018 21:49
I think you gotta set a breakpoint in the tasks.js, then figure out what is causing the error by tracing up the stack
Frank Lemanschik
@frank-dspeed
Jan 31 2018 21:51
which tasks js?
its a steal file or what?
Gregg Roemhildt
@roemhildtg
Jan 31 2018 21:51
can-zone/lib/tasks.js:150
Frank Lemanschik
@frank-dspeed
Jan 31 2018 21:52
ah good idea again a can-zone-debug :) is needed
Gregg Roemhildt
@roemhildtg
Jan 31 2018 21:52
I don't really have a great answer though. I've struggled with that myself a bunch. My situation was dealing with socket.io
Frank Lemanschik
@frank-dspeed
Jan 31 2018 21:52
did you got this break point stuff in can4 working?
Gregg Roemhildt
@roemhildtg
Jan 31 2018 21:52
which is NOT supported at this point
afaik
Frank Lemanschik
@frank-dspeed
Jan 31 2018 21:52
socket.io is supported
Gregg Roemhildt
@roemhildtg
Jan 31 2018 21:52
I haven't gotten 4.x to work yet
Ran into issues with can-util
Frank Lemanschik
@frank-dspeed
Jan 31 2018 21:52
but you need to wrap it with can-zone
ah do you want a can-util
compatible version?
for migration i have one wait
Gregg Roemhildt
@roemhildtg
Jan 31 2018 21:53
I wasn't even using can-util
Frank Lemanschik
@frank-dspeed
Jan 31 2018 21:53
i know i know
it was a fail befor
if you install now fresh it should be fixed
Gregg Roemhildt
@roemhildtg
Jan 31 2018 21:53
Okay
Frank Lemanschik
@frank-dspeed
Jan 31 2018 21:53
wait
maybe more easy fix is
simply install my compat version
as this can happen on many places
simply npm install https://github.com/frank-dspeed/can-util --save
till you upgraded all done-ssr and can packages via
npm outdated
to the latest versions
which can take some time
this can-util version uses can-dome-data-state latest
so you don't get this warnings and that
:D
Kevin Phillips
@phillipskevin
Jan 31 2018 21:55
fyi - we can't do this with the real can-util
since it will break canjs 3.0 apps
Frank Lemanschik
@frank-dspeed
Jan 31 2018 21:56
we can still release can-util 4
and simply pin olders down to 3.xx
i see no problem with that at all
Kevin Phillips
@phillipskevin
Jan 31 2018 21:56
we could, but we're not going to
Frank Lemanschik
@frank-dspeed
Jan 31 2018 21:56
ya no problem it works now all well
but this can-util version helps migrating
and getting things up fast
so no problem
when all is up to date simply can-util@latest and all is as it should be
so no pain i did the same flow
Kevin Phillips
@phillipskevin
Jan 31 2018 21:59
cool
Frank Lemanschik
@frank-dspeed
Jan 31 2018 21:59
but the new features
arn't working as expected out of the box
i get no autorender-breakpoints :(
Kevin Phillips
@phillipskevin
Jan 31 2018 22:00
updating donejs to work with canjs 4.0 is still in progress
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:00
i have done it
i see no open issues
it works i am using ssr all
Gregg Roemhildt
@roemhildtg
Jan 31 2018 22:01
and there's a conflict with multiple versions
Kevin Phillips
@phillipskevin
Jan 31 2018 22:01
yes... that's going to stay that way
Gregg Roemhildt
@roemhildtg
Jan 31 2018 22:01
Ah that's what you were discussing
Kevin Phillips
@phillipskevin
Jan 31 2018 22:02
but nothing in canjs 4.0 should be importing can-util/dom/*
so nothing should be importing that version of can-dom-data-state
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:02
and nothing did but done-ssr does
the new done-ssr does not
since some hours or 1 day
so now all is working without my git magic
:D
Kevin Phillips
@phillipskevin
Jan 31 2018 22:02
right... donejs might not be totally updated yet
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:02
with the done pre versions
Kevin Phillips
@phillipskevin
Jan 31 2018 22:03
@matthewp is working on it
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:03
@phillipskevin i did supply my working version as update to the generator
Gregg Roemhildt
@roemhildtg
Jan 31 2018 22:03
Hmm, So I'm pretty sure I clean installed everything and I'm NOT using done-ssr in a project but I'm getting
steal.js:7390 Error: Error loading "can-component@4.0.0#can-component" at http://192.168.9.83:8081/node_modules/can-component/can-component.js
Error loading "can-component@4.0.0#can-component" from "spectre-canjs@1.0.1#index" at http://192.168.9.83:8081/index.js
Did not find ./node_modules/can-dom-data-state/package.json
Unable to find a compatible version of can-dom-data-state
Wanted: ^1.0.0
Found: 0.2.0
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:03
major branch
Kevin Phillips
@phillipskevin
Jan 31 2018 22:04
do you have a package-lock @roemhildtg ?
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:04
@roemhildtg delete package-lock delete node_modules
Gregg Roemhildt
@roemhildtg
Jan 31 2018 22:04
I did delete that at one point. Try that again...
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:04
update all packages to latest version
Kevin Phillips
@phillipskevin
Jan 31 2018 22:04
it's a direct dependency of can-component: https://github.com/canjs/can-component/blob/master/package.json#L44
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:04
always use npm outdated
is outdated i think
Kevin Phillips
@phillipskevin
Jan 31 2018 22:04
you can also run npm ls --depth=0 and it will give you scary warnings if dependencies are missing
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:05
yes can-component@4.0.1 is current
Kevin Phillips
@phillipskevin
Jan 31 2018 22:06
yes, you two are on the bleeding edge
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:06
yes i know :)
but it was anyway needed
the old app stoped working got to big to undebug able
to much time presure
so i choosed to directly migrate because of better errors
:D
at some places it helped!
Gregg Roemhildt
@roemhildtg
Jan 31 2018 22:07
Aha
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:07
i found some wirred stuff i did
Gregg Roemhildt
@roemhildtg
Jan 31 2018 22:07
+-- can-component@4.0.1
| +-- can-dom-data-state@1.0.1
| `-- can-stache-bindings@4.0.3
|   `-- can-dom-data-state@1.0.1
+-- can-connect@2.0.1
| `-- can-view-import@4.0.1
|   `-- can-dom-data-state@1.0.1
+-- can-stache@4.0.2
| `-- can-dom-data-state@1.0.1
`-- can-util@3.11.2
  +-- 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
Kevin Phillips
@phillipskevin
Jan 31 2018 22:07
that looks alright
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:07
install my can-util version
Kevin Phillips
@phillipskevin
Jan 31 2018 22:08
are you seeing an error with multiple versions of can-dom-data-state?
Gregg Roemhildt
@roemhildtg
Jan 31 2018 22:08
Yep
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:08
if he sees that its because done-ssr version
Kevin Phillips
@phillipskevin
Jan 31 2018 22:08
are you using steal?
Gregg Roemhildt
@roemhildtg
Jan 31 2018 22:08
Yep
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:08
do npm ls done-ssr
Kevin Phillips
@phillipskevin
Jan 31 2018 22:08
in the browser console, look at System._traceData.parentMap
Gregg Roemhildt
@roemhildtg
Jan 31 2018 22:08
Nope, no done-ssr
Kevin Phillips
@phillipskevin
Jan 31 2018 22:08
and see what is loading can-dom-data-state@0.2.0
Gregg Roemhildt
@roemhildtg
Jan 31 2018 22:09
an-dom-data-state@0.2.0#can-dom-data-state:
can-util@3.11.2#dom/data/data
:
true
can-util@3.11.2#dom/mutation-observer/document/document
:
true
can-util@3.11.2#js/cid/get-cid
:
true
Kevin Phillips
@phillipskevin
Jan 31 2018 22:10
you're going to have to keep walking up
to see what in your app is loading those things
Gregg Roemhildt
@roemhildtg
Jan 31 2018 22:10
Okay
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:10
my tip for finding that was
Kevin Phillips
@phillipskevin
Jan 31 2018 22:10
sorry there's not an easier way
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:10
search inside node_modules for string
can-util/dom/data
also in your project
then you know the package that references it wrong
but also simply run npm outdated
and look if all is latest
then this shouldn't happen
Kevin Phillips
@phillipskevin
Jan 31 2018 22:11
there are things that haven't been updated
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:11
what do you mean?
can-connect-feathers   4.0.0-pre.2   4.0.0-pre.2   3.7.1  applications
can-define-backup      1.0.0-pre.1   1.0.0-pre.1   0.0.1  applications
can-util                    3.11.2           git     git  applications
done-autorender       2.0.0-pre.11  2.0.0-pre.11   1.5.2  applications
done-component         2.0.0-pre.1   2.0.0-pre.1   1.0.1  applications
done-serve             2.0.0-pre.0   2.0.0-pre.0   1.5.0  applications
Kevin Phillips
@phillipskevin
Jan 31 2018 22:12
like a 1.0.0 of can-define-backup hasn't been published
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:12
all is updated
ya
that works
with the pre version
i posted about that on the wip issue
Kevin Phillips
@phillipskevin
Jan 31 2018 22:12
i know
thank you for doing that
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:12
feathers and define-backup is left but we can use pre versions
they are working for me
Kevin Phillips
@phillipskevin
Jan 31 2018 22:12
but there are other ecosystem things that don't have pres even
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:13
i am not using them :D
they arn't importent
lol
but i want to use can-migrate
need to recode that complet
Kevin Phillips
@phillipskevin
Jan 31 2018 22:13
@roemhildtg might be, that's all I mean
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:13
found out it crashes badly
:D
Kevin Phillips
@phillipskevin
Jan 31 2018 22:14
why not just put in a PR?
instead of rewriting the whole thing
Gregg Roemhildt
@roemhildtg
Jan 31 2018 22:14
Alrighty, I'll look into this more tomorrow. Thanks guys!
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:14
because its fail by design needs to get rewriten using streams
it errors because to many args
over 2500 000
so
:D
Kevin Phillips
@phillipskevin
Jan 31 2018 22:14
because you didn't specify a glob for the files?
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:14
*/
wait
**/*
Kevin Phillips
@phillipskevin
Jan 31 2018 22:15
yeah... why?
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:15
was what i used as i got informed
only that works
maybe project to big files to big
i looked into the code for me it was a horror i do a lot of file processing devops tasks
Kevin Phillips
@phillipskevin
Jan 31 2018 22:15
no... you don't need to update your node_modules
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:16
i don't talk about node_modules
i have big projects
:D
Kevin Phillips
@phillipskevin
Jan 31 2018 22:16
**/* will update every file in node_modules
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:16
but i tryed also in a single component
ah thats not cool
then i got wrong instructions
:D
how would you run can migrate against the src folder?
Kevin Phillips
@phillipskevin
Jan 31 2018 22:17
can-migrate --apply src/*.js
fyi, there is a new version of can-migrate out
can-migrate@2
which has the transforms for canjs 3 -> 4
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:20
lets see what it does
at present it looks like looping forever
All done spawn workers
i am not sure what it does
now it finished
i think it did nothing
always unmodifyed
0 OK
Kevin Phillips
@phillipskevin
Jan 31 2018 22:24
did you expect it to change anything?
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:24
crazy util :)
no but i expect it tells me all OK
at present the syntax should be well i expect it well
but did it manual
Time elapsed: 0.415seconds 
Processing 2 files... 
Spawning 2 workers...
Sending 1 files to free worker...
Sending 1 files to free worker...
All done. 
Results: 
0 errors
2 unmodified
0 skipped
0 ok
it loops like this
and then after a long time stops
Kevin Phillips
@phillipskevin
Jan 31 2018 22:25
yes... so there are 2 js files in your src directory
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:26
lol
Kevin Phillips
@phillipskevin
Jan 31 2018 22:26
it ran them both through each of the transforms
and nothing was changed
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:26
no i get a endless list
like that with always 2 files
and in the src directory in sub directorys
are many files
Kevin Phillips
@phillipskevin
Jan 31 2018 22:27
ok, try can-migrate --apply src/**/*.js
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:27
ya now it looks working
:D
i get errors
that helps thats what i expected
it shows me where i got typos
Kevin Phillips
@phillipskevin
Jan 31 2018 22:29
a linter might be better at that :smile:
but I'm glad it's working
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:29
i will still need to rewrite that
so it don't floods the console
and simply after end displays a result
:D
and i need to do that for stache also or not?
why i am doing only *.js?
Kevin Phillips
@phillipskevin
Jan 31 2018 22:33
there is a --silent option
to not flood the console
you can do src/**/* if you want all the files in your src directory
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:34
ah */ is still a dream
:D
**/*
throws
Kevin Phillips
@phillipskevin
Jan 31 2018 22:35
yeah
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:35
{ Error: spawn E2BIG
    at _errnoException (util.js:1003:13)
    at ChildProcess.spawn (internal/child_process.js:340:11)
    at Object.exports.spawn (child_process.js:499:9)
    at module.exports (/usr/local/lib/node_modules/can-migrate/node_modules/execa/index.js:201:26)
    at series (/usr/local/lib/node_modules/can-migrate/bin/can-migrate.js:132:12)
    at /usr/local/lib/node_modules/can-migrate/node_modules/promise-map-series/index.js:11:14
    at tryCatch (/usr/local/lib/node_modules/can-migrate/node_modules/rsvp/dist/rsvp.js:525:12)
    at invokeCallback (/usr/local/lib/node_modules/can-migrate/node_modules/rsvp/dist/rsvp.js:538:13)
    at publish (/usr/local/lib/node_modules/can-migrate/node_modules/rsvp/dist/rsvp.js:508:7)
    at flush (/usr/local/lib/node_modules/can-migrate/node_modules/rsvp/dist/rsvp.js:2415:5) errno: 'E2BIG', code: 'E2BIG', syscall: 'spawn' }
thats why i recode it
E2BIG isn't acepptable
out of my engineering view
E2BIG means over 2,6 million args
to the spawn process
Kevin Phillips
@phillipskevin
Jan 31 2018 22:36
every file in node_modules... recursively
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:36
thats why i sayed befor fail by design
no node modules my frind
src has only modlets
Kevin Phillips
@phillipskevin
Jan 31 2018 22:37
you did src/**/* or just **/*?
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:37
src/**/*
any way this should never depend on args
and spawn and all that
i make it a single node process stream
no spawn magic
constant ram and mem usage
also needed on servers with less cpu ram
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:49
wow i found out it was less
inside a .component file
damn
this .component files are killing me maybe they are the root of all evil
promises that don't resolve
when i have types in them they fail with a to general error :)
i think they are evil i will replace them as fast as possible
it now first time renders with can-zone
Kevin Phillips
@phillipskevin
Jan 31 2018 22:51
can you open an issue?
in done-component
Frank Lemanschik
@frank-dspeed
Jan 31 2018 22:52
sure
ah your right
its done-component that loads .component files
tricky :)
evil done-component not component files :) but in general i understand that this will not get easy fix able
component files should get deprecated because they lead to parsing errors and all that
and not good debug able even with optimizing that done-component