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
Richard Butler
@RickButler
@thatgreenguy sounds like browsersync isn't serving the right mime type for it, but offhand I'm not sure if that's even browsersyncs fault. Normally your web server will return the correct mime type but browser sync is just putting an IP infront of some static files.
@thatgreenguy are you using one of the sample projects?
Paul Green
@thatgreenguy
I used the ampersand cli tool to generate the project
Have created couple of models views templates etc
Im new to ampresand so still learning
Richard Butler
@RickButler
@thatgreenguy in the CLI moonboots is used to serve the client side. https://github.com/lukekarrys/moonboots-express
Paul Green
@thatgreenguy
Ah okay will take a look at that - using node/express on backend but was not sure where to go for config of mimetypes - thanks
Richard Butler
@RickButler
Moonboots is just a plugin around express from what I see. In the index.js you see where it configures paths and content types
    path: this.jsPath(),
    contentType: 'javascript',
    cachePeriod: this.options.cachePeriod,
    source: moonboots.jsSource,
    middleware: this.middleware.js
  })
you can probably set up a path for your font resources and add the appropriate content type.
Paul Green
@thatgreenguy
Many thanks for pointing me in right direction - cheers
Richard Butler
@RickButler
@thatgreenguy no problem, good luck.
Rui Ramos
@ruiramos
hi everyone, cc @cdaringe, just updated my ampersand-view dependency bcs of that known issue with render-remove-render breaking bindings and subviews however i'm surprised that when you overwrite the view's render method, the new _render function created skips the call to _upsertBindings()... am I missing something here?
thanks
Richard Butler
@RickButler
@ruiramos I think that keeps it in line with previous versions of render and _render behavior. Before they started using defineProperty for render (and after), you had to call the prototype.render if you wanted default functionality + your custom functionality. I think they are trying to maintain backwards compatability.
I have lots of projects from old versions where I def render: ```
render: function () {
//custom stuff before
view.prototype.render.call(this);
//custom stuff after
}
render: function () {
//custom stuff before
view.prototype.render.call(this);
//custom stuff after
}
Adarsh Nanwani
@adarshnanwani
Hi everyone. I came across AmpersandJS when I was researching on some new UI frameworks and now I want to use it build a small UI rich application.
But, I have no prior experience of working with Node.js and Browserify.
Can anyone please tell me what should be the starting point for an absolute beginner like me?
It would be really helpful if I can get an outline of what all I need to do/know, in order to build an app using AmpersandJS.
Please help me out in this, I will be really grateful. Thanks in advance!
M. Scott Doerrie
@doerrie
I am having trouble with the 'moonboots_hapi' module. I'm new to this framework and am probably doing something wrong that is easily corrected. If anyone can find a mistake in this, let me know. I ran these commands:
$ git clone https://github.com/wraithgar/moonboots_hapi.git
$ cd moonboots_hapi/
$ git checkout v7.0.0
$ npm install
$ npm test
23 tests complete
Test duration: 1900 ms
The following leaks were detected:Reflect
Coverage: 85.29% (25/170)
index.js missing coverage on line(s): 6, 16, 19, 31, 37, 48, 54, 55, 56, 57, 58, 59, 77, 78, 79, 80, 81, 96, 97, 98, 99, 100, 121, 128, 142

npm ERR! Test failed.  See above for more details.
M. Scott Doerrie
@doerrie
I wanted to start with a known good result before attempting to provide modifications, but this problem suggests that I'm doing something much more fundamentally wrong.
v1rt
@v1rt
I posted this question in Backbone channel thinking that there might be non-ampersand devs on that channel.
Good evening folks. We're using backbonejs, marionette and ampersand state. I was tasked replace internationalization/localization that my teammate wrote from scratch. 5 years ago, I used i18next on a jquery/php project. I'd like to know which library I should use this time. I'd like something that is easy to implement. I'd like to be able to just update a json file rather than changing or assigning values during runtime(like what my teammate did).
v1rt
@v1rt
Does this mean we are not using BackboneJS nor Ampersand but rather Backbone.Marionette? This is from our package.json
    "ampersand-router": "^3.0.2",
    "backbone.marionette": "^2.4.4",
    "bluebird": "^3.3.4",
    "lodash": "^4.17.4",
    "marionette.component": "0.0.1",
    "moment": "^2.14.1",
Richard Butler
@RickButler
@v1rt do you use a templating library (handlebars, mustache, jade, etc)? Some have i18n plugins. If you use static html files, you could make them into handlebars files for example, and then precompile them back to static html with your replacement values from json.
@doerrie I just looks like a test coverage error, I wouldn't worry about it. Open an issue if you are concerned. Personally I would use the cli generated project as an example, a lot of the refs are out of date. The server side stuff (hapi, express) is nothing like what you would use in production imo.
Richard Butler
@RickButler
@doerrie wouldn't* use the cli generated project
v1rt
@v1rt
hi @RickButler , yes we do use handlebars
we import the template in every component using import. Here is one of our components called Status
import {LayoutView} from 'backbone.marionette';
import template from './template';

export default LayoutView.extend({

  modelEvents: {
    change: 'render'
  },

  template: template,

  templateHelpers() {
    return this.model.toJSON();
  }

});
Richard Butler
@RickButler
@v1rt there are i18n plugins for handlebars, if you are using require.js there is a i18n plugin for it too. If I was writing it, I would precompile the the internationalization part, so you would have seperate templates per language. I don't know how your system is setup though, so that may not be feasible.
hsimah
@hsimah
when I hit save() on my ampersand-model the derived and children fields are posted to the api along with the props. is there a way to stop this happening? I have a projectId prop and a project is one of the model's children. I only want to send the projectId to the api on save, not the project model
Richard Butler
@RickButler
@hsimah derived fields shouldn't be going by default. If you want to change what gets sent you can overwrite the serialize method.
hsimah
@hsimah
@RickButler you're right, the derived fields aren't being submitted. only the children and collections. I will look at the serialize method.
hsimah
@hsimah
many thanks
v1rt
@v1rt
@RickButler I learned yesterday that they want to get rid of handlebars and instead just use ES6 template literals/strings
Richard Butler
@RickButler
@v1rt something like http://i18n-tag.kolmer.net would work then.
Template literals doesn't come with some of the logicalutility functions that handlebars does. You will have to build your own, or use something like that project I linked where someone has done it already
v1rt
@v1rt
Thank you @RickButler
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));