Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 17 20:12

    matthewp on master

    Update dist for release (compare)

  • Oct 17 20:12

    matthewp on v6.1.2

    Update dist for release 6.1.2 (compare)

  • Oct 17 20:04

    matthewp on master

    Update dist for release (compare)

  • Oct 17 20:04

    matthewp on v6.1.2-0

    Update dist for release 6.1.2-0 (compare)

  • Oct 17 19:17
    akbaruddin starred canjs/canjs
  • Oct 17 17:25
    matthewp edited #5384
  • Oct 17 17:00

    matthewp on can-dom-mutate-2.0.7

    (compare)

  • Oct 17 17:00

    matthewp on master

    fix(package): update can-dom-mu… Merge pull request #5386 from c… (compare)

  • Oct 17 17:00
    matthewp closed #5386
  • Oct 17 16:27
    greenkeeper[bot] labeled #5386
  • Oct 17 16:27
    greenkeeper[bot] opened #5386
  • Oct 17 16:27

    greenkeeper[bot] on can-dom-mutate-2.0.7

    fix(package): update can-dom-mu… (compare)

  • Oct 17 16:25

    matthewp on can-dom-mutate-2.0.6

    (compare)

  • Oct 17 16:24
    matthewp closed #5379
  • Oct 17 16:24
    matthewp commented #5379
  • Oct 17 15:26

    greenkeeper[bot] on can-type-1.1.2

    (compare)

  • Oct 17 15:26

    matthewp on master

    fix(package): update can-type t… Merge pull request #5385 from c… (compare)

  • Oct 17 15:26
    matthewp closed #5385
  • Oct 17 14:11
    matthewp closed #5377
  • Oct 17 14:11
    matthewp closed #5376
Frank Lemanschik
@frank-dspeed
const HelloWorld = Component.extend({
    tag: "hello-world",
    view: `
        <can-slot name="greetingTemplate" />
        <content>world</content>
        <ul>{{#each(items)}} {{this}} {{/each}}</ul>
    `,
    ViewModel: {
        items: {}
    }
});

// Create a new instance of our component
const componentInstance = new HelloWorld({

    // values with which to initialize the component’s view model
    viewModel: {
        items: ["eat"]
    },

    // can-stache template to replace any <content> elements in the component’s view
    content: "<em>{{message}}</em>",

    // <can-template> strings rendered by can-stache with the scope
    templates: {
        greetingTemplate: "{{greeting}}"
    },

    // scope with which to render the <content> and templates
    scope: {
        greeting: "Hello",
        message: "friend"
    }
});

myGreetingInstance.element; // is like <my-greeting>Hello <em>friend</em> <ul> <li>eat</li> </ul></my-greeting>

myGreetingInstance.viewModel; // is HelloWorld.ViewModel{items: ["eat"]}
this is a defined helloworld component
that gets Loaded aka Instance creation of the constructed component
new HellWorld
is the key part
the part after that is supplying inital values
Paul Tichonczuk
@tracer99
Working on a Canjs 2->3 migration. Running into an issue where jQuery is complaining about route binding syntax
Error: Syntax error, unrecognized expression: /:service
Did we miss something? Is this syntax depricated?
Chasen Le Hara
@chasenlehara
@tracer99 That’s for something like route.register('/:service'), right?
As far as I know, we’re showing /{service} in our docs since 3.x (and we do show a warning) but we haven’t removed the old colon syntax.
Paul Tichonczuk
@tracer99
   '/:service route': function(urlContext) {
                this.login(urlContext);
                if (urlContext.service == 'logout') {
                    route.attr({}, true);
                }
            },
