Project

General

Profile

Revamped javascript build system

Added by koszko 4 months ago

Colby suggested making the build system cross-platform by rewriting it in javascript contained in a standalone html file.

Currently, the README's build instructions assume that the user is not
working on an adversarial system.  One thing I'd like to see with
Hachette, in order to maximize user freedom, is to not make this
assumption.  Instead, revamp the build system.  Consider someone
trying to work in a public library or from a lab where they do not
have control over the operating system of the machine that they're
running. They're unlikely to be able to use ./build.sh.  (And even
if the person trying to make modifications is using, say, a POSIX
system, subtle differences across ostensibly POSIX-compatible
implementations can cause problems.)

This can be ameliorated by redoing the build system so that a
description of the build process is detailed in a document (say
build.html) that lives in the repo root.  This document would be
responsible for both telling the user what steps are necessary, and to
function as the build script itself.  Under these circumstances, the
requirements to be able to modify/build Hachette would be exactly the
same as the requirements to use it--i.e., that they have access to a
Web browser.  This is a fairly safe assumption in general, but given
the nature of the project, it is known that this requirement will be
satisfied.

I am personally not convinced, but it seems like a nice hack nevertheless.


Replies (4)

RE: Revamped javascript build system - Added by jahoti 4 months ago

It's definitely a nice hack. However, to actually implement it risks creating a real inconvenience for the sake of purely hypothetical potential contributors as far as I can see.

We could definitely add notes on how to edit the built packages- which are very readable, and will only be put in a zip archive- and manually incorporate patches made this way if the need arises. Until there is a concrete example of a potential contributor needing it, however, completely rewriting the build system doesn't seem a priority.

RE: Revamped javascript build system - Added by koszko 3 months ago

On Mon, 5 Jul 2021 15:51:36 -0500
Colby Russell js-extensions-discussion@x.colbyrussell.com wrote:

On 7/5/21 8:54 AM, W. Kosior wrote:

What Jahoti already posted there is more or less what I would
respond if I was to keep arguing (although sometimes it's perhaps
better to stop and accept someone else's idea, so as not to waste
resources on useless wars).

I didn't realize we were in a war.


Ok, discussion can be considered moved to:
https://hachettebugs.koszko.org/boards/1/topics/1

As I understand it, what this means is that while neither you nor
Jahoti are enthusiastic enough to invest in personally implementing
this yourselves, you would be willing to accept patches if someone
else were willing to make the investment?

https://www.colbyrussell.com/2013/08/06/patches-wanted.html

If that were the case, it would appear that we're past the main hurdle
of the patch paradox.

https://www.colbyrussell.com/2017/08/06/contributors-dilemma.html

I.e., I can be confident that I wouldn't be at risk of wasting my own
resources to make this happen only to be turned away after the fact
due to lack of willingness interest--again, if that's actually the
case.

Can I get a clarification on this?

PS:

discussion can be considered moved

I just tried to reset my password, but it doesn't seem to be working,
so I can't log in.

PPS: Since my account is completely unused at this point, I would just
create a one, but IIRC, those require manual intervention, too. Maybe
consider allowing open registration for now--not just for me, but
again: other potential contributors--and if it becomes evident that
it's a problem, shutting it off at that point.  (But keyword being
"evident"!)

Yeah, my Redmine configuration is not really complete: https://hachettebugs.koszko.org/boards/2/topics/3
I will also enable open registrations once I sit at it.

As to war - we were not at it. Yet ;)

My stance regarding your idea is exactly as you said it: I shall not devote my personal time to such build system, but I shall accept your patches

On Mon, 5 Jul 2021 23:03:00 +0000
jahoti jahoti@envs.net wrote:

On 7/5/21 8:51 PM, Colby Russell wrote:

As I understand it, what this means is that while neither you nor
Jahoti are enthusiastic enough to invest in personally implementing
this yourselves, you would be willing to accept patches if someone
else were willing to make the investment?

https://www.colbyrussell.com/2013/08/06/patches-wanted.html

If that were the case, it would appear that we're past the main
hurdle of the patch paradox.

https://www.colbyrussell.com/2017/08/06/contributors-dilemma.html

I.e., I can be confident that I wouldn't be at risk of wasting my
own resources to make this happen only to be turned away after the
fact due to lack of willingness interest--again, if that's actually
the case.

Can I get a clarification on this?

It's of course not my place to accept or reject patches;
nevertheless, for what it's worth your interpretation corresponds
accurately to my opinion. While there are some additional
reservations I didn't write in the referenced comment (e.g. drawing
in masses of unnecessary external libraries), you already seem to
have brought those up in your journal and quite frankly seem like one
of the best people around to implement this idea appropriately.

RE: Revamped javascript build system - Added by koszko 3 months ago

Colby, how is your progress?

You know, what? I thought it might be difficult to create the build system contained inside an HTML page because we have to read and write multiple files when performing the build. I then though you might actually choose to load zipped sources, unzip them in js, build, zip the result and prompt the user for a location to save it. Chances are you actually came up with some other solution (our ways of thinking seem to differ a lot). But in case you somehow came up with the same one, I'd like to ask you whether you used jszip[1] and how you plan to pull it (it seems Debian has it packaged, so it's not that bad).

I was interested in this because I was considering replacing JSON-based import/export system with a zip-based one, which would involve pulling some zip library into the extension. After a minute of thinking I decided this would incur too much bloat but I decided to ask you anyway.

[1] https://github.com/Stuk/jszip

RE: Revamped javascript build system - Added by koszko about 1 month ago

I now realized there is a web API for accessing entire directories:
https://developer.mozilla.org/en-US/docs/Web/API/File_and_Directory_Entries_API

No need for zip library then :)

    (1-4/4)