azproduction / lmd

LMD - JavaScript Module-Assembler for building better web applications :warning: Project is no longer supported :warning:
http://azproduction.ru/lmd/
MIT License
449 stars 27 forks source link

Some more advanced examples welcome #164

Open rlopes opened 10 years ago

rlopes commented 10 years ago

Hello,

Your solution really looks promising. As a long RequireJS user, I like what I see here since it offers simple lightweight solutions and welcome new features. I like the flexibility.

However I am struggling a bit with my Ember.js projects: bootstrap framework, jQuery plugins, multiple pages, views, controllers and precompiled handlebars templates. I am creating several concatenated Javascript files that I load on demand when an user browse to certain pages. I am also keen on splitting my CSS and load them asynchronously when needed as well. This is more an app than a website. I use Grunt and I am making use of grunt-lmd. I had to figure out a bit how to work with it by myself but it is fine now.

I think some good example about how to use grunt-lmd would help others. I kind of figured out how to use it by looking at your unit tests.

I would also love some more advanced examples using Ember.js, AngularJS on top of the Backbone example to better see mix of the different features the library offers. I must admit I got a bit confused going through the documentation: this might be a reason why we don't see more people picking up the library. For example, the config flags could use a table listing all of them with their default values, if they are mandatory or optional and a description of what they do.

Otherwise I think your library might offer the best middle ground between the AMD and CommonJS modules and for all the basic features, the numerous examples are really helpful. I know it is hard and time consuming to get the documentation right, but it would be sad if people get the wrong impression this library is too complicated to use. I don't think it is but there is a learning curve at the moment that documentation could solve.

Regards,

Richard

Note: I don't pretend to know enough at this stage to help on the documentation but if we use it in production in the coming weeks, I might have some time to contribute sometimes later.

azproduction commented 10 years ago

Thank you all for your feedback, Richard!

For example, the config flags could use a table listing all of them with their default values

Good remark. I will fix it.

I must admit I got a bit confused going through the documentation

What king of issues are you trying to solve with wiki docs? May be I will add it to getting started.

I would also love some more advanced examples using Ember.js, AngularJS on top of the Backbone example to better see mix of the different features the library offers.

That is a good point. I will work on it.

I am also planning to write better getting started https://github.com/azproduction/lmd/issues/151 you can propose an theme for it (todo service is boring).

I think some good example about how to use grunt-lmd would help others. I kind of figured out how to use it by looking at your unit tests.

I will and it to new Getting Started.

Thanks again!

azproduction commented 10 years ago

Just added Flags and Plugins wiki page.

rlopes commented 10 years ago

Thanks for your answers.

Actually after spending the last couple of days going through the examples I am starting to feel very good about the features I needed. I managed to do all I wanted so far: several bundles of javascript I load on demand when users browse specific pages, got async loading of css going as well and the system avoid pollution of the global scope which is perfect.

Maybe I need to look now at how I can optimise the amount of LMD code that gets bundled as well, but the config flags table should help me out.

In terms of examples, the Backbone TODO with LMD is good: people recognise that app from Addy Osmani website. This is also a good way to compare with the equivalent RequireJS structure.

I am not sure what other example in particular would make a good getting started, but maybe something that goes step by step, starting with a simple setup and gets more complicated as you add more controllers, views and introduces templates in the mix, with an opportunity to cover features like async loading, css or js loading, maybe bundles. A blog app is a common choice as an example. I saw your component-lmd repository too: it is a good example, very relevant now that we have Web components coming.

Another angle could be to write "recipes" for popular frameworks like Backbone but also AngularJS or Ember.js by demonstrating how LMD can fit those architecture and bring benefits. Also "recipes" about how to perform the unit tests in those contexts with LMD in the mix. If those frameworks have example apps in their tutorials/getting started maybe those could be the apps you can adapt for LMD.

Being said, it is a lot of work. If I can help sometimes later I will try. I think I am getting a grasp of LMD, at least in my Ember.js context.

rlopes commented 10 years ago

That new Flags and Plugins page is great. You instantly see what the config file can use by browsing it. Thanks for that.

azproduction commented 10 years ago

If those frameworks have example apps in their tutorials/getting started maybe those could be the apps you can adapt for LMD.

This is a great idea!