It's a route change binding in a controller.
yeah, that syntax doesn't work either (different error)
Chasen Le Hara
@chasenlehara
Hm, I’m not sure, let me check with @justinbmeyer or @phillipskevin
Matthew Phillips
@matthewp
canjs 5.20.0 is out, adding support for portals: https://github.com/canjs/canjs/releases/tag/v5.20.0
Justin Meyer
@justinbmeyer
@tracer99 howdy ... so the app is using the old can-control-route stuff?
Gregg Roemhildt
@roemhildtg
:+1: on 5.20 portals. Good solution for a common problem
Matthew Phillips
@matthewp
Thanks!
Justin Meyer
@justinbmeyer
@roemhildtg besides modals, what else might you need it for?
Justin Meyer
@justinbmeyer
It was a great day for open source today: https://twitter.com/canjs/status/1074850516092551168 Warms my heart to get help on DoneJS/CanJS/StealJS . Thanks @MarcGodard & @roemhildtg ! A great xmas present!
RyanMilligan
@RyanMilligan
Hi everyone, I'm having another strange problem. We have an application using can-router to navigate the application. It works fine when just serving up my JavaScript folder using http-server, but if I run a steal build and host the result in a script tag (i.e., <script src="steal.production.js">), then the navigation doesn't work at all.

Here's how the router's being configured:

// route('', {app: 'admin', page: 'markets'})
// route('{app}', { page: 'markets' })
route('{app}/{page}', {app: 'admin', page: 'markets'})
route('{app}/{page}/{slug}')
route('{app}/{page}/{slug}/{action}')
route('{app}/{page}/{slug}/{action}/{actionTwo}')
route.start()

The commented out lines are things I removed while trying to troubleshoot this issue.

I also added this diagnostic code below it:

setInterval(() => {
    const result = route.matched();
    console.log(result); //-> ""
  }, 2000);

This is in Can 3, by the way. Anyway, when I navigate to #admin/markets when hosting the JavaScript directly, that console log outputs {app}/{page}, the view model properties get set as expected, and everything's fine. When I do the same thing in the built code, no view model properties get set at all, and it outputs undefined. It seems like the router isn't resolving the correct rule based on the hash I navigated to.

RyanMilligan
@RyanMilligan
Oof, never mind, I figured it out. A vendor reverted a change I made a while ago to remove the can-route-pushstate module.
Ivo Pinheiro
@ivospinheiro
Hi guys!
I'm working on upgrade of an application from CanJS@3 to CanJS@5 and Steal@2.
I'm having a performance issue related with the application loading on an older version of Firefox (FF44) the application hangs many times, until it shows an window with title "Warning: Unresponsive script" dialog.
I don't know if the problem is related with CanJS or Steal, but can you guys give me some tips how to solve this issue?
Ivo Pinheiro
@ivospinheiro
It seems to spend some time on can-view-callbacks renderNodeAndChildren function.
Kevin Phillips
@phillipskevin
do you have the latest can-view-callbacks, @ivospinheiro ?
there was an issue with the MutationObserver version of that code (which is used for browsers that don't support customElements, like older FF)
but it was fixed in the latest version
Ivo Pinheiro
@ivospinheiro
I'm using can-view-callbacks@4.3.2
Kevin Phillips
@phillipskevin
ok
are you using "automounting"... where you have a component directly in your html?
like <my-app></my-app>?
or are you rendering everything with stache?
Ivo Pinheiro
@ivospinheiro
The first can-component is being rendered like this:
$('#app').html(stache("<my-app></my-app>"));
Kevin Phillips
@phillipskevin
ok
so... to check if what I'm thinking is the issue, can you change the <html> element of your page to <html data-can-automount="false">
Ivo Pinheiro
@ivospinheiro
We are using a plugin for tree's named jstree and in this case it is a big tree with lots of nodes.
It seems that the renderNodeAndChildren function is being called whenever a new node is inserted on the DOM
@phillipskevin I will try that
Kevin Phillips
@phillipskevin
:thumbsup:
Ivo Pinheiro
@ivospinheiro
It works! And now the application loads is much more faster
Kevin Phillips
@phillipskevin
ok
that's good, but that means there's something we should fix
can share what your jstree code looks like?
and open an issue in can-view-callbacks if possible
Ivo Pinheiro
@ivospinheiro
I will do that as soon as I can
Kevin Phillips
@phillipskevin
ok thanks
Justin Meyer
@justinbmeyer
$('#app').html(stache("<my-app></my-app>")); should be $('#app').html(stache("<my-app></my-app>")());
I think jQuery will call the function ... so this ends up working, but imo, it's sorta weird to do it the 1st way