Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 00:14
    greenkeeper[bot] labeled #5449
  • 00:14
    greenkeeper[bot] opened #5449
  • 00:14

    greenkeeper[bot] on can-super-model-2.0.0

    fix(package): update can-super-… (compare)

  • 00:13
    greenkeeper[bot] labeled #5448
  • 00:13
    greenkeeper[bot] opened #5448
  • 00:13

    greenkeeper[bot] on can-define-rest-model-2.0.0

    fix(package): update can-define… (compare)

  • 00:12
    greenkeeper[bot] labeled #5447
  • 00:12
    greenkeeper[bot] opened #5447
  • 00:12

    greenkeeper[bot] on can-define-realtime-rest-model-2.0.0

    fix(package): update can-define… (compare)

  • 00:07
    greenkeeper[bot] labeled #5446
  • 00:07
    greenkeeper[bot] opened #5446
  • 00:07

    greenkeeper[bot] on can-connect-ndjson-2.0.0

    fix(package): update can-connec… (compare)

  • Dec 13 21:27

    greenkeeper[bot] on @octokit

    (compare)

  • Dec 13 21:25

    greenkeeper[bot] on @octokit

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

  • Dec 13 21:21

    greenkeeper[bot] on @octokit

    (compare)

  • Dec 13 21:20

    greenkeeper[bot] on @octokit

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

  • Dec 12 19:26
    cherifGsoul review_requested #5443
  • Dec 12 18:34
    cherifGsoul synchronize #5443
  • Dec 12 18:34

    cherifGsoul on document-inserted-removed-can6

    Update after review (compare)

  • Dec 12 17:44

    cherifGsoul on theme-3.0.0-pre.5

    (compare)

Patrick Clancy
@patrickclancy
wow… sounds good
Justin Meyer
@justinbmeyer
either @daffl or I could put a day in or so to get the basics working
@patrickclancy added you to: https://github.com/canjs/can-validate
can you create an issue with what you'd like?
perhaps something very close to the old validation but observable
oh, @patrickclancy using npm to install deps hopefully?
@daffl anyway you can setup a "shell" project sometime tomorrow? It can look like can-connect
btw, @patrickclancy not sure if you've seen can-connect
but I am aiming to have the docs done this week
Patrick Clancy
@patrickclancy
@justinbmeyer YES!! the only way to go. (can 2.3-pre as well)
@justinbmeyer I’ve seen can-connect and I’d like to use it but… docs would help
Justin Meyer
@justinbmeyer
ok, great, that will make working on can-validate stupidly easy
Patrick Clancy
@patrickclancy
@justinbmeyer Is place my order the best way to see can-connect in action?
Justin Meyer
@justinbmeyer
currently yes, but my docs will have demos
Patrick Clancy
@patrickclancy
@justinbmeyer sweet… thank you
Justin Meyer
@justinbmeyer
import connect from "can-connect";
import "can-connect/data/url/";
import "can-connect/constructor/";
import "can-connect/constructor/store/";
import fixture from "can/util/fixture/";

// A connection that gets todos data
var todosConnection = connect(["constructor-store","constructor","data-url"],{
  url: "/todos"
});

// Trap ajax requests to return and modify the following `todo` object.
var todo = { 
    id: 5, 
    name: "do the dishes"
};
fixture({
    "GET /todos/{id}": function(){
        todo.date = (+new Date());
        return todo;
    },
    "PUT /todos/{id}": function(request){
        todo.name = request.data.name;
        return {name: request.data.name, date: +new Date()};
    }
});

var makeTodoNamer = function(id){
    var element = document.createElement('div');
    var todo;

    var update = function(){
        element.firstChild.value = todo.name;
        element.childNodes[2].innerHTML = todo.date % 1000;
    };

    element.innerHTML = "<input/><button>X</button><span/>";

    todosConnection.get({id: id}).then(function(retrievedTodo){
        todo = retrievedTodo;
        Object.observe(todo,update, ["update"] );
        todosConnection.addInstanceReference(todo);
        update();
    });

    element.childNodes[1].onclick = function(){
        Object.unobserve(todo, update, ["update"] );
        todosConnection.deleteInstanceReference(todo);
        element.parentNode.removeChild(element);
    };
    element.firstChild.onchange = function(){
        todo.name = this.value;
    };

    element.firstChild.onkeypress = function(ev){
        if(ev.keyCode === 13) {
            todo.name = this.value;
            todosConnection.save(todo);
        }
    };

    return element;
};


document.getElementById('maker').onclick = function(){
    var element = makeTodoNamer(5);
    document.body.appendChild(element);
};
this is a can-connect example, done w/o can.Map
it uses connection.addInstanceReference to keep things in a store, and Object.observe to bind on them
Jani Mikkonen
@rasjani
Hiya, some time ago i promised to do a small blogpost about how to use canjs with webpack ..
blogpost is not yet written - but i had some spare time and i wrote working example on that topic @ https://github.com/rasjani/canjs_webpack
canjs part is very pretty but the main purpose is to actually just show how to build canjs project with webpack so it should be sufficient .. actual blogpost coming next :)
Diana Whitten
@hurgleburgler
@/all When building a component with CanJS ... is there a way to entirely replace the custom TAG in your dom with the contents of its template?
Matthew Phillips
@matthewp
@rasjani awesome
Alexis Abril
@alexisabril
@hurgleburgler You could call replaceWith on the inserted event(I’m not sure how to get a handle to the template offhand), however this sounds like something you could use can.view.attr() for. If you have a use case, it would provide more insight
Justin Meyer
@justinbmeyer
@hurgleburgler could you use a partial?
is a component necessary
@rasjani awesome. But if I might ask, why are you using webpack instead of StealJS?
Gerard Finnerty
@halcyonandon
@justinbmeyer I'm using systemjs and traceur (switching to babel) directly. I saw your talk on stealjs at the palo alto meet up. Since then, I inquired about the state of stealjs and was told it wasn't ready for production yet. Is steal ready for primetime? Is there a blog post or something that speaks to the advantages of steal over using systemjs directly?
Justin Meyer
@justinbmeyer
@halcyonandon steal is used by m.samsclub.com
it's primetime
doesn't compare systemjs directly
oh, btw, for steal questions: https://gitter.im/stealjs/steal
opolyo01
@opolyo01
@justinbmeyer I have a project that have React components and Can components, and client side loader like steal would not be able to transform JSX in React
Justin Meyer
@justinbmeyer
but in short, StealJS has a way better build, can export your modules, and load from npm
@opolyo01 why not?
I assume there are JSX transpilers in pure JS
opolyo01
@opolyo01
can steal does JSX transformation?
Justin Meyer
@justinbmeyer
I bet someone has already written one for SystemJS
(which stealjs can use)
opolyo01
@opolyo01
no, it is not pure JS
it is react specific thingy
Matthew Phillips
@matthewp
if you use babel it will transpile jsx as well
Justin Meyer
@justinbmeyer
@opolyo01 yeah, I know
for example, stealjs can load templates, Less, etc
opolyo01
@opolyo01
it would be awesome if steal could load jsx
Justin Meyer
@justinbmeyer
the same technique can be used to do jsx
but it sounds like bable transpiles jsx anyway
Matthew Phillips
@matthewp
@opolyo01 it can, we have some React users who hang out in stealjs/steal on gitter
Gerard Finnerty
@halcyonandon
@justinbmeyer thanks, what do you mean by load from npm? and export modules? I load systemjs from npm and export modules to where/what? bundling?