As of version 0.21.0, just released minutes ago, Aloha Editor http://aloha-editor.org/ is now released under the same license as Drupal: GPLv2 or later: http://aloha-editor.org/license.php (note: Huge thanks to Haymo Meran for working with the Spark team to make this happen!!!)

It's located at:
https://github.com/alohaeditor/Aloha-Editor/

Spark, among likely other distributions, is aiming to use this.

Comments

Mark Theunissen’s picture

Status: Active » Needs work

Cool! Looking forward to using it.

The issue is that it's > 10M download (https://github.com/alohaeditor/Aloha-Editor/downloads), which is strictly speaking over the limit. You may know who can make exceptions? Is that you? :)

License: https://github.com/alohaeditor/Aloha-Editor/blob/dev/LICENSE.txt

webchick’s picture

Really? What is this 10M thing? That's news to me.

Mark Theunissen’s picture

sun’s picture

Why is it 12 Megabytes (zipped!) in the first place...?

That's ~1200% of the actual size of the editor library files. Something must be wrong with those tarballs :-/

webchick’s picture

The ones on Github seem to only be 10.8M zip files, which is still over that limit, though. Looks like a lot of it is in docs, demo examples, etc.

I searched, and really can't figure out where this arbitrary limit came from, though. I looked at the issues linked at #1360456: Finalize the criteria and process for the whitelist for external dependencies packaged with Drupal distributions, searched them for "uncompressed," and "10" and various other combos and found no mention whatsoever of this suggested 10MB limit. Either dww invented it in response to some of the general concerns of "bloating" the CVS repository, it came up in some off-the-grid IRC discussion, or... I have no idea.

Since the license is exactly the same as Drupal—GPLv2—we're of course perfectly able to check it into the Spark repo. That seems like a really weird thing to have to do, though, if our concern is bloat. Especially since I know Commons is also planning to use Aloha, and I could imagine a world where Panopoly did too, and perhaps even more. And suddenly we're storing 10.8MB * N files instead of 10.8MB of files.

Mark Theunissen’s picture

I agree, the limit should be revisited, it is arbitrary.

Wim Leers’s picture

Maybe we can work with the Aloha Editor folks and get a "clean" repository from a Drupal perspective (i.e. generated docs should not live in the repository, nor should demos, etc.). But I highly doubt they'll change their practices. I'm sure they have good reasons for that, too (e.g. one nice side-effect is that it's possible to generate docs for any version, whereas we in the Drupal world rely on an out-of-band — version-wise — website for non-API docs).

Also note that the major difference with how Drupal does things is that Aloha Editor has the concept of "builds". That's why there's both a "src" and a "build" directory. Théodore Biadala (nod_) worked with the Aloha Editor folks to get a custom build just for Drupal, so that we can continue to use hook_library() etc., so that we can integrate Aloha Editor in the same way as we've integrated everything else. However, there still are unresolved issues there, which the Aloha Editor folks unfortunately haven't solved just yet.

Furthermore, their builds include many files we don't actually need or want. So, for now, please hold off on actually committing Aloha Editor to drupal.org, while we work with them to solve this.

All of the above is "as far as I know", because Théodore is the guy who worked specifically on the build process/Drupal integration aspect with them. I've reached out to him to get this solved ASAP.

geerlingguy’s picture

I think the general idea behind 10MB was to make it so that people wouldn't throw huge tarballs all around drupal.org with example images, movies, etc. that were not necessary for the actual functionality. One library had a demo video included in the default download that was something like 40 MB... Is there any way to convince the Aloha people to have a '-min' package, or something?

It seems like, between the docs and the demos, there are already at least 10-20 MB of (uncompressed) waste in there...

redndahead’s picture

I agree demos can create security holes also. I think fckeditor ran into this where it was recommended to delete the examples folder.

Wim Leers’s picture

Much like contrib module maintainers are expected to manually minify JS files, i.e. build JS stuff manually, we'll have to create a script to build exactly what we want/need from their git repo. They've already committed a custom build profile for us, they're just not doing the build for us, so they're definitely fine with this.

I'll comment here when I have this figured out. (It's not the highest priority though.)

webchick’s picture

Since posting #5, the https://github.com/alohaeditor/Aloha-Editor/tree/release-0.21.x version is down to 10.6M now. ;)

webchick’s picture

This issue has now been open for > 2 weeks, and I'd really like to move forward here, since DrupalCon Munich is creeping up and we've spent significant time with the Aloha folks to work out bugs/add features required for integration with Drupal, and even got them to change the license of their freaking project to support Drupal.

According to http://drupal.org/node/422996 I guess we're ok to just check this code into Edit module directly, since it's GPLv2+ and since:

"Exceptions can be made if the 3rd party library:
had to be modified to work with Drupal and the modifications were not accepted by the original author."

Aloha's not going to maintain a custom "minimum" fork just for us to get around this policy. They already changed the license on their entire project for us, I'm not interested in pressing for more backflips from them.

I really hate to do this though, since it's going to lead to proliferation of varying versions of Aloha in various modules/distros, which is exactly the mess this whitelist was intending to stop.

However, if the whitelist maintainers don't think we can make an exception for .6M, then I guess that's what we're going to have to do. :\

webchick’s picture

I guess possible alternatives to creating a huge mess of different versions of Aloha files all over the place in contrib would be:

- Maintain our own "minimal" build on Github somewhere, and whitelist that. Théodore recommended http://gruntjs.com to do this.

- Do that, but put it on Drupal.org instead at like http://drupal.org/project/aloha_library or something, and distros/modules that wish to use it could incorporate it as a dependency. This would be a bit "more" official since it wouldn't be sitting at a URL like http://github.com/wimleers or http://github.com/acquia.

This way, we could honour the < 10M requirement, and there'd still be only one place for all Drupal code to point to. This ruins the canonicalness/officialness/trustworthiness of the source, however, and pushes a bunch of extra maintenance work back onto the Drupal community.

redndahead’s picture

I think it's more than just the .6mb. My guess, since I wasn't in the discussions, was it was supposed to limit the amount of unnecessary files being in the package. That's where the policy should be made.

If I was to write the policy I would put it on the distro maintainers. "For the 3rd party libraries you should try and use the download that has only the files that are necessary for your distribution to work. This not only reduces the download size, but it also helps prevent security holes introduced by examples provided by the 3rd party library. If the 3rd party library doesn't have a download with the minimal files please consider creating a patch file for the library that removes the unnecessary files, then add this patch to the configuration of the library in your drush make file." or something with a better wording.

webchick’s picture

If I were to write policy, I'd say "We do not hack core, and we do not hack 3rd party libraries."

geerlingguy’s picture

Status: Needs work » Reviewed & tested by the community

I vote to allow the .6MB in this case, but the general principle of not including unnecessary code remains. Especially as Aloha will likely become a strong contender for those who don't want to use TinyMCE/CKEditor going forward.

However, I still strongly support pushing other projects to offer downloads free of rampant excess (e.g. demo files and docs that are half or more the size of the actual code being used—and are better off hosted outside of the main repo anyways). It makes for a Better Internet™ :)

redndahead’s picture

@webchick I don't think we are hacking libraries. Sometimes things have to be fixed and a patch is the correct way to do that. Removing example directories is far from hacking. There are plenty of reasons distros will provide a "hack" of core. An example will be the usage of the http://drupal.org/project/robotstxt module. This requires you to delete the robots.txt file from core. I think providing a patch that removes robots.txt in your make file so you can get that module working is a reasonable and an easily documented way of "hacking core".

In the case of 3rd party libraries removing example files actually provides more security.

Wim Leers’s picture

#16: We're working with the Aloha Editor guys to find a way around this problem that works both for them and for us: https://github.com/alohaeditor/Aloha-Editor/issues/656.

But I wholeheartedly agree, it doesn't make sense to include all the files (to say it disrespectfully: all the cruft) that 99% of all site owners will never even look at for a second.

Maybe the best solution then is to take the same approach Panopoly took? I.e.: apply a patch to the downloaded tarball to add/remove stuff: http://drupalcode.org/project/panopoly.git/blob/refs/heads/7.x-1.x:/drup....
This is a win-win-win approach:
- we get to use Aloha Editor right away
- no excessive file size ends up in the distributions that use Aloha Editor
- no weird work-arounds necessary
We can then continue to work with the Aloha Editor guys to improve the build system so that we can move away from this work-around.

However, for this to work, we *do* need to get it whitelisted ASAP. Since geerlingguy already RTBC'd it yesterday, can we please do that? :)

Wim Leers’s picture

1) Apparently they DO have some sort of "min build", they just do a very bad job of making it publicly available/explaining it. See https://github.com/alohaeditor/Aloha-Editor/issues/656#issuecomment-7550181. It's available from http://archiva.gentics.com:8081/archiva/repository/com.gentics.public/or... and is only 5 MB. I've asked them to make this more of an official practice, with less hacky download URLs. But, for now, this meets all previously unmet requirements: size and security wise. Could you please whitelist the above URL?

