Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Apr 27 18:34

    dependabot[bot] on npm_and_yarn

    (compare)

  • Apr 27 18:34
    dependabot[bot] closed #46
  • Apr 27 18:34
    dependabot[bot] commented #46
  • Apr 27 18:34
    dependabot[bot] labeled #47
  • Apr 27 18:34
    dependabot[bot] opened #47
  • Apr 27 18:34

    dependabot[bot] on npm_and_yarn

    Bump async from 0.2.9 to 2.6.4 … (compare)

  • Apr 27 18:34

    dependabot[bot] on npm_and_yarn

    (compare)

  • Apr 27 18:34
    dependabot[bot] closed #186
  • Apr 27 18:34
    dependabot[bot] commented #186
  • Apr 27 18:34
    dependabot[bot] labeled #187
  • Apr 27 18:34
    dependabot[bot] opened #187
  • Apr 27 18:34

    dependabot[bot] on npm_and_yarn

    Bump async from 2.6.0 to 2.6.4 … (compare)

  • Apr 13 00:00
    dependabot[bot] labeled #46
  • Apr 13 00:00
    dependabot[bot] opened #46
  • Apr 13 00:00
    dependabot[bot] labeled #186
  • Apr 13 00:00

    dependabot[bot] on npm_and_yarn

    Bump async from 0.2.9 to 3.2.2 … (compare)

  • Apr 13 00:00
    dependabot[bot] opened #186
  • Apr 13 00:00

    dependabot[bot] on npm_and_yarn

    Bump async from 2.6.0 to 3.2.2 … (compare)

  • Feb 28 21:02
    sabymike closed #7
  • Jan 15 01:01
    dependabot[bot] labeled #45
v1rt
@v1rt
This is the reason why I always join forums/irc/chats like this. People are very helpful and most of them have already done projects similar to what I'm looking for. The team I am on does not listen to me. They would rather write it from scratch. Sigh! :( Our app was delayed for 18 months because it was overly engineered by devs who claimed they know what they're doing. On the start of the project, I already told them they're making it too intelligent and I'm sure it's going to hurt us in the future. And today, we're f*ck'd up very badly and we are now slowly implementing what I suggested 18 months ago. LMAO!
hsimah
@hsimah
@v1rt I know the feeling. engineering manager on one of our apps "didn't believe" in client side frameworks so we had to do it ourselves. it's one of the worst messes i've ever seen. what takes seconds in ampersand, backbone or angular takes a day in our code. It's embarrassing.
Richard Butler
@RickButler
@v1rt delivering is a feature as they say.
v1rt
@v1rt
yup :)
Gennaro Landolfi
@rinodrummer
Hi guys, I've got a question: is possible to integrate Ampersand in Electron.
*?
Samuil Gospodinov
@samuil4_twitter
Yes, you can use ampersand with any framework. Personally I use Ampersand model in all of my angular projects.
Gennaro Landolfi
@rinodrummer
Thanks!
Jeremy Connor
@LordSyntax
Quick question, is it possible to set props from the view which is calling renderCollection on the collection views themselves? I have a view which calls renderCollection on a given collection, but I need to set a prop so that I can bind to it's values on the inner collections views; I can't see a way of passing the prop to the individual item views..
Richard Butler
@RickButler
@LordSyntax you can pass in values from renderCollection by using viewOptions. But if you want to keep the property in sync between the top level view and the collection views you will need to wrap that value in a model or state object. If you pass it in just as a value that the collection views have props for, the view will pick up the value but not a reference. This means a change in the parent view's value won't be reflected in the collection view. If you place your value in model or state object in the parent view and pass that in viewOptions it will be a reference to the same object and track your changes.
I will take a look and see if I can find a simpler solution. But if you want to track changes in both the parent and collection views you need to store it in state or a model. If you don't then just declare it as a prop on the collection view and pass it in with viewOptions.
Jeremy Connor
@LordSyntax
Perfect; thank you very much @RickButler
Jeremy Connor
@LordSyntax
Anyone know if it is possible to create a binding to a collection; I have a prop for my view of type object; which has a reference to an ampersand collection passed into it.. I want my view to bind to the collection; so that any changes to the collection trigger a custom function to run updating the UI. I'm currently using this.listenTo in an initialize method on a variety of events (e.g. add/remove/reset), but I'd rather use binding if that is possible.
Richard Butler
@RickButler
@LordSyntax all you can really do is propogate the events youself either by adding your own listeners like you said, or you can bubble everything by copying what _initChildren does javascript this.listenTo(this[child], 'all', this._getCachedEventBubblingHandler(child));
I don't recommended that though because this._getCachedEventBubblingHandler is a private method and breaking changes to it might not result in a semver major bump because it is marked as private.
If you are storing it as an object type in state or session, you might consider converting it to state, you would get bubbling for free then.
Richard Butler
@RickButler
*storing it as an object type in props or session
Jeremy Connor
@LordSyntax
Interesting, thank you! I'll stick with the listenTo approach for now!
v1rt
@v1rt
Is it ok to ask regarding ampersand-state and webpack?
Anyways, I'll post it because someone might know :)

