marionettejs / backbone.marionette

The Backbone Framework
https://marionettejs.com
Other
7.07k stars 1.26k forks source link

Marionette custom build #1118

Closed yamsellem closed 10 years ago

yamsellem commented 10 years ago

Marionette is branded as a “collection of common design and implementation patterns”.

While it is a "all or nothing" download for the moment, allowing to download separate parts (including their dependencies) — like twittter.bootstrap does — would be a wonder.

samccone commented 10 years ago

@yamsellem we do offer standalone pieces here http://marionettejs.com/

yamsellem commented 10 years ago

By standalone you mean allow the use of Marionette.View without Marionette.AppRouter, Marionette.Application or Marionette.Module?

I don't see that :-( And I've heard many times this will be a great addition in the teams I've work with.

samccone commented 10 years ago

Oh, you want to pull those pieces out. Hmmmm that will actually be a bit tricky to do. Mind telling me your use case?

yamsellem commented 10 years ago

I've seen a lot of projects using a module loader — like RequireJS — and through don't need Marionette.Module. As well, Marionette.Application and Marionette.AppRouter are not compulsory.

To me, Marionette is good at handling views (an area, where Backbone does not do much).

But Application, Module, Controller, Event bus, all seem a lot when there is still room in the view area (loading, hiding, dynamic layout AFAICT) and where other tools exists for those different purposes.

IMO, here is the fine line between library and framework. Small is beautiful, don't you think?

samccone commented 10 years ago

Sure I think it would be nice to build each file as a standalone or at least a subset of them. Would you be interested in working on the grunt file to add this?

yamsellem commented 10 years ago

Sure.

My schedule has not a lot of blank spot right now. If this can wait a while, I will work on it then :-)

  1. Have you some advices to do this?
  2. Maybe we can add a page to the website with checkboxes a la twitter?
frankcortes commented 9 years ago

You could use something similar like JQuery or Bootstrap (Using a website: http://getbootstrap.com/customize/) or maybe like LoDash (Using the command line: https://lodash.com/custom-builds). Personally, I prefer the first option over the second one.

It would be really nice this feature. Automagically, you could avoid to load unneeded modules that you are loading at the moment, keeping your javascript thinner.

santihbc commented 9 years ago

@yamsellem are you finally working on it?

jamesplease commented 9 years ago

I understand that this is a feature many people want, so I went ahead and did the work over on #1900 to support pulling in pieces of Marionette by themselves. The PR works great, and works out-of-the-box with UMD. So your AMD/CommonJS/ES6 build process will pull them in correctly.

It wasn't merged because some members of the team felt it wasn't a good idea. I contend that there's nothing wrong with the idea, so go ahead and use that branch if you're interested.

samccone commented 9 years ago

@santihbc @frankcortes hey guys just wondering your usecase here, what is your motivation for this feature.

frankcortes commented 9 years ago

In my case, I want to avoid loading marionette Modules because I would rather use requireJS or Requirify. Futhermore, I don't need to use some features like TemplateCache or Behaviours module.

samccone commented 9 years ago

that is a fair need @frankcortes , Reopening 1900

yamsellem commented 9 years ago

Sorry @santihbc but I haven't find the time to (I've been quite busy with Thorax lately — I can share some thoughts elsewhere if you want me too).

Using Require or Browserify is, in fact, a good sample of the need to use precise parts or Marionette. Thanks for reopening ;-).

jshthornton commented 9 years ago

I +1 this idea. To me I intend to use a lot of micro libraries to build a web application. For instance I might use Virtual DOM for templating, Immutables and Stores (LokiJS) for models and collections, and PubSub.js for the event bus.

But something that Marionette is unrivaled at is a great View system.

yamsellem commented 9 years ago

@jshthornton If you like small libraries with one purpose, you may take a look to Ampersand. It shares the common patterns of Marionette, but with a component state of mind (and it trades Marionette's deprecated Controller & Module for a useful State).

stephanebachelier commented 9 years ago

@yamsellem interesting ;) Le mar. 30 juin 2015 à 11:32, amsellem yves notifications@github.com a écrit :

@jshthornton https://github.com/jshthornton If you like small libraries with one purpose, you may take a look to Ampersand http://ampersandjs.com. It shares the common patterns of Marionette, but with a component state of mind (and it trades Marionette's deprecated Controller & Module for a useful State).

— Reply to this email directly or view it on GitHub https://github.com/marionettejs/backbone.marionette/issues/1118#issuecomment-117084676 .