2) I've gone ahead and went with the approach outlined in #18.

This works well:

libraries[alohaeditor][download][type] = get
libraries[alohaeditor][download][url] = http://archiva.gentics.com:8081/archiva/repository/com.gentics.public/org/alohaeditor/alohaeditor/0.21.1/alohaeditor-0.21.1-cdn.zip
libraries[alohaeditor][patch][] = http://drupal.org/files/1702248-5.patch
libraries[alohaeditor][patch][] = http://drupal.org/files/1702248-pull_request_642-6.patch
libraries[alohaeditor][patch][] = http://drupal.org/files/1702248-pull_request_643-6.patch

All that is needed now, is whitelisting this baby :)

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Oh, WOOT.

Ok, in that case, I went ahead and created this whitelist entry, because:

1) The license is not an issue, as pointed out above
2) The one caveat was the size + "scope" of the files
3) Even so, this was RTBCed by a whitelist maintainer for the big horrible version, so the small non-horrible version should clear the rules nicely.

The URL I whitelisted was ^http://archiva|.gentics|.com:8081/archiva/repository/com|.gentics|.public/org/alohaeditor/alohaeditor/.+$ since the Github URLs are full of cruft. http://drupal.org/node/1717458

Thanks a lot, folks. Really appreciate your time and attention to this!

Mark Theunissen’s picture

You used pipes | in your regular expression instead of backslashes, I fixed it for you. :)

webchick’s picture

Duh. It's very early. :P Thanks, Mark!

Wim Leers’s picture

Status: Fixed » Reviewed & tested by the community

Great news; they've now started uploading these packages to Github as well instead of that seemingly "internal use only" URL!

- URL: https://github.com/downloads/alohaeditor/Aloha-Editor/alohaeditor-0.21.1-cdn.zip
- regexp: ^https://github\.com/downloads/alohaeditor/Aloha-Editor/.+$

For future reference: https://github.com/alohaeditor/Aloha-Editor/issues/656#issuecomment-7578680.

Wim Leers’s picture

I just realized we may want to prevent "non CDN versions" from being downloaded, otherwise we're still exceeding that 10 MB limit:

^https://github\.com/downloads/alohaeditor/Aloha-Editor/.+-cdn\.zip$

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Added. Thanks!

webchick’s picture

Status: Fixed » Active

Re-opening this for something that's come up.

So. We are actively (and by actively, I mean 2-3 pull requests a day or something) working with the Aloha team on fixing bugs and smoothing out interactions in their code so that it works better with Drupal. We are also pulling in certain plugins (akin to modules) from their "mega build" to meet Spark's requirements. Together, this requires custom builds of Aloha.

Currently, we are doing this by downloading the CDN version in our .make file (which was the only one that met approval from the Drupal.org whitelist maintainers due to the size issue), which is compressed/aggregated JS code, then going through an excruciating process to figure out what those upstream pull requests are in "compressed JS version," uploading them to the issue queue, and applying the patches from there.

We broached the Aloha guys with this problem and they basically said they have no idea why we're doing that. What we're doing is taking something akin to Drupal core + every module in one package, then trying to strip it down. Aloha is actually designed to be used in a way that every project that needs it does a custom build to meet their requirements — that's why the default package is so large; so it can fill every use case. They actually advise AGAINST using the default packages or the CDN package for this like Drupal.org requires.

Now, obviously checking in third-party code directly into projects/modules on Drupal.org is generally against the rules. There's an exception for "a great bunch of effort required" or something (sorry I'm on my way out the door and can't find the node atm). However, in this case we're being directed by the upstream project to do this.

As an extremely temporary measure, we are checking our custom build directly into the Edit module since the licenses are identical. But we need help on how to resolve this in a way that is compatible with D.o's rules, and also is something other distros can benefit from.

Wim Leers’s picture

The one thing I can add to what Angie said is that we're working on a "generic Drupal-optimized build" of Aloha Editor.
That build will have each Aloha Editor plug-in in a separate directory. Then we'll be able to define each Aloha Editor plug-in as a JS library in Drupal (through hook_library()), meaning that we'll be able to have dependencies defined in Drupal, the Way It Should Be.

That's what we should do, but it's not allowed by the current d.o policies.

