by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jun 02 23:13

    bigopon on master

    chore(build): prepare script at… chore(ci): ensure install deps … Merge branch 'master' of https:… and 4 more (compare)

  • Jun 02 23:13
    bigopon closed #289
  • Jun 02 23:05
    bigopon opened #289
  • Jun 02 22:44

    bigopon on master

    fix(select): add default config… fix(select): don't expose the c… fix(select): prevent crash If … and 2 more (compare)

  • Jun 02 22:44
    bigopon closed #287
  • Jun 02 22:40

    bigopon on master

    fix(input): pass through date i… fix(input): add default configu… fix(input): don't expose config and 2 more (compare)

  • Jun 02 22:40
    bigopon closed #286
  • Jun 02 22:13
    MaximBalaganskiy synchronize #287
  • Jun 02 22:11
    MaximBalaganskiy synchronize #286
  • Jun 02 22:08
    MaximBalaganskiy synchronize #286
  • Jun 02 22:05
    MaximBalaganskiy synchronize #287
  • Jun 02 22:01
    MaximBalaganskiy synchronize #287
  • Jun 02 21:45

    bigopon on master

    fix(button): don't allow clicks… Merge pull request #288 from Ma… (compare)

  • Jun 02 21:45
    bigopon closed #288
  • Jun 02 21:45
    bigopon closed #280
  • Jun 02 21:04
    MaximBalaganskiy opened #288
  • Jun 02 20:53
    MaximBalaganskiy opened #287
  • Jun 02 20:45
    MaximBalaganskiy edited #286
  • Jun 02 20:45
    MaximBalaganskiy synchronize #286
  • Jun 02 07:27
    bigopon commented #286
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
ugh.. next ui component i have to not look forward to :)
Rob Eisenberg
@EisenbergEffect
@/all We wanted to release the Aurelia beta next week. However, Babel just released a new major version with major breaking changes. We've started looking into what the means today and I'm not optimistic. Our tooling is all broken and Babel hasn't provided sufficient documentation in order for us to quickly fix the issues...at least not upon initial investigation. So, getting our beta out may take a little bit longer. I sincerely apologize about this. Believe me when I say I'm as frustrated by the delay as you are. We've got some really cool stuff coming in the beta release...so please hang in there with us.
Roland Quast
@rquast
@/me hangs in there. :D