These are chat archives for canjs/canjs

23rd
Aug 2018
Justin Meyer
@justinbmeyer
Aug 23 2018 00:42
@pYr0x can you write it up?
Gregg Roemhildt
@roemhildtg
Aug 23 2018 16:41

How would you guys handle this? I have tons of objects that come from a 3rd party library. They're called features. each feature looks like this:

{
    attributes: {}, // key value attributes that I want to edit
    geometry: {} // geometric location info for this feature
}

I want to edit the features using can-rest-model but how would I handle this nested structure? (Most can-models tend to be a flat object)

Considering using React + Can to take advantage of some open source React projects. What happened to the API docs for these? Do they not work with the latest Can packages?
Kevin Phillips
@phillipskevin
Aug 23 2018 17:19
let me check if there are any issues with the latest dependencies
looks like everything should work with the latest canjs dependencies
Thomas Sieverding
@Bajix
Aug 23 2018 18:05
@phillipskevin thanks. Any reason why this isn’t up on the current docs? Is there any priority to integrate further with React?
Adam L Barrett
@BigAB
Aug 23 2018 21:14
We've been working on a new integration with React, currently called ylem, it's sort of in a state of flux right now, we were trying to pick a direction to go, figuring out if we want a new name, etc
https://github.com/bitovi/ylem/tree/master/connect
If you look at the docs in the connect directory though, that's the api that is stable and we'll be promoting going forward
^ @Bajix
The idea is, being able to use ylem to connect() canjs observables to react components, we're sort of packaging the observables right in the ylem project, but they are just canjs observables like DefineMaps and the Observable Objects and arrays in can-observe
You still get all the cool power of canjs observables, like models and can-connect and whatnot, but instead of stash you connect them to react components that update when observed props change
Kevin Phillips
@phillipskevin
Aug 23 2018 21:27
@/all I just published some updates to the Routing Guide: https://canjs.com/doc/guides/routing.html
There are new sections on:
  • Programmatically creating components for your routes in your view-model
  • Progressively loading these components
Julian
@pYr0x
Aug 23 2018 22:17
:thumbsup:
Thomas Sieverding
@Bajix
Aug 23 2018 22:36
@BigAB Thanks I’ll look at that
Thomas Sieverding
@Bajix
Aug 23 2018 22:49
@BigAB Yea this looks really nice. This looks like it should work with all CanJS observables too from what I can tell.
This is already in a usable state?
Adam L Barrett
@BigAB
Aug 23 2018 22:51
Yeah, maps with .attr() don't really fit the paradigm though, because you don't want your react components to "know" they are dealing with anythign other than a plan object, but technically I think it would work with all the observables (I think)
Thomas Sieverding
@Bajix
Aug 23 2018 22:52
I thought attr was already gone?
Adam L Barrett
@BigAB
Aug 23 2018 22:52
@Bajix We are currently using it on a couple of projects, so yes, but there is still a bit of flux
Thomas Sieverding
@Bajix
Aug 23 2018 22:52
As far as direction goes or?
Adam L Barrett
@BigAB
Aug 23 2018 22:53
Well, if you're keeping up to date, you probably aren't using .attr() but they did just release a package for adding attr maps
Thomas Sieverding
@Bajix
Aug 23 2018 22:53
I just really like the idea of using CanJS observables w/ React if not for any other reason than to take advantage of all that sweet sweet open source React stuff
Adam L Barrett
@BigAB
Aug 23 2018 22:54
Yeah, as far as direction in marketing and training more than anything, and what features we want to add moving forward as well, but the connect() api is pretty stable
Thomas Sieverding
@Bajix
Aug 23 2018 22:55
Connect can accept a DefineMap.extend and doesn’t need to extend from ObserveObject right?
Is ObserveObject something from Can?
Nvm it’s part of can-observe
The ObserveObject here === that from can-observe? import { connect, ObserveObject } from "ylem”;