-
Notifications
You must be signed in to change notification settings - Fork 53
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
investigate a method to import single Materialize modules #40
Comments
The following issue is full of information on how to get Materialize working with AMD. It's a litte difficult for me to follow, though. As far as I can see it doesn't solve single module loading but it may be a starting point. It also mentions the same problems I had getting it to work with System.js (importing single modules): Related issue: Dogfalo/materialize#1212 |
This one could also be interesting. It's about integrating Materialize and Browserify. It mentions the same "missing hammerjs, missing picker" issues I have seen from getting unit-tests to run with the npm version. Dogfalo/materialize#1422 I hope I'm not spamming their repo too much with all that issue-linking. 😄 |
ng-materialize seems to remove some of Materialize's dependencies and pulls in Waves and ngAnimate separately. |
If anyone has a hint for searching, I'd be glad. 😄
|
An issue about support for a module system. Again, referenced issues in this issue are interesting. |
angular-materialize also uses the |
So far it seems everyone is using the bundled global version in some way or the other. Issues on AMD issues split Materialize up into separate modules but always This is a little unfortunate but it may also be a good start experimenting with it since they actually do combine them. Maybe there is a way to only combine features if necessary. |
Could we possibly come up with some clever systemjs config to load toasts as a single module? It depends on Could that generally be a problem? Velocity being used as a global and as a jQuery plugin in different occasions. |
You guys have seen this, right? Someone has already made Materialize fully AMD. I don't see how this is such a complex issue, it's just a matter of setting up deps correctly. |
Thanks @isaachinman for your comment. Yes, I've seen this (the issue leading to that repo is actually linked in the first comment). But you're right, I should have a deeper look at that repo. The point of this issue is to provide a way with which we can import single features. Loading (all of) Materialize by a module loader is not a problem at all. What makes this complex from my point of view is:
But all this may come from a lack of understanding. If you have further insight, please share. |
Yes, I've personally used that AMD repo via RequireJs in a past project and it worked well. I was not interested in things like toasts and tooltips, so simply did not require those scripts. It allows for a much more modular build. The "right way" to do this is to allow devs to create modular builds from Materialize via an npm package (imo) as this is the perfect balance of custom build and "official dist", as a quick I'm actually currently using Materialize for another project, and have had to revert to using a fork as an npm package because the official Materialize package is hopelessly broken. I can't say much about the actual structure of the js (you mentioned modals), but again I don't see how it's more complicated than sorting deps and declaring them. Eg I'd be happy to help with this project as I'm quite fond of Materialize and would love to see it become a truly adaptable tool instead of a synchronous ~130kb script. |
I'd like to get some feedback from the rest of the team here. I'd be glad to see some help in this regard.. Just to be clear: Please be aware that this is not primarily an attempt to produce a modularized version of Materialize but to provide Aurelia custom components which help to use Materialize in Aurelia apps. Having said that, rest assured that I would be glad of any help getting a working modular approach. Another challenge would then be to get toasts/modals/tooltips working without depending on a |
I think it's a good idea to combine the issues mentioned in #13 and #30 into a separate issue dedicated to gather information on loading single Materialize features and make it work using a module loader instead of loading the bundled js file.
At the moment, this issue serves for gathering information on how this can possibly be done.
The text was updated successfully, but these errors were encountered: