Skip to content
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

Hashes in builder #169

Open
timwienk opened this issue Nov 6, 2014 · 10 comments · Fixed by #174
Open

Hashes in builder #169

timwienk opened this issue Nov 6, 2014 · 10 comments · Fixed by #174

Comments

@timwienk
Copy link
Member

timwienk commented Nov 6, 2014

In the previous version of the website, one could use a generated hash to quickly (re-)select the parts/components/packages they want in their build of Core or More. Additionally, the hash was added to the built files. This functionality is not present in the new builder.

It worked through an sqlite3 database with a "hashes" table containing three columns:

  • md5 (the generated md5-hash of the package-string)
  • packages (the package-string)
  • date (timestamp of when the hash was added to the database)

The package-string is a semicolon separated list of components.
In case anyone is interested:

  • there are 14215 hashes in the Core database.
  • there are 42986 hashes in the More database.
  • the first date in the databases is 2010-10-02 12:29:50 UTC.
  • the last date in the databases is 2014-11-03 21:12:00 UTC.

If the feature is re-added, it would be preferable if this database can be re-used. The desired way of working would be to enter the hash to select the components in the builder, then be able to click "download".

Additionally, paths like http://mootools.net/more/<hash> used to select the right components automatically, that should probably work again as well (and/or redirect to http://mootools.net/more/builder/<hash>).

Example rows below (columns separated by pipes):

e8f3003df2d0919c1091b11854a53e9b|Core/Core;Core/String;Core/Event;Core/Browser;Core/Class;Core/Element.Style;Core/Element.Event;Core/Element.Delegation;Core/Element.Dimensions;Core/Fx;Core/Fx.CSS;Core/Fx.Tween;Core/Fx.Morph;Core/Fx.Transitions;Core/Request.HTML;Core/Request.JSON;Core/Cookie;Core/DOMReady|1415017941
2aa60ee2887f132a617b2a49754ef7fd|Core/Core;Core/Array;Core/String;Core/Number;Core/Function;Core/Object;Core/Event;Core/Browser;Core/Request;Core/Request.HTML;Core/Request.JSON;Core/Cookie;Core/JSON|1415017221
d1d2b98d3cae0d77aa29422996e67802|Core/Core;Core/Event;Core/Element;Core/Element.Style;Core/Element.Delegation;Core/Element.Dimensions;Core/Fx;Core/Fx.Tween;Core/Fx.Morph;Core/JSON;Core/DOMReady|1414767773
73a246bd9f16ce89e3ab685ff1e08599|Core/Array;Core/Function;Core/Event;Core/Class;Core/Element;Core/Element.Event;Core/Fx|1414689276
22af847e17dad82b2f32682e0f617e3e|Core/Core;Core/Array;Core/String;Core/Number;Core/Function;Core/Object;Core/Event;Core/Browser;Core/Class;Core/Class.Extras;Core/Slick.Parser;Core/Slick.Finder;Core/Element;Core/Element.Style;Core/Element.Event;Core/Element.Dimensions;Core/Fx;Core/Fx.CSS;Core/Fx.Tween;Core/Fx.Morph;Core/Fx.Transitions;Core/Request;Core/Request.HTML;Core/Request.JSON;Core/Cookie;Core/JSON;Core/DOMReady|1414636765

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/5805929-hashes-in-builder?utm_campaign=plugin&utm_content=tracker%2F130405&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F130405&utm_medium=issues&utm_source=github).
@arian
Copy link
Member

arian commented Nov 6, 2014

big 👍

@SergioCrisostomo
Copy link
Member

I would like to help out here.

I made this (449a29b) which redirects old hash URLs to the builder and populates the checkboxes. From there is just to press the button.
Works also for eventually new hash urls like core/builder/hash

This does not have a database implemented and imported, just a test dummy here would need to be upgraded.

Made a live demo here which redirects from a old-style link core/hash (the first on @timwienk example) and is download-able.

If its usefull the commit could be used maybe.

@timwienk
Copy link
Member Author

timwienk commented Nov 7, 2014

That's a good start.

I think we can just route /core/:hash, instead of a regex, though. As long as it's as last route.

@timwienk
Copy link
Member Author

timwienk commented Nov 7, 2014

For the hashes we need to be able to both load and save them. So it may be a good idea to put that in a separate module. I put an untested example on top of your commit (timwienk@8463fa0d), feel free to pull that onto yours if you want to use it.

I don't expect that to work like that (for one the sqlite3 and md5 packages will need to be added from npm), but how this would work:

var builderHash = require('middleware/builderHash')({
    core: '/srv/mootools/core/database/packager.sqlite',
    more: '/srv/mootools/more/database/packager.sqlite'
});

builderHash.load('core', 'e8f3003df2d0919c1091b11854a53e9b', function(data){
    if (data){
        console.log(data.hash, data.packages);
    } else {
        console.log('Hash not found.');
    }
});
builderHash.save('core', ['Core/Class'], function(data){
    if (data){
        console.log(data.hash, data.packages);
    } else {
        console.log('Hash not saved.');
    }
});

The paths should probably be set in some kind of configuration.

@SergioCrisostomo
Copy link
Member

Nice! Will continue on it tonight.
(if any other wants to back this would be cool)

@timwienk
Copy link
Member Author

timwienk commented Nov 7, 2014

It might be worth checking if #171 can be resolved together with this issue, since the component selection code needs to be touched anyway.

@ibolmo ibolmo added this to the 1.1 milestone Nov 10, 2014
@timwienk
Copy link
Member Author

There is no graphical interface in the builder to enter hashes yet.

If the feature is re-added, it would be preferable if this database can be re-used. The desired way of working would be to enter the hash to select the components in the builder, then be able to click "download".

To illustrate, the builder "header" from the old website:
hash

@timwienk timwienk reopened this Nov 12, 2014
@lorenzos
Copy link

Hashes are not exported in the build when Download minified source code is checked. Unfortunately I didn't notice earlier, and now that I need an additional module, I have to guess what modules I chose before 😐

@SergioCrisostomo
Copy link
Member

@lorenzos sorry for you, thanks for reporting. We just pushed a fix for that 6b95448

@lorenzos
Copy link

Great 😉 Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants