You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our current process for building web-assets is flawed for a number of reasons:
It requires people to install less, handlebars, and coffeescript, which many potential contributors complained about.
The development process of these projects often involves breaking changes, so rethinkdb build process can often break as a surprise to us and our users.
Our solution to prebuild web assets for tagged versions of rethink is ok, but it doesn't help people who want to be on the bleeding edge.
I propose the following alternative:
Check in js versions of less, handlebars, and coffeescript into the repo.
During the build, instead of using lessc and friends, just use v8/node to build our web assets.
This gives us a number of benefits:
People who want to build rethink off bleeding edge don't have to deal with less, handlebars, and coffeescript dependencies
We can simplify our configure script by removing all these dependencies
We'll have complete control of upgrading to newer versions of these components
The issue of web assets breaking will go away in practice
This has a very questionable smell to me but I can't think of anything better. Anyone have other potential solutions? Also there must be some people doing things similar to this. Any idea how they do it?
Could you try to explain why? This actually seems ok in a sense that it's sort of like including bootstrap or underscore.js -- you wouldn't typically make it a build prereq, you'd just include it. I don't think it's a big leap to extend this to coffee/less and co.
Actually upon second thought, the web people use the equivalent of this technique. When they're not preprocessing on their own servers, they'd typically store a specific version less.js, coffee.js, etc. on their server, and then have the browser download those and run on the client.
Having less/handlebars/coffee-script in the repo sounds like a good idea to me.
I'm a little worried about having node since it's platform dependent I guess?
If it's doable, we should do it.
I don't know how much work it would be for @AtnNn though.
It seems like this could get to be a hairy situation if developers had their own versions of these tools installed and didn't realize our build process distributed a version of them. It's also a bit of repo bloat which is always a pain. That being said it seems like the pros might well outweigh the cons here I'm just wondering if there's an established way to do this that someone can point to. I know in the rails asset pipeline some people just have a pre-commit hook which compiles the static assets locally and commits them in a specific place. This seems like it would bloat the repo even more but I'm wondering if something like this could work.
Well the conflict would come up if they didn't realize we were using the repo versions and tried to compile using their local versions and it didn't work.
Just to clarify I'm not saying this is a big enough reason not to do it. But if I see a .coffee file I might reasonably guess that I can just pass it through my local version of coffee to see what it compiles to rather than using the build system. So we can't in general make sure that people in general use the build system version of coffee.
I'm a little worried about having node since it's platform dependent I guess?
No, we couldn't include node. We'd still be stuck with that, but it doesn't cause nearly as many problems as less/coffee/handlebars because of breaking changes.
I'm a little worried about having node since it's platform dependent I
guess?
No, we couldn't include node. We'd still be stuck with that, but it
doesn't cause nearly as many problems as less/coffee/handlebars because of
breaking changes.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/958#issuecomment-19128691
.
I would like to double check handlebars and less before freezing
everything if you are ok with that.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/958#issuecomment-19140689
.
Interestingly enough we might actually be better with the unminified
versions here. While minified is smaller it probably will diff a lot worse
which means over time its going to lead to a larger repo. This is just a
guess though.
On Jun 7, 2013 6:26 PM, "coffeemug" [email protected] wrote:
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/958#issuecomment-19140787
.
Just for people who are going to try to build from source while this issue is not solved yet
These versions are known to work
Less 1.3 -- 1.4 is not compatible with our version of bootstrap
Handlebars 1.0.7 -- >= 1.0.8 have issues with the syntax {.../id}
CoffeeScript 1.6.3 -- 1.5, 1.6 and 1.6.1 are shipped with bugs.
We're already going to specify precise versions in the 1.6 release. The thought process behind adding the libs directly is that many people complained about having to install these dependencies in order to build rethink from scratch, and including them would alleviate that.
OK, but instead of installing n dependencies, if you say "npm is a
dependency", it will work out of the box, with (imho) cleaner design - the
dependencies itself are installed by npm, and project only contains
manifest with version numbers. I think this more manageable and changeable.
Embedded library is harder to manipulate.
Is requiring npm (that is, node, since it's bundled with it) too much?
coffeemug wrote:
We're already going to specify precise versions in the 1.6 release.
The thought process behind adding the libs directly is that many
people complained about having to install these dependencies in order
to build rethink from scratch, and including them would alleviate that.
—
Reply to this email directly or view it on GitHub
<#958 (comment)
.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/958#issuecomment-19218486
.
Building rethinkdb should not require internet access. If it did, users behind a firewall or proxy will have trouble building rethinkdb, and our launchpad builds would fail because the build farm is not connected to the internet.
a thought: npm can install from a tarball, so you might be better off checking-in the zipped package (found with npm info modulename), at least it's treated as a binary by github and friends, smaller and easier to update.
@Herby I think I agree with you. I was trying to avoid downloading dependencies when building because the other rethinkdb dependencies are big c++ libraries that also need to be configured and built, which is slow and error-prone.
@AtnNn minified != zipped, though it turns out git already compresses everything with zlib and handles binary deltas just fine, in the end neither would make any difference
Activity
jdoliner commentedon Jun 7, 2013
This has a very questionable smell to me but I can't think of anything better. Anyone have other potential solutions? Also there must be some people doing things similar to this. Any idea how they do it?
coffeemug commentedon Jun 7, 2013
Could you try to explain why? This actually seems ok in a sense that it's sort of like including bootstrap or underscore.js -- you wouldn't typically make it a build prereq, you'd just include it. I don't think it's a big leap to extend this to coffee/less and co.
coffeemug commentedon Jun 7, 2013
Actually upon second thought, the web people use the equivalent of this technique. When they're not preprocessing on their own servers, they'd typically store a specific version less.js, coffee.js, etc. on their server, and then have the browser download those and run on the client.
neumino commentedon Jun 7, 2013
Having less/handlebars/coffee-script in the repo sounds like a good idea to me.
I'm a little worried about having node since it's platform dependent I guess?
If it's doable, we should do it.
I don't know how much work it would be for @AtnNn though.
mlucy commentedon Jun 7, 2013
This sounds like a good idea to me as well.
jdoliner commentedon Jun 7, 2013
It seems like this could get to be a hairy situation if developers had their own versions of these tools installed and didn't realize our build process distributed a version of them. It's also a bit of repo bloat which is always a pain. That being said it seems like the pros might well outweigh the cons here I'm just wondering if there's an established way to do this that someone can point to. I know in the rails asset pipeline some people just have a pre-commit hook which compiles the static assets locally and commits them in a specific place. This seems like it would bloat the repo even more but I'm wondering if something like this could work.
neumino commentedon Jun 7, 2013
There shouldn't be any conflict if people have less/handlebars/coffee-script installed on their machine.
Basically handlebars/less/coffeescripts are just little scripts. We don't have to copy them in
/usr/binor whatever usual directory.The only disadvantage that I can see for now is that our repository will be a little bigger.
jdoliner commentedon Jun 7, 2013
Well the conflict would come up if they didn't realize we were using the repo versions and tried to compile using their local versions and it didn't work.
neumino commentedon Jun 7, 2013
We can easily make sure that we use the repo versions.
jdoliner commentedon Jun 7, 2013
Just to clarify I'm not saying this is a big enough reason not to do it. But if I see a .coffee file I might reasonably guess that I can just pass it through my local version of coffee to see what it compiles to rather than using the build system. So we can't in general make sure that people in general use the build system version of coffee.
AtnNn commentedon Jun 7, 2013
There are a lot of projects that include a compiled coffee-script:
https://github.com/search?q=var+Lexer,+compile,+ext,+fs,+helpers,+lexer,+loadFile,+parser,+path,+sourcemap,+vm,+_i,+_len,+_ref,&source=cc&type=Code
We could easily add it to our repo as a single, minified file.
jdoliner commentedon Jun 7, 2013
Consider me completely sold then.
coffeemug commentedon Jun 7, 2013
No, we couldn't include node. We'd still be stuck with that, but it doesn't cause nearly as many problems as less/coffee/handlebars because of breaking changes.
neumino commentedon Jun 7, 2013
Some libraries don't support all node versions.
I'm having trouble with handlebars and Ubuntu 13's node right now.
2013/6/7 coffeemug [email protected]
6 remaining items
coffeemug commentedon Jun 8, 2013
Agree with @neumino.
On Fri, Jun 7, 2013 at 6:19 PM, Michel [email protected] wrote:
jdoliner commentedon Jun 8, 2013
Interestingly enough we might actually be better with the unminified
versions here. While minified is smaller it probably will diff a lot worse
which means over time its going to lead to a larger repo. This is just a
guess though.
On Jun 7, 2013 6:26 PM, "coffeemug" [email protected] wrote:
neumino commentedon Jun 9, 2013
Just for people who are going to try to build from source while this issue is not solved yet
These versions are known to work
Less 1.3 -- 1.4 is not compatible with our version of bootstrap
Handlebars 1.0.7 -- >= 1.0.8 have issues with the syntax {.../id}
CoffeeScript 1.6.3 -- 1.5, 1.6 and 1.6.1 are shipped with bugs.
coffeemug commentedon Jun 10, 2013
We're already going to specify precise versions in the 1.6 release. The thought process behind adding the libs directly is that many people complained about having to install these dependencies in order to build rethink from scratch, and including them would alleviate that.
coffeemug commentedon Jun 10, 2013
Hmm, that makes sense. I'll talk to @AtnNn about it today.
On Mon, Jun 10, 2013 at 11:50 AM, Herbert Vojčík
[email protected]:
AtnNn commentedon Jun 10, 2013
Building rethinkdb should not require internet access. If it did, users behind a firewall or proxy will have trouble building rethinkdb, and our launchpad builds would fail because the build farm is not connected to the internet.
ricardobeat commentedon Jun 11, 2013
a thought: npm can install from a tarball, so you might be better off checking-in the zipped package (found with
npm info modulename), at least it's treated as a binary by github and friends, smaller and easier to update.AtnNn commentedon Jun 11, 2013
@ricardobeat: @jdoliner correctly pointed out that plain text files take less space in git than zip files.
AtnNn commentedon Jun 11, 2013
@Herby I think I agree with you. I was trying to avoid downloading dependencies when building because the other rethinkdb dependencies are big c++ libraries that also need to be configured and built, which is slow and error-prone.
ricardobeat commentedon Jun 13, 2013
@AtnNn minified != zipped, though it turns out git already compresses everything with zlib and handles binary deltas just fine, in the end neither would make any difference