Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 09 18:59
    cherifGsoul review_requested #5443
  • Dec 09 18:59
    cherifGsoul opened #5443
  • Dec 09 18:51

    cherifGsoul on document-inserted-removed-can6

    Add inserted/removed events to … (compare)

  • Dec 09 15:38
    greenkeeper[bot] labeled #5442
  • Dec 09 15:38
    greenkeeper[bot] opened #5442
  • Dec 09 15:38

    greenkeeper[bot] on can-view-live-5.0.1

    fix(package): update can-view-l… (compare)

  • Dec 08 21:21
    greenkeeper[bot] commented #5392
  • Dec 08 21:21

    greenkeeper[bot] on core-js-3.4.8

    chore(package): update core-js … (compare)

  • Dec 06 18:40
    cherifGsoul review_requested #5441
  • Dec 06 18:39
    cherifGsoul opened #5441
  • Dec 06 18:22

    cherifGsoul on update-infrastructure-page

    Update infrastructure page with… (compare)

  • Dec 06 18:14
    greenkeeper[bot] commented #5422
  • Dec 06 18:14

    greenkeeper[bot] on @feathersjs

    chore(package): update @feather… (compare)

  • Dec 06 18:11
    greenkeeper[bot] commented #5401
  • Dec 06 18:11

    greenkeeper[bot] on @feathersjs

    chore(package): update @feather… (compare)

  • Dec 04 22:03
    chasenlehara opened #5440
  • Dec 04 22:03
    chasenlehara labeled #5440
  • Dec 04 19:18
    cherifGsoul review_requested #5432
  • Dec 04 14:09
    m-ahmadi starred canjs/canjs
  • Dec 04 10:52
    ansyeow starred canjs/canjs
Gregg Roemhildt
@roemhildtg
I think I have it working pretty much like I have in my dev setup
Brad Momberger
@bmomberger-bitovi
I think you might be doing too many handler dispatches. You make a watch for every onKeyValue, but each watch handler goes over the entire handlers list.
I don't know that this is the root of the live problem, but it couldn't hurt to clean that up.
Oh! I do see one thing that might be a problem with your @@can.getKeyValue. It's using can-util/js/get/get, which doesn't use canReflect.getKeyValue to access properties.
Brad Momberger
@bmomberger-bitovi
If you want to read deep paths on an object, I would recommend trying can-stache-key.get instead.
Gregg Roemhildt
@roemhildtg

You make a watch for every onKeyValue, but each watch handler goes over the entire handlers list.

I'm not following, shouldn't each watch handler call each handler that is listening for that key's changes?

Brad Momberger
@bmomberger-bitovi
If you have two watches on one key, and that key changes, then two watches each call two handlers.
Gregg Roemhildt
@roemhildtg
Ohh, I see
Yes that would happen
Gregg Roemhildt
@roemhildtg
I'm not sure how to use can-stache-key, but what if I just add observation.add(obj, key) to the get function from can-util?
wouldn't that trigger the getKeyValue
Brad Momberger
@bmomberger-bitovi
Yeah, if you want to just copy and modify the get function, that should work too
Frank Lemanschik
@frank-dspeed
does somebody in here maybe know the behavier of steal optimized bundels from done-autorender (done-apps)?
the bundels are including the needed code but i think some init stuff is needed that not done automaticly
i think as steal optimize gets the index.stache!done-autorender
it should autorender as expected behavier right?
Chasen Le Hara
@chasenlehara
^ I don’t think we’ve finished making the optimized builds work in a regular DoneJS app, maybe @matthewp can comment though
Matthew Phillips
@matthewp
Optimized builds do not work with done-autorender apps, that is correct.
Going to start working on it soon hopefully.
Nico R.
@nriesco
Hi, I found this in the docs: https://canjs.com/doc/can-validate.html but couldn’t understand how to use it in a form, any ideas?
I was looking for an easy way to support HTML “required” fields
Nico R.
@nriesco
or providing a custom method
swipie
@swipie
We get a lot of warnings about a property that is not in the current scope and that the property is read from the parent scope. It is resolved when we do {{ ../myprop}} instead of {{myprop}} but is this the right way to solve these warnings?
Kevin Phillips
@phillipskevin
Sorry the docs that warning links to haven't been published yet. There are a few ways to resolve this
image.png
Hopefully you can read that. Yes, if you want to read the prop from the parent scope, ../myProp is the correct way to do it.
Kevin Phillips
@phillipskevin
if there are places where you think ../myprop isn't the right way to do it, let us know @swipie
Brad Momberger
@bmomberger-bitovi
Got ninja'd by @phillipskevin, but I was going to add that reading explicitly from the scope level where your prop exists will help ease the upgrade process to future major revisions of can-stache
Frank Lemanschik
@frank-dspeed
lol ninjaed
new term :)
i use normaly outsmartned
Brad Momberger
@bmomberger-bitovi
It's not quite outsmarted, just that someone else got in a correct or agreeing response while you were composing your own.
Frank Lemanschik
@frank-dspeed
ok if you say so
Frank Lemanschik
@frank-dspeed

Streaming can-component

const Nils = require('../../')
const defineMap = require('can-define/map/map')
const Component = require('can-component')
const view = require('index.stache')

const app = new Nils()

const viewModel = defineMap.extend({sealed: false},{})


// Init ViewModel
// could be also a defineMap->Stream
app.stream.of({
  inputX: '',
  inputY: ''
})
// Observe DOM Elements
// return { update, assign }
.combineArray((observed)=>observed,[
  app.fromInput(document.querySelector('input.x'))
  .map((val)=>{
  return { inputX: val }
  }),
  app.fromInput(document.querySelector('input.y'))
  .map((val)=>{
    return { inputY: val }
  })
])
// Returns the ViewModelUpdating State aka can-x-connect :)
// This can also be a complet Can Component
// its only for demo
.loop(function applyVM(lastSetVal, setVal){
  let seed = lastSetVal.viewModel.updateDeep(setVal)
  return return { seed, value: seed };
},Component.extend({
  tag: 'kasse-login',
  ViewModel,
  view
}))
// Acticvate the Stream All gets executed as sideEffect
.map((comp)=>comp.render())
.drain()
what do you think about that?
for small components you can even drop can component and directly render stach
Brad Momberger
@bmomberger-bitovi
You named your app for @nlundquist ?
Frank Lemanschik
@frank-dspeed
no thats the name from my son
here you can read about Nils
:D

What is Nils?

Nils is the short form of Nikolaos (Santa Claus) it is composed from the greek words Nike and Laos

    Nike = Winner

    Laos = Public

= Winner of the Public! It offers DOM Diffing, Streams, Workflows for WebDevelopment
i am at present composing a new framework
that is canjs compatible
as i use canjs as legacy layer for old browsers
:D
i simply take a little stuff from canjs like can-component for compatiblity with browsers that don't support web components
rest ist webcomponent based