Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility of Working with Marionette #434

Open
samccone opened this issue Feb 4, 2015 · 5 comments
Open

Possibility of Working with Marionette #434

samccone opened this issue Feb 4, 2015 · 5 comments

Comments

@samccone
Copy link

samccone commented Feb 4, 2015

Hi @saponifi3d and @spikebrehm

There is a fair amount of interest on our side of the pond in using rendr with Marionette Applications.
marionettejs/backbone.marionette#2002

I was wondering if you had any thoughts on this, would love to work with you guys on this.
👍

@saponifi3d
Copy link
Contributor

@samccone - Hmm that's a good question. I think Marionette might not be possible because it overrides so much on of Backbone, and Rendr does too.

Things like a Marionette Item View extends backbone and overrides the render function. This becomes problematic because Rendr also overrides the Backbone.View class to add it's own render function that knows how to render differently on the client / server.

I'm trying to think if there is a way you could shim marionette as backbone in browserify, then have Rendr extend that.. but.. I think you'll run into way more problems than it'd be worth by going down that road...

TL;DR - I don't think you can without writing an adapter for Marionette to extend Rendr, which will probably turn into writing a lot of scaffolding and just calling into Marionette functions.

@spikebrehm
Copy link
Member

I agree -- there would likely be too many collisions between the two Libraries and the way they both subclass Backbone.View, Backbone.Model, etc.

That said, it looks like Marionette has all sorts of useful things, so you may be able to pull some of them in to a Rendr app, or at least build a Marionette-inspired approach.

@StevenLangbroek
Copy link

+1 on this. some things I think would be especially useful from Marionette:

  • CollectionView / ItemView / EmptyView. I'm a bit worried by the {{#each models}} loop and DOM-event handling (you'd have to store some state in the DOM when trying to figure out which iteration in a loop caused a click event).
  • triggers hash on Views.
  • Layouts
  • triggerMethod love that tiny little function.

Application and Controllers already appear to be covered quite well, as does a Router.

@rjcorwin
Copy link

My dream: Yo package called generator-rendr-marionette

This desire comes from:

  1. I'm tired of writing boilerplate.
  2. Isomorphic is a requirement.

@saponifi3d
Copy link
Contributor

Hmmm, honestly wouldn't be too hard to make a base CollectionView and have it take a template name for the ItemView and build it that way, including an appended and all that jazz to easily hook into it. It would be more of a reimplementation of ideas from marionette than using theirs directly, which is a little sad.

As for a Yo generator.. those are pretty straight-forward to write, the difficulty becomes the difference w/ how people generally write code. Things like requireAMD vs require boilerplate are very different. Some people also prefer different styles with module.exports and I think it might be a little bit too opinionated. I could make one for both requireAMD and require, but they'll all be tied to my opinions of how i think it should be written :p if you're cool with that i can try taking it on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants