These are chat archives for canjs/canjs

21st
Feb 2018
Frank Lemanschik
@frank-dspeed
Feb 21 2018 12:22
@jeroencornelissen when i understood you right
you can return from getTemplate() => stache('<templateString')
that works at last for me
but you should maybe consider the following extra
getTemplate should get called with scope
and then return also stache(templateString)(scope)
Dovid Bleier
@dbleier
Feb 21 2018 12:33
if sending non-data messages to the server, would one still use can-connect or is that overkill? If so, what is recommended? can-ajax? something else? thanks.
Jeroen Cornelissen
@jeroencornelissen
Feb 21 2018 12:59
@frank-dspeed yes, that is how I do it now. Many thanks to @roemhildtg !!
@dbleier We use a can-construct with some functions that call can-ajax or $.ajax
Dovid Bleier
@dbleier
Feb 21 2018 13:04
@jeroencornelissen ok, I was thinking something along those lines, thanks
Frank Lemanschik
@frank-dspeed
Feb 21 2018 13:45
what are none data messages?
lol
Messages are DATA?
Dovid Bleier
@dbleier
Feb 21 2018 14:40
meaning not database related
for example command requests for the server to do something, where I don't really need a response back
Frank Lemanschik
@frank-dspeed
Feb 21 2018 14:51
ah ok your talking about RTP
Remote Transfer Protocol
don't sends a response back
TCP/IP Always does
Eben
@eben-roux
Feb 21 2018 15:21
hi folks
anyone know why I'd be getting this?
image.png
Error: Error loading "can-globals@0.3.0#is-web-worker/is-web-worker" at http://localhost:63342/Shuttle.Access.Site/node_modules/can-globals/is-web-worker/is-web-worker.js
the odd thing is I have another project and it works fine there
same versions of everything although there is going to be something different I'm sure
the can-globals in the working project has the /is-web-worker/ folder yet the other does not
Kevin Phillips
@phillipskevin
Feb 21 2018 15:24
what version?
npm ls can-globals
Eben
@eben-roux
Feb 21 2018 15:24
the one that doesn't work is v0.3.0 and the working one is v1.0.0
Kevin Phillips
@phillipskevin
Feb 21 2018 15:24
yeah... 0.3.0 didn't have that module
Eben
@eben-roux
Feb 21 2018 15:24
let me check
quite a tree:
+-- can-component@4.0.4
| +-- can-control@4.0.2
| | `-- can-dom-events@1.1.1
| |   `-- can-globals@1.0.1
| +-- can-dom-events@1.1.1
| | `-- can-globals@1.0.1  deduped
| +-- can-dom-mutate@1.0.3
| | `-- can-globals@1.0.1
| +-- can-globals@1.0.1
| +-- can-util@3.10.18
| | +-- can-event-dom-radiochange@1.0.5
| | | `-- can-globals@0.3.0  deduped
| | `-- can-globals@0.3.0  deduped
| +-- can-view-callbacks@4.0.1
| | `-- can-globals@1.0.1
| `-- can-view-model@4.0.1
|   `-- can-globals@1.0.1
+-- can-compute@4.0.2
| `-- can-event-queue@1.0.1
|   `-- can-dom-events@1.0.7
|     `-- can-globals@0.3.0  deduped
+-- can-connect@2.0.4
| +-- can-ajax@1.1.4
| | `-- can-globals@0.3.0  deduped
| +-- can-types@1.1.5
| | `-- can-globals@0.3.0  deduped
| +-- can-util@3.11.3
| | `-- can-globals@0.3.0  deduped
| `-- can-view-import@4.0.2
|   `-- can-globals@0.3.0  deduped
+-- can-route@4.1.1
| +-- can-dom-events@1.1.1
| | `-- can-globals@1.0.1
| `-- can-globals@0.3.0
+-- can-route-pushstate@4.0.2
| +-- can-dom-events@1.1.1
| | `-- can-globals@1.0.1
| `-- can-globals@0.3.0  deduped
+-- can-stache@4.1.2
| +-- can-globals@1.0.1
| `-- can-view-target@4.0.1
|   `-- can-globals@1.0.1
+-- can-stache-bindings@4.0.5
| +-- can-dom-events@1.1.1
| | `-- can-globals@1.0.1  deduped
| +-- can-event-dom-radiochange@2.1.0
| | `-- can-globals@1.0.1  deduped
| +-- can-globals@1.0.1
| `-- can-types@1.1.6
|   `-- can-globals@1.0.1  deduped
`-- shuttle-can-api@1.0.4
  `-- can-util@3.11.3
    `-- can-globals@0.3.0  deduped
