Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 17 18:39
    paulfalgout assigned #2937
  • Nov 17 18:39
    paulfalgout assigned #3545
  • Nov 13 14:37
    paulfalgout synchronize #3679
  • Nov 13 14:37

    paulfalgout on v5-migration-example

    v5 Migration DO NOT MERGE Thi… (compare)

  • Nov 12 19:31

    dependabot[bot] on npm_and_yarn

    (compare)

  • Nov 12 19:31
    dependabot[bot] commented #3681
  • Nov 12 19:31
    paulfalgout closed #3681
  • Nov 12 19:30

    paulfalgout on v4.1.3

    (compare)

  • Nov 12 19:17

    paulfalgout on bump-and-build-v413

    (compare)

  • Nov 12 19:16

    paulfalgout on master

    Bump and build v4.1.3 (#3682) … (compare)

  • Nov 12 19:16
    paulfalgout closed #3682
  • Nov 12 19:16
    paulfalgout milestoned #3682
  • Nov 12 19:16
    paulfalgout opened #3682
  • Nov 12 19:16

    paulfalgout on bump-and-build-v413

    Bump and build v4.1.3 Addition… (compare)

  • Nov 12 19:12
    dependabot[bot] labeled #3681
  • Nov 12 19:12
    dependabot[bot] opened #3681
  • Nov 12 19:12

    dependabot[bot] on npm_and_yarn

    Bump mixin-deep from 1.3.1 to 1… (compare)

  • Nov 12 19:10

    paulfalgout on stop-replying-bind

    (compare)

  • Nov 12 19:09

    paulfalgout on master

    Pass context with unbindRequest… (compare)

  • Nov 12 19:09
    paulfalgout closed #3680
dimtabu
@taburetkin
@paulfalgout Hi, i forgot is this intended behavior or some kind of a bug?
https://codepen.io/dimatabu/pen/WNwwEvx?editors=1010
gregid
@gregid
@taburetkin in v4 you need to extend the backbone view with marionette events _.extend(Backbone.View.prototype, Marionette.Events);
dimtabu
@taburetkin
k
dimtabu
@taburetkin
i'm playing now with childViewEventPrefix.
it seems that this api was designed mostly for collection child views.
_eventPrefix should be defined in a parent view and this prefix will be used for all children events.
same api is used in a view with regions and this is not a thing i am looking for.
(also, {childVIewEventsPrefix: true } will trigger true:childeventname on parent)
ButtonView = View.extend({
   triggers: {
      'click':'click'
   }
});

View.extend({
   onRender() {
      this.showChildView('resolve', new ButtonView());
      this.showChildView('reject', new ButtonView());
   },
   onResolveClick() { ... },
   onRejectClick() { ... }
})
in this case my regions are defined and have a name and this name is good to be a childViewEvent prefix.
so, i am looking for a way to implement this
dimtabu
@taburetkin
i think, that parent view should get the answer on question should i proxy this childview's events on every childview setup.
in case of region this prefix may be defined as region option.
in case of collection view - childViewEventsPrefix - is good enough
but in case of addChildView this name should be option of each added view.
but childViewEvents at the moment expect that all children will proxy up events with the same prefix, so i think you dislike this idea ))
Paul Falgout
@paulfalgout
childViewEventPrefix was one of the most costly things happening in views, so any solution for views in regions needs to be 0-impact when it’s not used.
dimtabu
@taburetkin
@paulfalgout i've make some refactoring in previous example and i think that there is no additional performance impact.
btw, in my new app i decided to disable event proxy at all and i will use only childViewEvents and childViewTriggers.
wwy117
@wwy117
quick question. guys. does marionette works on desktop Safari browser?
dimtabu
@taburetkin
sure
Mark Lester
@mark-lester
I discovered liquidjs, which is stupendously good. I have implemented 3 phase templating, so 3 sets of markup, one in order that i can resolve translations once only per locale on the server, then cgi time generation should you have any, preserving "normal" markup for the client.
Mark Lester
@mark-lester
I am however having difficulty sticking with liquid in the client. I tried searching for marionette and liquid and anded up back at my own comment. I will revert back to handlebars in the client
Mark Lester
@mark-lester
ah, i either get liquid working or implement a handlebars implementation of parameterized translation (empty, singular plural etc stuff). i can return to it, but i appear to be the leading visible edge on marionette+liquid.
my current minor problem is how to highlight toggle a click on a collection model. I have a list of models nd when i click on them the next pane fills in with stuff. there are dozens of ways of doing this so i just wondered if it was super trivial
gregid
@gregid
@mark-lester it looks like the problem is more with templates being generated asyncly with liquidjs - try to make sample jsfiddle app showcasing the problem.
gregid
@gregid
@mark-lester feel free to use my go to template (I added liquidjs library reference) https://jsfiddle.net/akejzg04/1/
Mark Lester
@mark-lester
@gregid ta. my problem is just loading the stuff. I dont need async in the client. I have implemented a "translate" tag, and also a two phase approach to execution where if missing we output a file to .foxbat/:locale/:file, so for index.html in french .foxbat/fr/index.html, so I have set {! and {? as syntax for this once per locale exec, then {@ and {$ for "CGI time", i.e on every call, saving the standard {% and {{ to make it to the client. i have a transform tag also, which is for the parameterized translation stuff ("you have X email(s)") so that we can bake in all the options (for the empty case, singular, plural and potentially multiple kinds of plural) into the template
Mark Lester
@mark-lester
my trivial highlighter, for the benefit of other innocents, is var last var event_rules= { events: { 'click': 'clicked' }, clicked: function() { if (last) last.$el.toggleClass('highlight', false); this.$el.toggleClass('highlight', true); last=this
Aditya Trivedi
@adityatr-ls
Has anyone tried using marionette with https://testing-library.com/?
Mark Lester
@mark-lester
I am currently getting myself very confused with form submission. i am using this backbone.modal library which alas is unsupported, i cant work out how to get the value from my input field. its not in the dom, i thought it woudl be in there somewhere
Alex Daigle
@deepio
can you paginate on a Marionette view (not a collection) ?
Abdellah MASSAD
@Abdellah8Massad
Hello guys, I'm starting to work with Backbone and marionette and I need to know how to start (if you have any website or books) thanks a lot
1 reply
Thomas Tang
@tni711
Hi guys, I am new to MarionetteJS and want to explore more about the framework. I started building an App several months ago using Django / Backbone.JS. The front-end developed is getting complicated and I want to reuse the GUI component as much as possible. I explored ReactJS and VueJS and I don't like it that much. Finally come upon MarionetteJS and found the concept very familiar as an Backbone.JS extension. I plan to use Marionette to make reusing the UI components easier as compared to Backbone. Highly appreciate any advises any issues using Marionette in a multi-pages Django application? Can I use Marionette without using the webpack toolet as I found it very complicated. I just want to continue using the script tags approach. Think you very much!
Paul Falgout
@paulfalgout
@tni711 sure you can load marionette in js tags locally or from a CDN https://cdnjs.com/libraries/backbone.marionette. These fiddles https://jsfiddle.net/user/marionettejs/fiddles/ work that way
gregid
@gregid
is there a way to stop childview to be destroyed when this.render() is called on parentview? In https://jsfiddle.net/fbL819mz/5/ I have an example when executing toggle will destroy the childview; the problem is the parent (LayoutView) is provided with an instance of the view whose lifecycle is managed separately in my real application?
Paul Falgout
@paulfalgout
@gregid detachChildView first and then you can re-show it
gregid
@gregid
Excellent, thank you @paulfalgout , https://jsfiddle.net/fbL819mz/6/ works now.
Radim Baštan
@radim.bastan_gitlab

Hello everyone, I have (possibly stupid) question, but was not able to find an answer anywhere else.

I have a triggers ('click input[type="radio"]': 'bundle:selected') connected to a childView.
It's basically radio button, it's calling data in a componentModel on a click. This works just fine and there is no problem with it. What I need to do is to preselect the radio button when the page loads (or even before) and call the same data as i would click on that. I am able to select that radio button with initialize(), but this will not call the related functions.

I am totally new to Marionette. Thank you for any reply.

gregid
@gregid
@radim.bastan_gitlab have you tried to simply trigger event in initialize myView.trigger('bundle:selected') or using triggerMethod?
Radim Baštan
@radim.bastan_gitlab
So far I tried to add another call to triggers, will try it right away.
Thomas Tang
@tni711

@tni711 sure you can load marionette in js tags locally or from a CDN https://cdnjs.com/libraries/backbone.marionette. These fiddles https://jsfiddle.net/user/marionettejs/fiddles/ work that way

Thank you Paul! I ended up using the template setup by Abiee in Github in https://github.com/abiee/es6-marionette and then updated the dependencies to latest version. The demo still works! I now have a playground to explore the latest Marionette API.

Thomas Tang
@tni711
Hi, can you have multiple application instances in a page and each associates with a different region so I can manage each region as independent UI component? Thanks!
Paul Falgout
@paulfalgout
you can
Thomas Tang
@tni711
Hi Paul, thank you! I tested creating multiple application instances within a page. It works! I found, though, each application has its own message bus so the events raised within each app would not propage to the other app. In my case, I probably instantiate a single application per page which is served from Django. I still stick with the inline script tag to load up Marionette to avoid dealing with the Webpack complexity. Marionette.JS is really a natural view extension for Backbone application. The cost to adapt it is a week or two reading the documents. I found the 3.5 to 4.1.2 migration guide is very helpful and is a must read for someone new to Marionette like me as most of the examples I can find in the internet refer to 3.xx concept. The migration guide clarified what got dropped or replaced. Thank you and all contributors to make Marionette available!
Peter Dietrich
@xosofox

Hi all, hi @paulfalgout ,
with a little bit of surprise I just read v5 is "dropping its dependency on Backbone" - with some though, though, this definitley makes sense... Can you confirm this understanding:
Marionette (as dealing with Views) will become independent of Backbone's View, but I could still happily use Backbones Model/Collection approach for Marionette CollectionViews or similar things?

I don't want to waste your time justifiying this decission, but is there a chat log / blog post / documentation on the ideas on this matter?

I also want to express my thanks for keeping the library not only alive but growing!

gregid
@gregid
I am looking forward to reading more on Marionette's roadmap (blog post would be nice) but my understanding is that it is dropping Backbone dependency not Backbone support
Paul Falgout
@paulfalgout

This is correct. Backbone will still be supported. v5 is still in alpha, very early stages. Made the release for a couple of reasons.. to get the train on the tracks instead of just talking about it and so it could be pushed to a benchmark for testing the proposed changes.

I perhaps closed the related issues a bit too soon doing some fall cleaning, but we’ve had discussions open about losing the dependency for a while.

The two big outstanding changes expected are making views non-destructive to views in their regions and dropping the Backbone.View dependency. And after working on the regions for a while it was clear that the region work depended on dropping Bb.View which unfortunately slowed velocity a bit along with core contributors getting caught up in other things.

At this point I don’t know if this’ll stir up more community effort, but I’m at least commited to trying it and seeing how a backbone-less marionette works for people. It should be nearly 100% compatible if some configuration is set, but by default we’re looking to no longer utilize jquery or cache the $el on the view and region.

This opens the door to a variety of possible template/renderer solutions and improve performance.. And allows for various other little fixes that were never going to be addressed by Backbone itself.

Blog post will come when the tests are fixed and the docs are mostly updated.. Probably with a release candidate. For now, anyone adventurous enough to wade through the changes can try it, but needs to cook a bit before it’s broadcasted.

I’m not doing the best of job keeping issues on the alpha repo clear just yet, but if anyone does want to look at picking up anything or has questions about an open issue for dev https://github.com/marionettejs/marionette/issues
gregid
@gregid
Thanks @paulfalgout
Paul Falgout
@paulfalgout

Oh one other v5 breaking change which may be substantial for someone.. view’s will no longer query the dom for an el set as a string.. so if anyone was doing this:

const myView = View.extend({
  el: ‘.foo-selector'
});

They’re now going to have to do this:

const myView = View.extend({
  el: document.querySelector(‘.foo-selector’)
});
But I don’t suspect that was a frequently used pattern for people.
But the Mn community has surprised me enumerable times so if there’s a ton of push back I suppose that’s subject to change
Peter Dietrich
@xosofox

But I don’t suspect that was a frequently used pattern for people.

TBH, I used this approach "in my early days" (back on v2) when I did not really get the right understanding of "how it should be done" and Layout and View were split... Yes, long time ago, but some old apps are still alive.
Still, this is a totally valid BC break for a new version.

Personally, during my latest dev, I was always trying to go "without $" but used getUI or other things instead, inspired by a blog post quite some time ago, having in mind that one day it might be possible to drop jquery as well... This sounds awesome!

It should be nearly 100% compatible if some configuration is set,

@paulfalgout can you explain the thought there, regarding "configuration"?

Paul Falgout
@paulfalgout
So v4 introduced more configuration things like the domAPI which currently allows some removal of jQuery if configured. So a jquery domapi could be used. Same for event delegation.
Peter Dietrich
@xosofox
So are you planning to include some default, so it works "out of the box"? Or what would be necessary to do so?
Paul Falgout
@paulfalgout
Yeah so it’d be something like
import marionette from ‘marionette’;
import ‘marionette/interop-v4’;
Peter Dietrich
@xosofox
Sounds promising