niieani / aurelia-binding-functions

An Aurelia plugin that makes it possible create BindingFunctions
1 stars 3 forks source link

Cannot use plugin #3

Closed pixels4nickels closed 8 years ago

pixels4nickels commented 8 years ago

When adding the aurelia.use.plugin('aurelia-binding-functions') to a new skeleton project(ES6, not TS), I get the following errors:

view-resources.ts:60 Uncaught (in promise) TypeError: Cannot read property 'bind' of undefined
    at Object.patchViewResources (http://127.0.0.1:7777/jspm_packages/npm/aurelia-binding-functions@0.2.2/view-resources.js:35:106)
    at Object.configure (http://127.0.0.1:7777/jspm_packages/npm/aurelia-binding-functions@0.2.2/index.js:9:26)
    at http://127.0.0.1:7777/jspm_packages/npm/aurelia-framework@1.0.0-beta.1.2.3/aurelia-framework.js:276:36
pixels4nickels commented 8 years ago

I looked through my config.js and saw that most libs were using aurelia-binding 1.3.5 but this is using 1.3.6 I wiped everything and updated but now I jsut get an error that ma Main.js cannot be loaded from the webroot. But it is right there in the dist folder.

pixels4nickels commented 8 years ago

I installed the ES2016 skeleton fresh this morning. Then I installed the aurelia-rxjs, aurelia-binding-functions. I added these lines to my main.js:

  aurelia.use.plugin('aurelia-binding-functions');
  aurelia.use.plugin('aurelia-rxjs');

Then it said my dist was missing aurelia-binding and aurelia-logging. So I installed those again.

Then I get this error:

view-resources.ts:60 Uncaught (in promise) TypeError: Cannot read property 'bind' of undefined
    at Object.patchViewResources (http://127.0.0.1:9000/jspm_packages/npm/aurelia-binding-functions@0.2.2/view-resources.js:35:106)
    at Object.configure (http://127.0.0.1:9000/jspm_packages/npm/aurelia-binding-functions@0.2.2/index.js:9:26)
    at http://127.0.0.1:9000/jspm_packages/npm/aurelia-framework@1.0.0-beta.1.2.3/aurelia-framework.js:276:36
niieani commented 8 years ago

Thanks for putting this to my attention, @pixels4nickels. I'm currently busy with other projects, but it's possible its related either to JSPM or that something has changed in Aurelia's code that impacted the way my aurelia-binding-functions work. Also note that the usage syntax will still probably change (I'm thinking of dropping the "@" from the beginning).

pixels4nickels commented 8 years ago

Thanks for your work. I am going to take a stab at seeing if I can refactor it to get it working with the latest version(I think that is the issue as well). I think you are right and that it has to do with some changes in aurelia-bindings. I will fork and let you know what I can come up with.

niieani commented 8 years ago

Sure. May I ask, what's driving your interest to use Observables with Aurelia?

pixels4nickels commented 8 years ago

I have used Angular/RXJS for production apps in the past and wanted to test out an equivalent stack using Aurelia for new projects going forward(Yes, I am leaving Angular behind). I choose observables over promises mostly for server communication in order to gain a bit more control over cancelling, debouncing/throttling requests etc.

pixels4nickels commented 8 years ago

I got it working! The issue is jspm related. I was able to use the skeleton ES2016 webpack scaffolding and get it working. I will leave it to you to close this issue. Thanks again for your work. This rocks.

niieani commented 8 years ago

In that case you might want to hold out for the release of my other project, aurelia-cycle. It'll allow you to control the state of any component using an Observable input-output loop, similarly to how Cycle.js works, but can be safely combined with traditional state model. I'm currently doing a 3rd rewrite after testing different ways to implement it, I think it's going to be a really useful pattern in the end. On Tue, 7 Jun 2016 at 02:08, Ken Rogers notifications@github.com wrote:

I have used Angular/RXJS for production apps in the past and wanted to test out an equivalent stack using Aurelia for new projects going forward(Yes, I am leaving Angular behind). I choose observables over promises mostly for server communication in order to gain a bit more control over cancelling, debouncing/throttling requests etc.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/niieani/aurelia-binding-functions/issues/3#issuecomment-224125762, or mute the thread https://github.com/notifications/unsubscribe/AAiZDd8q2ghlOlpjEs370KCMvZomxqi4ks5qJLaNgaJpZM4IuZtS .