that's the one that ends up in 0.3.0
here's the one going to v1.0.0:
+-- can-component@4.0.4
| +-- can-dom-events@1.1.1
| | `-- can-globals@1.0.0  deduped
| +-- can-dom-mutate@1.0.2
| | `-- can-globals@1.0.0  deduped
| +-- can-globals@1.0.0
| +-- can-stache@4.1.2
| | `-- can-globals@1.0.0  deduped
| +-- can-util@3.11.2
| | +-- can-event-dom-radiochange@1.0.5
| | | `-- can-globals@1.0.0  deduped
| | `-- can-globals@1.0.0  deduped
| +-- can-view-callbacks@4.0.0
| | `-- can-globals@1.0.0  deduped
| `-- can-view-model@4.0.0
|   `-- can-globals@1.0.0  deduped
+-- can-connect@2.0.4
| +-- can-ajax@1.1.4
| | `-- can-globals@1.0.0  deduped
| +-- can-types@1.1.6
| | `-- can-globals@1.0.0  deduped
| `-- can-view-import@4.0.1
|   `-- can-globals@1.0.0  deduped
+-- can-route@4.1.1
| `-- can-globals@1.0.0  deduped
+-- can-route-pushstate@4.0.2
| `-- can-globals@1.0.0  deduped
+-- can-stache@4.1.2
| +-- can-globals@1.0.0  deduped
| `-- can-view-target@4.0.0
|   `-- can-globals@1.0.0  deduped
`-- can-stache-bindings@4.0.5
  +-- can-event-dom-radiochange@2.1.0
  | `-- can-globals@1.0.0  deduped
  `-- can-globals@1.0.0  deduped
Kevin Phillips
@phillipskevin
Feb 21 2018 15:28
are you using a package-lock or yarn.lock?
Eben
@eben-roux
Feb 21 2018 15:28
ah, seems to be my shuttle-can-api that is up to no good... let me check
I have a package-lock
Kevin Phillips
@phillipskevin
Feb 21 2018 15:28
you could try deleting it, clearing out your node_modules, and re-installing
could just be a locked version not allowing it to update
Eben
@eben-roux
Feb 21 2018 15:29
let me try
Frank Lemanschik
@frank-dspeed
Feb 21 2018 15:29
a other well known trick is the following
npm install can-globals@1.0.0 --save
after that npm ls if your on current npm version you should get all deduped to 1.0.0
and after that if you do npm remove can-globals
all should get 1.0.0
Eben
@eben-roux
Feb 21 2018 15:30
@frank-dspeed that'll probably work but then I'd be "referencing" it directly, right?
Frank Lemanschik
@frank-dspeed
Feb 21 2018 15:30
no
Eben
@eben-roux
Feb 21 2018 15:30
ah, ok
so add and then remove
Frank Lemanschik
@frank-dspeed
Feb 21 2018 15:30
it is ok to do that temporay
Kevin Phillips
@phillipskevin
Feb 21 2018 15:30
you shouldn't need to do that
Eben
@eben-roux
Feb 21 2018 15:30
I'll check the package-lock
Frank Lemanschik
@frank-dspeed
Feb 21 2018 15:31
it saves redownloading all the npm modules
Kevin Phillips
@phillipskevin
Feb 21 2018 15:31
if you have nested versions already, that won't fix it right?
Frank Lemanschik
@frank-dspeed
Feb 21 2018 15:31
it will fix it
i use that flow often with canjs apps
when such dependency stuff happens
also works good for upgrades
npm team did fix a lot
Frank Lemanschik
@frank-dspeed
Feb 21 2018 15:37
oh and i want to share a secund good method search and replace in the package-lock.json and npm install should also fix
Eben
@eben-roux
Feb 21 2018 15:40
makes sense @frank-dspeed
Frank Lemanschik
@frank-dspeed
Feb 21 2018 15:40
i love when my broken english makes sense :)
Eben
@eben-roux
Feb 21 2018 15:48
thanks folks... that issue is sorted!
Kevin Phillips
@phillipskevin
Feb 21 2018 15:54
awesome, so it was just a locked version?
Frank Lemanschik
@frank-dspeed
Feb 21 2018 15:55
it can also be a cached resolved version @phillipskevin
npm stores now like yarn its own data in .npmrc
Eben
@eben-roux
Feb 21 2018 15:55
@phillipskevin I did go with the big hammer and deleted the package-lock... will try Franks scalpel at some later stage. I published some of my package too so decided to just download everything again anyway.
Kevin Phillips
@phillipskevin
Feb 21 2018 15:56
:thumbsup:
Frank Lemanschik
@frank-dspeed
Feb 21 2018 15:56
next time if you want to update packages
Eben
@eben-roux
Feb 21 2018 15:56
any cache should be storing the same version though I'd reckon
Frank Lemanschik
@frank-dspeed
Feb 21 2018 15:56
use npm outdates and then npm update can-outdated can-xxx
Eben
@eben-roux
Feb 21 2018 15:56
given that you cannot publish over an existing version
Frank Lemanschik
@frank-dspeed
Feb 21 2018 15:56
this will update only that packages
and also all sub dependencys
Eben
@eben-roux
Feb 21 2018 15:57
I updated the outdated packages as well :)
Frank Lemanschik
@frank-dspeed
Feb 21 2018 15:57
if you remove package lock befor
a lock file now gets linked to resolve info in your npmrc directory
Eben
@eben-roux
Feb 21 2018 15:57
been busy with .net core refactoring so need to get back into the canjs swing of things
Frank Lemanschik
@frank-dspeed
Feb 21 2018 15:57
if no lock exists this cache don't get touched
if lock exist cache get touched
Eben
@eben-roux
Feb 21 2018 15:57
ah, ok
Frank Lemanschik
@frank-dspeed
Feb 21 2018 15:58
and there is a no lock setting in package.json
if you general want no lock file
that saves you the trouble with creating deleting if you don't use that flow anyway
Eben
@eben-roux
Feb 21 2018 15:58
interesting...
will keep it in mind; until I forget, that is
Frank Lemanschik
@frank-dspeed
Feb 21 2018 16:01
@eben-roux you need a extra file sorry
i was to far in future the lock parameter for package.json as boolean is not existing at present
will come in some month :)
at present you would create a .npmrc file
in your project with the following content
package-lock=false
or you can set it global
npm config set package-lock false
in my dev environment i use that global setting
and the ci don't has that setting so it publishes with lock
in general thats the best flow overall
Eben
@eben-roux
Feb 21 2018 16:04
nifty
Frank Lemanschik
@frank-dspeed
Feb 21 2018 16:04
thanks i am sorry that i did not found time to finish my started guides about all that
but i am planning massiv guide releases in 2018 about development workflows i will keep you informed
i have invented really slick dev environments
with as much release automation as possible
Eben
@eben-roux
Feb 21 2018 16:05
there is just a ton of stuff to learn nowadays so I'm quite glad I'm not getting into development in this day-and-age!
Frank Lemanschik
@frank-dspeed
Feb 21 2018 16:06
also new Repo type Called Hybrid Repo
a Mix of Mono and Multi Repo
:D
including automated flows
so you have both a single repo to track them all and still individual packages
using git submodules as main tech
worked with Linus on that directly
the creator of git to define standarts for javascript development with git
because the industrie needs standarts to enforce security
and this package workflows have a bunch of complex security issues as npm packages can get hacked and all that
thats also why the github security risk implamentation now exists for javascript packages
Eben
@eben-roux
Feb 21 2018 16:10
I've received some security warnings from github about packages I use...
Frank Lemanschik
@frank-dspeed
Feb 21 2018 16:14
ah perfect
so it works :)
in future we will also block install of that
via npm integration ;)
we also have runkit implamented look at that slick stuff
a full canjs playground
but it gets even better this runs it all server side
:D so you could for example run your server side packages there
like donejs apps
same like jsbin for frontend for the nodejs backend
with all npm packages pre installed!
and free api
Eben
@eben-roux
Feb 21 2018 16:17
well, well, well... look at that
have to give it a spin some time
Frank Lemanschik
@frank-dspeed
Feb 21 2018 16:18
yes sure you should do that :)
you can now test every package online
without installation
the next step is now to combine it with some frontend rendering then we can do frontend backend examples in the same environment
all without install
Frank Lemanschik
@frank-dspeed
Feb 21 2018 16:25
i will try to release this year a Plugin for vscode and atom to online edit and export that
for frontend and backend this will allow to develop modules online without install of dependencys
will save a lot of time