-
Notifications
You must be signed in to change notification settings - Fork 235
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
Review for package re-org #1026
Comments
-- @anutron, MooTools ML |
As for Base-Extended, might it make sense to just move all that stuff to some of the existing Milk repos as separate AMD modules? |
http://mootools.net/docs/more - See the menu section headings :) More-Class / More-Types / More-Element / More-Request / More-Fx etc My ¢2 |
I tend to agree with moving some of Base-Extended in the existing repositories. Preferably as small separate modules so there's no extra weight if you don't use them. But also there is a |
Is there any reason not to have individual js files / modules for each extension? so I can require Is that even possible? |
Did a quick review, and wildcards are not supported. @jrburke should correct me, though. The issue with smaller modules (per function, for example) is that you'd have to do: require(['MooTools/Host/Array.reduce'], function(Array){
Array.reduce([], ...);
}); Effectively, the modules required gets ridiculously long. We have to consider that there's a practical limit to dividing the modules further and further. We are not the compiler. It's a zen. |
Wildcard on the client-side would be pretty impossible if you think about it, because you don't know about the filesystem, you would have to pre-define them, which isn't really the idea about AMD AFAIK. |
Right @arian. Only possible if you add the dependencies ahead of time. Ala goog.Closure and caldeps.py and the product: deps.js |
@ibolmo and @arian, correct no wildcards. However, relative paths are supported, may reduce typing if things are not too nested, although that does not help for outside consumers of your modules. As @ibolmo indicated, it is a balance between granularity and overwhelming the developer with too much choice. |
What I'm not digging about our plans to use this is that our scripts assume a specific directory structure. I.e. |
You can define 'MooTools' to be in a specific directory. The path after MooTools, though, has to follow it. See: https://github.com/ibolmo/mootools-runner/blob/define-2/runner.html#L57-63 I've read, though, that directories is not a great idea. @jrburke could you comment? Are alias the solution? I'm particular not against Directories. We can keep bc by having a proxy file/directory which requires the new path. |
@ibolmo: correct, normally a loader allows a mapping facility, in requirejs, the paths config can be used to map full parts of the module name to somewhere else on disk:
In a build, multiple modules are combined into one file, so the module names are just that, names. Similar to how you might expect an API to always be library.area.action(). To avoid a bunch of loader config, the convention is that the names should map nicely onto disk in non-build modes. MooTools could decide that it is better to have a shallower file structure that could lead to shorter module names, but it depends on the kind of mental map you want to establish for the code. |
Be sure to take into account who tends to work on which things and don't make it unnecessarily difficult to maintain.
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/359947-review-for-package-re-org?utm_campaign=plugin&utm_content=tracker%2F22069&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F22069&utm_medium=issues&utm_source=github).The text was updated successfully, but these errors were encountered: