by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 03:19

    EisenbergEffect on master

    docs(backer): adding another wo… (compare)

  • Jul 06 19:11

    EisenbergEffect on master

    doc(backers): adding a new wood… (compare)

  • Jul 06 06:30
    ayaanraj commented #659
  • Jul 06 00:09
    glyad commented #265
  • Jul 05 21:18
    bigopon commented #659
  • Jul 05 13:11
    ayaanraj opened #659
  • Jul 05 11:47

    bigopon on master

    refactor(expandable): simplify … feat(expandable): allow specify… Revert "refactor(expandable): s… and 4 more (compare)

  • Jul 05 11:47
    bigopon closed #311
  • Jul 05 11:46

    bigopon on master

    fix(input-components): disabled… Merge pull request #313 from pl… (compare)

  • Jul 05 11:46
    bigopon closed #313
  • Jul 03 04:31
    stuartbale commented #83
  • Jul 03 04:31
    stuartbale commented #83
  • Jul 02 22:14

    EisenbergEffect on master

    doc(backers): add new wood and … (compare)

  • Jul 02 14:14
    EisenbergEffect closed #972
  • Jul 02 14:14
    EisenbergEffect closed #973
  • Jul 02 12:59
    pablicki opened #973
  • Jul 02 12:43
    pablicki opened #972
  • Jul 02 12:36
    ben-girardet opened #313
  • Jul 02 03:44
    ToniNichevNBCUNI commented #136
  • Jun 29 06:06
    MaximBalaganskiy opened #312
Roland Quast
@rquast
it's undefined in bind() but there in attached()
WisdomCorp
@WisdomCorp
In my config.js there are references to both core-js@0.9.18 and core-js@1.2.1, shouldn't be one only. Any advice?
Chris Beckett
@chrismbeckett
@rquast Is this the view-model that hosts the custom element, or a sub-vm?
Genadi
@genadis

This great article explains how to bundle application for production.

I had some trouble with bundling custom plugin.

Problem

I've added a simple plugin with 2 JS files to navigation skeleton:

//index.js
export function configure(config) {
  config.globalResources('./myplugin');
}
//myplugin.js - the actual customAttribute plugin that exports the class

All works good.

So I decided to bundle it.
After bundling, I've notice that only the content of my index.js was bundled, but myplugin.js was still loaded separately.
I wanted it to be bundled as well, and save the extra query.

I've done a lot of digging in SystemJS, jspm, aurelia issues, no luck.

Solution

What did the trick for me is modifying my plugin's index.js:

import {myClass} from './myplugin';
export function configure(config) {
  config.globalResources('./myplugin');
}
export {myClass};

Inspired by digging into aurelia own plugins implementations, found the solution in: aurelia/templating-resources

What I've noticed, the dependencies of the plugin, was bundled as well automatically (my plugin had dependency).

Questions:

  1. Is this the correct solution? any side effects?
  2. Is this something obvious? If not I think it should be documented somewhere...

Thanks

