These are chat archives for canjs/canjs

23rd
Jun 2017
Nils Lundquist
@nlundquist
Jun 23 2017 03:42
@pmgmendes rather than wrap the promise in a second promise that delays the evaluation of the first promise wouldn't it be easier to just wrap it in a function? pass around a function that when called will return the promise from Model.getList()
to me that makes more sense than passing around a promise that isn't doing something async - it sounds like what you want is a synchronous operation that kicks off the asynchronous operation. imo that would make more sense as a function
Nils Lundquist
@nlundquist
Jun 23 2017 03:50
@brent-g can you get an example running in a JSBin? it's a bit hard to read with the current formatting
i think you might have two sets of nested ```
Kevin Phillips
@phillipskevin
Jun 23 2017 03:57
New minor versions of all of the can-* libraries have been published using can-reflect under the hood
Let us know if you see any issues
Frank Lemanschik
@frank-dspeed
Jun 23 2017 06:05
@gsmeets from javascripts point of view this is correct i think that you can't set type number as object name a Object name is type string so your right
you need to do a function that returns string as i think general conversation from numbers to strings would be wrong its a special use case as if you would use a reserved word
frank@frank-MS-7821:~/prove$ npm ls can-compute
prove@0.0.0 /home/frank/prove
└─┬ can-component@3.1.0
  └─┬ can-compute@3.2.0 
    └── can-compute@3.1.0-pre.15  extraneous
whats that
Frank Lemanschik
@frank-dspeed
Jun 23 2017 06:10
can compute 3.1 is installing 3.2 that using 3.1 pre ?
really?
and i am wondering why nothing works :D
now i begin to understand why npm flat solves some problems hahahahhaa
Frank Lemanschik
@frank-dspeed
Jun 23 2017 10:25
@phillipskevin only for your note can-define@1.2.0 is broken and has probally highest priority as it brakes done-serve and probally much more
Matthew Phillips
@matthewp
Jun 23 2017 12:03
i'm looking into it
Kevin Phillips
@phillipskevin
Jun 23 2017 12:14
what do you mean when you say it's broken, @frank-dspeed ?
Matthew Phillips
@matthewp
Jun 23 2017 12:14
donejs chat doesn't work
i confirmed it
looking into why
Kevin Phillips
@phillipskevin
Jun 23 2017 12:14
ok, I didn't release done-serve
so maybe it needs a new version with the new can-util
Matthew Phillips
@matthewp
Jun 23 2017 12:15
maybe
well, done-ssr you mean
what version of can-util is needed?
Jeroen Cornelissen
@jeroencornelissen
Jun 23 2017 12:16
I get this error from steal-stache You can't have two versions of can-cid, check your dependencies
upgraded can-component, can-jquery and steal-stache
that line returns true on an object that is not a define map
Jeroen Cornelissen
@jeroencornelissen
Jun 23 2017 12:23
hmm, removed node_modules and upgraded in an other order and evertything if fixed now.
Frank Lemanschik
@frank-dspeed
Jun 23 2017 12:40
@matthewp @matthewp its can-define
thats broken
i created issues for all that
in repos donejs/donejs can-define done-serve i think also
Matthew Phillips
@matthewp
Jun 23 2017 12:43
yeah, i know it is
Frank Lemanschik
@frank-dspeed
Jun 23 2017 12:44
sorry matthewp it was more for kevin who asked why done-serve is broken
just following up
Matthew Phillips
@matthewp
Jun 23 2017 12:44
i'm working on it
thanks for the report
Frank Lemanschik
@frank-dspeed
Jun 23 2017 12:45
no problem would be nice if we could debug the other error after that
the steal-socket.io one
and production.html development.html one
:D
thats more importent only ssr works
thats why all your test projects always work :D
your using done-ssr-middelware
via express
that always works
:D
Matthew Phillips
@matthewp
Jun 23 2017 13:13
canjs/can-define#217
Frank Lemanschik
@frank-dspeed
Jun 23 2017 13:14
npm install --save git://github.com/canjs/can-define#ef
verifyed
it works
release it as soon as possible
now we could focus on the real meat the one with no error messages :D
i'll look at your steal-socket.io issue
Frank Lemanschik
@frank-dspeed
Jun 23 2017 13:48
its not steal-socket.io it self
please look at this
direktspeed/prove-bugs#1
thats the real hard stuff
and there the steal-socket.io part is a small part
has a real easy receipe
donejs add app && donejs add feathers
Kevin Phillips
@phillipskevin
Jun 23 2017 14:14
Thanks @matthewp for quickly fixing that can-define issue
Frank Lemanschik
@frank-dspeed
Jun 23 2017 14:33
yes the fix was really fast and great done :)
i would never find such fails in this code
else i would solve them my self
Frank Lemanschik
@frank-dspeed
Jun 23 2017 15:00
can some one in here show me how to enable done-autorender debug mode so i can see when zones don't resolve :)
i think done-autorender debug is a key element that solves all my problems with not rendering donejs-apps
Matthew Phillips
@matthewp
Jun 23 2017 15:04
@frank-dspeed someone else is working on a version of done-autorender without zones
you might wait for that to be released, or don't use done-autorender if you don't need ssr
Frank Lemanschik
@frank-dspeed
Jun 23 2017 15:04
i know from the bitcentiv project
i researched it because it aimed to use feathersjs
why does done-autorender need zones and all that i don't understand all this :)
why can't it simply work
and why does it work with ssr
whats the diffrence
can't we simply do the same what ssr does client side
:D
i wish i would have a complet overview of what you all did and why
Frank Lemanschik
@frank-dspeed
Jun 23 2017 15:09
i want to code a frontend that don't needs to deploy a additional ssr server for don't know what :)
the build result are already small packages after that http2 takes over who should want to host a nodejs exta cluster
for his production app
backend frontend thats a good combo but this ssr stuff i don't know who got that idea its a special case where it gets usefull a really special one
Kevin Phillips
@phillipskevin
Jun 23 2017 15:13
you don't have to use SSR
Matthew Phillips
@matthewp
Jun 23 2017 15:14
The reason done-autorender uses Zones is because when you ssr an app it is fully rendered, and when done-autorender does it's own rendering it doesn't insert into the DOM until the rendering is complete.
So it uses Zones to know when rendering is complete on the client.
So you don't need this functionality if your app is not server-rendered.
Frank Lemanschik
@frank-dspeed
Jun 23 2017 15:14
ah!
so we could call it can-autorender
:D
Matthew Phillips
@matthewp
Jun 23 2017 15:14
Here's the issue: donejs/autorender#27
Frank Lemanschik
@frank-dspeed
Jun 23 2017 15:15
when it don't uses this zones
Matthew Phillips
@matthewp
Jun 23 2017 15:15
there's already a can-autorender when is something similar but different :(
Frank Lemanschik
@frank-dspeed
Jun 23 2017 15:16
ok hmm wirred what will get the name of the other autorender
Matthew Phillips
@matthewp
Jun 23 2017 15:17
not sure yet, it might be another module inside of done-autorender
Frank Lemanschik
@frank-dspeed
Jun 23 2017 15:17
ok any timeframe for that?
can i speed that up?
i ask because else i need to deploy a extra ssr cluster
that was not planned
:D
Julian
@pYr0x
Jun 23 2017 15:25
hello guys
Mohamed Cherif Bouchelaghem
@cherifGsoul
Jun 23 2017 15:26
hey @pYr0x
Julian
@pYr0x
Jun 23 2017 15:26
hey cherif, are you joinen us today?
Mohamed Cherif Bouchelaghem
@cherifGsoul
Jun 23 2017 15:26
yeah :)
Justin Meyer
@justinbmeyer
Jun 23 2017 15:28
Frank Lemanschik
@frank-dspeed
Jun 23 2017 15:54
oh this new syntax solves my socket.on problems
:D
Frank Lemanschik
@frank-dspeed
Jun 23 2017 16:34
@justinbmeyer you should create can-connect-stream and then simply map that stream ordered with behaviers. a connection is ideal for a stream
Nils Lundquist
@nlundquist
Jun 23 2017 17:39
@frank-dspeed I think I know what you're getting at but can you give an example in pseudocode?
you're talking about a first class stream interface for connections? i.e streams of 'createdInstance', 'destroyedInstance', etc. events being produced by a connection? or something different?
Frank Lemanschik
@frank-dspeed
Jun 23 2017 18:25
i am talking about the current can-connect that connects behaviers with a viewModel and a setAlgebra
i think as api and any way we should make it a stream
we can then code behaviers that listen onValue and we can also map the stream it self to behaviers
i think that would be the most logical cool api and it would solve the es6 cjs discussion
because a kefir stream stays a kefir stream
Frank Lemanschik
@frank-dspeed
Jun 23 2017 18:31
# current code
var connect = require("can-connect");
var todosConnection = connect([
    require("can-connect/data/url/url"),
    require("can-connect/constructor/constructor")    
],{
    url: "/api/todos"
});

# can-connect-stream

var connect = require("can-connect-stream')({ url: "/api/todos"}) // -> returns kefir stream

connect
  .map(require("can-connect/data/url/url"))
  .map(require("can-connect/constructor/constructor"))
this would also enable conditional loading
because the request on connection gets only made if some one subscribes
it would enable best error handling all this nice stuff :)
Gregg Roemhildt
@roemhildtg
Jun 23 2017 19:13
so, can-define@1.2 doesn't seem to be handling this correctly. Is that expected?
var Child = DefineMap.extend('child', {
  other: DefineMap
});

var c = new Child();
c.other = {
  prop: 'hello'
}; //error Cannot add property other, object is not extensible
Kevin Phillips
@phillipskevin
Jun 23 2017 19:21
no, that sounds like a bug
I'm verifying it now
this seems to work:
  other: {
    Type: DefineMap
  }
but not the shorthand
Frank Lemanschik
@frank-dspeed
Jun 23 2017 19:24
can-define@1.2 is buggy
Kevin Phillips
@phillipskevin
Jun 23 2017 19:24
it behaves the same here
Frank Lemanschik
@frank-dspeed
Jun 23 2017 19:24
what about seal parameters?
Kevin Phillips
@phillipskevin
Jun 23 2017 19:24
the change between 1.2 and 1.2.2 is very small
Frank Lemanschik
@frank-dspeed
Jun 23 2017 19:24
isn't that exactly for that case?
Kevin Phillips
@phillipskevin
Jun 23 2017 19:25
no
since other is defined
@roemhildtg can you open an issue?
Frank Lemanschik
@frank-dspeed
Jun 23 2017 19:25
but is prop defined
in the other define list?
ehm define map
other == defineMap
and that defineMap needs prop ?
Kevin Phillips
@phillipskevin
Jun 23 2017 19:26
this does work:
var Child = DefineMap.extend('child', {
  other: DefineMap.extend({
    prop: 'string'
  })
});

var c = new Child();
c.other = {
  prop: 'hello'
};
Frank Lemanschik
@frank-dspeed
Jun 23 2017 19:27
yes
as i sayed :D
Kevin Phillips
@phillipskevin
Jun 23 2017 19:27
but it worked without doing that pre-1.2
yeah, I was agreeing with you
Frank Lemanschik
@frank-dspeed
Jun 23 2017 19:27
the other defineMap needs seal:false true settings
to add props that are not set
Kevin Phillips
@phillipskevin
Jun 23 2017 19:28
it shouldn't matter if you're not extending
maybe I'm wrong... it's been a long couple days
Frank Lemanschik
@frank-dspeed
Jun 23 2017 19:29
ok then try following
Kevin Phillips
@phillipskevin
Jun 23 2017 19:29
but @roemhildtg, submit an issue and we'll figure it out
Frank Lemanschik
@frank-dspeed
Jun 23 2017 19:29
var Child = DefineMap.extend('child', {
  other: DefineMap
});

var c = new Child();
c.other = {
  prop: { value: 'hello' }
};
as hello should be the value of a defineMap
Gregg Roemhildt
@roemhildtg
Jun 23 2017 19:40
sorry had to run an errand. I'm back now, and will open an issue
Justin Meyer
@justinbmeyer
Jun 23 2017 20:07
working on it