So right now, we have a custom build of Aloha Editor with just the things that the Edit module/Spark use (that's the extremely temporary measure Angie mentions). I'm going to commit this to the Edit module and as soon as we can do things the right way (see above), we'll shift to doing that instead.

Note for those who read the above and still wonder why we don't use the "CDN package": that build also includes five versions of jQuery and five different aggregated versions of Aloha Editor. As such, it is extremely suboptimal. (There are even more reasons, but that'd make this comment too long.)

webchick’s picture

A big question for the whitelist maintainers is where such a generic Drupal-optimized build of Aloha can/should live. We could put it at http://github.com/wimleers, but that seems sub-optimal since eventually Wim will be pulled onto other projects. We could put it at http://github.com/acquia, but that also seems suboptimal because this is a community resource, not Acquia-specific. We also thought about http://drupal.org/project/aloha_library or something, but we don't allow checking in third-party code. And finally, a http://[some-new-domain.com]/ which is really Acquia + some Aloha people + some community contributors, but we could ideally do that on Drupal.org too and not "fork" the community.

Feedback would be awesome, because we're very interested in doing this right.

webchick’s picture

Also, to get an idea here of the impact...

The CDN package approved by the whitelist team is >5 MB zipped, >15 MB unzipped. The custom build is 1.6 MB (and 25% of that is due to jQuery UI).

geerlingguy’s picture

I'm going to have to defer to someone else... this is an interesting issue, and my gut instinct would be to create an aloha_library project and go with that. That would definitely break the 'no hosting third-party code' rule, though (as you mentioned). Only other option would be to do something like set up a 'drupal' organization on GitHub and tell people they can host 3rd party code there. Would be a weird situation, though.

Wim Leers’s picture

#29: the 1.6 MB is unzipped, BTW. So it's a 90% size reduction.

killes@www.drop.org’s picture

The "no 3rd part rule" says that we can't host code on d.o that is available elsewhere. If that _specific_ collection of 3rd party code doesn't exist anywhere else, I see no problem hosting it on d.o.

webchick’s picture

Oh, well that's lovely then! Because yes, this specific collection of code would be stuff that's highly optimized to Drupal's use case (I'm hand-waving a bit here, but it would essentially pull in low-level libraries to support things like image captions + tokens + other things you need for the input format system, and leave out things like jQuery UI which is already in core), and thus not something the Aloha people would have any interest in hosting/maintaining.

We'd need to put some thought into how to have both a generic "Drupaloha core" build that would work for many different varieties of distributions, but also fit more specific needs for the Edit module. Both the Aloha guys and WIm will be at DrupalCon Munich so we'll try and come up with a plan and report back.

Wim Leers’s picture

Awesome news!

I'm sure I didn't explain it clearly enough in #27, but indeed the goal still is to have a build that's suitable for *any* Drupal site or distribution, without any bias towards the Edit module. (Or, if it makes sense, maybe a branch that is biased to the Edit module and one that is generic.)

redndahead’s picture

Is it too onerous to create a patch for aloha editor and use that in your make file? This would pretty much accomplish the same thing.

webchick’s picture

Unfortunately, yes. Please read #26.

Wim Leers’s picture

#35: the patch would have to be tens of megabytes large. Plus, it wouldn't actually be able to accomplish the same things.

redndahead’s picture

Ok for me doing a custom library is a last resort as it becomes difficult to determine what has actually changed, but I understand if something is just way too difficult to put together.

Edit: Also Killes has given his ok so I say go for it.

quicksketch’s picture

We've worked with the maintainer of the Aloha project on drupal.org to make the "aloha" namespace available for our purposes for this special build of Aloha (see #1704414: Aloha switched to jQuery UI; change module to match). Considering there's also *a lot* of things that we can integrate Aloha with *without* getting into the inline editing portion of Edit module, this also makes an excellent home for providing basic Aloha functionality on the node/x/edit page. It also provides a stepping stone for a properly namespaced module to be added to Drupal core (so we can add "aloha" first, then "edit" later).

I'm working on pulling out Aloha out of Edit module and making it a stand-alone project, though more collaboration with Wim will be necessary since I'm not yet familiar with all the trimmings that the Spark team as put into these custom plugins that come with the Edit module.

webchick’s picture

Rock! Thanks a lot, quicksketch!

Wim Leers’s picture

I wasn't notified of Nate's comment — weird. Needless to say, I'm on it :)

geerlingguy’s picture

@quicksketch / #39 - any progress on getting the Aloha project up and running yet?

kreynen’s picture

Status: Active » Fixed

Moving this back to fixed this since the original URLs are already whitelisted and reason it was reopened (https://drupal.org/node/1701784#comment-6363974) is no longer relavant.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.