Roland Quast
@rquast
@chrismbeckett the one that hosts it
Chris Beckett
@chrismbeckett
@rquast hmmmm... that makes sense. The docs refer to ref creating a local binding, what they are doing is adding a property to the hosting view so that anything in the same view can easily get a refernece to it.
@rquest Does that mean it gets pushed to child views automatically?
WisdomCorp
@WisdomCorp
Roland Quast
@rquast
@chrismbeckett no idea. i would assume everything is local to the vm for the view, not children or parents
I haven't done any child routing yet, but I'd assume you'd have to figure something similar out with that too?
airboss001
@airboss001
@WisdomCorp aurelia/skeleton-navigation#188
Chris Beckett
@chrismbeckett
@rquast Looks like I am going to go with a service approach. I will inject the singleton service into the custom element, the custom element can register itself in a WeakMap with whatever the ref value is on the custom element, and that way I can get a reference to it from anywhere.
@rquast Going the angular way...
Roland Quast
@rquast
well if you have a lot of sub-views, then that's probably a good idea
or communicating between components or views
WisdomCorp
@WisdomCorp
@airboss001 so I can find/replace all with 1.2.1 right?
and the other day I had difficulty with aurelia-dialog I switch to bootstrap modal and it work fine.
Roland Quast
@rquast
@WisdomCorp I had problems with iframes and chrome with the latest core-js, but other than that, yes.
airboss001
@airboss001
@WisdomCorp I just did it and had no issues with 1.2.1, some have called out errors with newer ones
WisdomCorp
@WisdomCorp
I don't use iframe, so it should be Ok. finger crossed :) Thanks
Roland Quast
@rquast
@chrismbeckett child views can always access the parent's properties via bind(bindingContext)
Chris Beckett
@chrismbeckett
@rquast Thx for the help. I will play around with this and let you know what I end up with :)
Roland Quast
@rquast
@chrismbeckett between that and ref, it's better than a singleton where you have to make sure you remove it when you're done from the singleton (service)
i think keeping things vertical rather than crossing contexts is better if possible (if it is possible)
but for communication between components... a service like that would definitely make sense
Chris Beckett
@chrismbeckett
@rquast If I use a WeakMap, I don't have to unregister it. If the view containing the custom element is destroyed, the reference in the WeakMap will be removed as well.
Roland Quast
@rquast
yeah i noticed you said weakmap after i posted that last comment ;)
Chris Beckett
@chrismbeckett
@rquast I do have to worry about naming conflicts if you assign the same reference name to multiple elements, but that's a common concern
@rquast I am not trying to build a reusable system, a proper dialog system will dynamically create and inject the dialog markup like Aurelia-Dialog does, for my needs, this will work fine.
I am only going to have a few custom modal elements in the root App template, they will survive the entire instance of the app, and I just need an easy way to call them across my entire app.
@rquast I guess if there was a $root binding similar to $parent, then I could just call $root from everywhere (like rootScope and Scope in Angular), but a backing service is ok for my needs I think.
@rquast This is also probably a temporary thing.... long term I expect to use either the Aurelia Dialog or MDL Dialog modules.
Roland Quast
@rquast
heh.. im actually working on dialog code today (and I'm using mdl)
would have been good to have mdl dialog
but it's not done yet :(
im actually pretty excited about AI... that should be very good for cross-platform look etc too?
Chris Beckett
@chrismbeckett
@rquast Very excited about that, and definatley happy to pay for a subscription if they pull that off. Its harder than it sounds....
@rquast I started trying to do adaptive theming with Ionic, its a lot of work.
Roland Quast
@rquast
yeah.. I'd pay for it (interface is half the struggle)
Chris Beckett
@chrismbeckett
@rquast Yeah, that is the hard lesson I have learned since I launched my startup. If you are doing full web, mobile web, and hybrid mobile, find a good UI stack that works across everything and looks good is a monstrous undertaking. Angular Material has 1000 bugs on GitHub.
@rquast They were supposed to launch v1 this summer, looks like it might be months. Look at how long it took to take Ionic from Beta to v1 - took almost a year.
@rquast Wow, ok, Angular Material now has 1,184 issues on Github
Roland Quast
@rquast
needs a big team effort.. we'll see how @joelcoxokc goes.
Chris Beckett
@chrismbeckett
@rquast Well, it certainly needs a big community helping test because its damn hard...
@rquast Its actually why I dropped Angular and switched to Aurelia and Material Design Lite. MDL is all I need for now and seems pretty solid, and I always hated Angular.
@rquast All I am missing for the temporary future is material dialogs and snackbars. Think I have that figured out, so gonna get it done tonight and try to get my app launched soon.
Roland Quast
@rquast
yeah just trying to keep interface simple enough not to cause issues is key for me at the moment ;)
and things like date pickers, etc
Chris Beckett
@chrismbeckett
@rquast Absolutely. What boggles my mind is just how terrible the native HTML5 implementations for date and time are.... just horrible.
Roland Quast
@rquast
need to wrap an existing library that's well tested
someone was working on a date picker on here i think