Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 14 17:40
    nlundquist edited #5424
  • Nov 14 17:40
    nlundquist edited #5424
  • Nov 14 17:39
    nlundquist opened #5424
  • Nov 14 17:39
    nlundquist review_requested #5424
  • Nov 14 17:39

    nlundquist on 107-update-converter-demos

    update can-stache-converters de… (compare)

  • Nov 14 14:32
    greenkeeper[bot] labeled #5423
  • Nov 14 14:32
    greenkeeper[bot] opened #5423
  • Nov 14 14:32

    greenkeeper[bot] on can-route-5.0.1

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

  • Nov 13 13:09

    greenkeeper[bot] on steal-tools-2.2.3

    (compare)

  • Nov 13 12:55

    greenkeeper[bot] on steal-tools-2.2.3

    chore(package): update steal-to… (compare)

  • Nov 13 01:44

    greenkeeper[bot] on @webcomponents

    (compare)

  • Nov 13 01:42

    greenkeeper[bot] on @webcomponents

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

  • Nov 12 05:28
    greenkeeper[bot] commented #5392
  • Nov 12 05:28

    greenkeeper[bot] on core-js-3.4.1

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

  • Nov 11 18:03
    greenkeeper[bot] labeled #5422
  • Nov 11 18:03
    greenkeeper[bot] opened #5422
  • Nov 11 18:03

    greenkeeper[bot] on @feathersjs

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

  • Nov 11 18:02
    greenkeeper[bot] commented #5401
  • Nov 11 18:02

    greenkeeper[bot] on @feathersjs

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

  • Nov 10 23:39

    greenkeeper[bot] on @octokit

    (compare)

Justin Meyer
@justinbmeyer
behavior of validations
so you don't actually have to commit a breaking set
to see if there's an error
Patrick Clancy
@patrickclancy
@justinbmeyer is this the direction you’re thinking validation will go? We’ve got models with 60+ fields and observable is important. Bummer I just spent all day doing it the old way
@justinbmeyer I haven’t used this workflow "if I set this, will it create an error”. becasue of can-value live binding. I’d like to integrate that but haven’t
Justin Meyer
@justinbmeyer
yes, validation will certainly be observable
and probably be a plugin into the define plugin itself
if validations are important I can help you create something that bridges the gap
are you using stealjs?
Patrick Clancy
@patrickclancy
yes with ES6 syntax
Justin Meyer
@justinbmeyer
If you are using StealJS, we could create a can-validate repo and add you as a contributor
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