Hi Sander, First of all, thanks for your thoughts.
Regarding the RequireJS, the intention to not build the component is to have the code being cloned with Git Subtree any place you want in your high level application. There's no use of having the component being built as the whole idea is to have the source-code being inserted where you want in order to help application development. There may be options to build the component, but the component should not rely on other components, if not, you can't really build it. Perhaps I'm misunderstanding your critic, but as I said, components should be out in the open and cloned as is with Git Subtrees. If building the component was on the table, we would be talking about Bower and not Git Subtree. Regarding my blog post, perhaps you missed something, as the very intention behind my proposal is to decouple AngularJS modules in a way that let you just use them to inject anywhere you want not worrying about the AngularJS module name used. The very same idea behind the Angular 1.4/1.3.x and CommonJS feature but with RequireJS. The only thing that makes the whole idea a little more complicated is that what it is being returned is an object with a *moduleName* property. That way you can return anything else if you want as part of that object, like a page URL (on a *pageConfig *object of the returned object). And for this to be seamless to the developer, I created a helper that extract the *moduleName* of a RequireJS module and return it to be used as the array of dependencies to create a new AngularJS module. I might as well could go with the CommonJS approach implemented for AngularJS 1.4/1.3.x but in the frontend, without Browserify, to achieve a clean way to do this, I had to create that helper. It's not that necessary to be there, and is surely something you can ignore, it's just helps you with the custom object returned from a RequireJS module. Instead of using it, you might need to grab every single RequireJS module, and create an array of their *output.moduleName*, as the *output* is not the module name per se. Hopefully I answered your concerns. By the way, as it happens to me every time I get an idea, I thought about warping Git Subtree into a NodeJS CLI tool called Compounds <https://github.com/compounds/compounds>. It's in development but you are all free to contribute if you want to. Regards. On Wednesday, March 11, 2015 at 2:43:14 AM UTC-3, Sander Elias wrote: > > Hi Leo, > > I like your idea of using git subtree. This lets you build your > applications out of small building blocks. You need a good style-guide and > your team needs to take in account that modifying a component might break > something else. Aside from that, it is a good way to incorporate reusable > parts in your projects. > > I highly dislike the requireJS idea. I firmly believe you should use a > build step that creates a single file output. If you don't want to deliver > security sensible code to all users, build different versions (exclude the > code out of the build that you don't want to ship) > If your code-base becomes extremely large, you might split it up in a few > parts that you might load when needed. > Let me tell you what I think what extremely large is. If you concatenate > and minify all your code, and the gzipped result of that is larger then > 250Kb(for web) or larger than 1Mb(for in-house stuff) > Of coarse, sometimes you want to split up things, for that you can use > commonJS modules (as supported by angular itself since 1.4), or implement a > ES6 module loader. This way, your code-base is ready for the future. Then > let your build tool build them. > > On more thing, in your blog post, you are creating a config that is away > in another module. In this module you explicitly name the resource the > config is for. Isn't this defeating the purpose? If it is that thightly > coupled, should it be in the module it is intended for? If not, why bother > with the coupling. For all I know, an Mb is an Mb for every purpose? > > Regards > Sander > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