My friend told me that when constructor is used in a function, Webpack spits out an error on the console saying Uncaught TypeError: _WEBPACK_IMPORTED_MODULE_0_ thatmodule__.a is not a constructor. He showed me the error. He said, in order to fix it, the word constructor should be replaced with initialize. The module being used and exported is ampersand-state and it's in src/profile/index.js.

import State from 'ampersand-state';
export default State.extend({......
// blah blah, code removed for clarity

Then on the outer index.js(not src/profile/index.js), the code is

import Profile from 'src/profile';
export default module.exports = Profile;

What are your thoughts on the constructor issue?

Richard Butler
@RickButler
@v1rt I would have to set something up to repro, I don't think that's ampersand, I think you need to set up webpack to treat that as a
A commonjs import
Maybe webpack is trying to treat that as an es6 class when it isn't
Richard Butler
@RickButler
export default module.exports = Profile; that line doesn't make any sense.
I saw the error when I was playing around, but once I used the correct export syntax it went away.
v1rt
@v1rt
got it
good morning @RickButler :) that's what I see in our code :worried:
let me double check to make sure i'm telling the truth
yes it's what I see
Richard Butler
@RickButler
@v1rt yeah it should be one or the other not both, since you are using es6 style imports, you should be using es6 style exports.
v1rt
@v1rt
ok
the dev even added a comment before it saying "will both work in es6 and commonjs"
Richard Butler
@RickButler
You are using webpack so it really doesn't matter. Webpack can understand either.
if you tried to use that in an environment that onyl understood commonjs style require module.export, then the import wouldn't work...
v1rt
@v1rt
ah got it
going back to the error I posted regarding constructor, what are your thoughts? I'm going to update my code copy to see the changes my teammate made. He said it fixes the error
however, i'm worried about what's been happening since looks like the fixes here are all hackish
Richard Butler
@RickButler
I think that maybe something besides ampersand-state was getting exported. So maybe an empty object or something.
v1rt
@v1rt
got it
i'll take a look at it deeper
i'll put a breakpoint
StompyNZ
@StompyNZ
hello, i'm building my first ampesandjs app and having some trouble with a load on demand collection that I want to cross reference properties from another collection. Specifically i have an id field in my main collection, and I want to map that to a name field on the other collection by id reference. The solution I have works most of the time, but on occasion has no data in the second collection (I assume an async race condition causes it)
the render function on my page object is:
render: function () {
    if (!app.itemclasses.length) {
      app.itemclasses.fetch();
    };
    this.renderWithTemplate();
    this.renderCollection(this.collection, collectionView, this.queryByHook('recipe-list'));
    if (!this.collection.length) {
      this.fetchCollection();
    };
  },
are there some examples of how to build an app with rest-collections and cross references? having no luck googling for them
oh, and the derived property on my recipe is:
ItemClassName: {
      deps: ['Type'], fn: function () {
        var itemclass = app.itemclasses.get(this.Type);
        return itemclass != null ? itemclass.Name : '';
      },
      cache: false
    }
Richard Butler
@RickButler
Use a subview to render the collection in, then you can use waitFor on the subview declaration to wait for
The collection to return values