-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
[api-minor] Produce non-translated/non-polyfilled builds by default #11241
Conversation
d5ccae5
to
1d9e2cb
Compare
gulpfile.js
Outdated
// Builds the generic production viewer that should be compatible with most | ||
// older HTML5 browsers. | ||
gulp.task('generic-es5', gulp.series('buildnumber', 'default_preferences', | ||
'locale', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, and similar below, we could extract the function
and give it skipBabel
parameter so we don't have to duplicate it (unless I'm overlooking something, they seem equal aside from the SKIP_BABEL
parameter). Something like (untested):
function createGenericViewer(skipBabel) {
...
return merge([...]);
}
gulp.task('generic', gulp.series('buildnumber', 'default_preferences', 'locale', function() {
createGenericViewer(/* skipBabel */ true);
}));
gulp.task('generic-es5', gulp.series('buildnumber', 'default_preferences', 'locale', function() {
createGenericViewer(/* skipBabel */ false);
}));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[...] they seem equal aside from the
SKIP_BABEL
parameter
For what it's worth, there's also a difference in output directories...
While you're obviously correct that it should be possible to reduce the size of the gulpfile.js
changes, I'd very much like to get an OK on the general idea of this PR before spending too much time on it.
In no particular order, there's a couple of things that we'd need to consider:
- Are we OK with changing the default to producing non-translated/non-polyfilled builds by default, and instead having to explicitly specify when ES5-compatible builds are wanted?
Personally I'm hoping this will be seen as a step in the right direction, since it might also allow further modernizing of the build system. - ES5-compatible
generic
builds are obviously still provided, but is[api-minor]
enough since these changes may require that implementers manually change what files they depend on?
Also, are we OK with only providing pre-built ES5-compatible files for thegeneric
build target, since this simplifies things considerably? - What about all of the
examples
?
Personally I'd like to avoid changing them wholesale to use the ES5-compatible files, but how should we document this (inline comments, Wiki entry, and/or something else; and will people even bother to read it)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm personally also in favor of preferring ES6 builds over ES5 builds. However, I'm not sure if [api-minor]
is the right classification for this change since it's quite a behavior change; it feels more like [api-major]
to me.
I'm thinking that to make this work for [api-minor]
we can do the reverse, namely keep the default at ES5 but also provide ES6 builds. This is already a step in the right direction because now we don't really provide ES6 builds, so it will allow people to start using it and provide us with feedback. Moreover, we and users don't need to adjust anything immediately. For the next major version, we can then swap the builds, making ES6 the default and ES5 the alternative option. In the major version after that, we can then hopefully drop the ES5-only build altogether.
What do you think? Also /cc @yurydelendik @brendandahl for opinions on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking that to make this work for
[api-minor]
we can do the reverse, namely keep the default at ES5 but also provide ES6 builds.
Honestly, this feels like way more work/complication compared to the current approach (and certainly not something I'd bother doing, unless the users complaining about there not being any non-translated builds actually compensating me for my time :-).
Even trying to do something like this would also make e.g. the pdfjs-dist
repository really big and complicated, not to mention even slower to generate, since you'd probably need to essentially duplicate all of it's code which is precisely what I actively tried to avoid here.
In that case I'd personally much rather just immediately increment the major
version, and keep the current approach of modern builds with a few exceptions, and then be done with it since this simplifies things considerably!
Furthermore, note that the non-translated builds aren't actually ECMAScript 2015 (i.e. older classification ES6) but rather at least ECMAScript 2018 (i.e. older classification ES9). Hence labelling something as ES6 isn't even remotely accurate/correct, unfortunately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry if the above seemed a bit grumpy!
Some additional thoughts:
[...] so it will allow people to start using it and provide us with feedback.
Assuming that a modern, and up-to-date, standards-compliant browser is being used I really cannot imagine there being any problems with using a non-translated/non-polyfilled build (based on the fact that the PDF Viewer in Firefox has been shipping this way for years).
Also, simply incrementing the major
version should definitely allow to move forward and "fix" things like e.g. issue #11211.
Finally, considering that the first official release from the 2.0
branch was released a year ago, it doesn't seem so bad to me to increase that now (especially for these kind of build improvements).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incrementing the major version number for the reasons you mentioned sounds like a good idea, so perhaps that's indeed an easier approach. I'll think about this plan a bit more.
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/ee02a2e381b03ca/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/ee02a2e381b03ca/output.txt Total script time: 2.39 mins Published |
1d9e2cb
to
aee5159
Compare
aee5159
to
7a201ce
Compare
7a201ce
to
7b77a1e
Compare
Part of this work probably ought to also include some sort of clean-up/re-factoring/simplification of the fake worker loading code, since the current state feels like a mess (and given the complaints about it): Lines 49 to 106 in bbd2386
|
I've tried to strip this down to its bare essentials, see master...Snuffleupagus:fakeWorkerLoader, with the intention of only supporting Node.js and the All in all, I'm nowhere near knowledgeable enough about various module loaders to be able to sort out issues like these unfortunately. Hence I'm not really sure about the way forward here (and given that these sort of module loader changes brings no benefit to me personally, I'm finding it really hard to justify spending even more of my spare time on it). |
Although I suppose that you could just remove all non-browser "fakeWorkerLoader" fallback code and simply update the Node.js examples and |
I think the problem is that we're all not really knowledgeable about module loaders and we also don't have contributors maintaining this. Looking at #9580 perhaps it's not even desired to have support for Webpack in this repository? I think we should go back to basics a bit: support only the use cases that are relevant and most often used, and leave the rest to third-party implementations or contributors if they really wish to have this support in the repository. @yurydelendik @brendandahl What do you think? |
7b77a1e
to
276266e
Compare
This is, as far some people are concerned (me included), a bug in Webpack since it's currently impossible to force Webpack to leave a The only "solution" that currently seem to exist, as gross as it would be, is probably to use |
Ugh. If it's required to be able to move on, I guess it's better than doing nothing, but it's also not great either. Don't we have the |
Yes, but in the built files that's replaced with a standard |
806a3eb
to
7422a4c
Compare
7422a4c
to
30fd0e7
Compare
Having thought a bit more about this I'm also not opposed to making this an |
Excellent point; yes that'll be somewhat of a problem, until the releases "catch" up to the new format. I'm not sure how to fix this generally, short of manually hard-coding the links after the relevant releases are done (perhaps that's not so bad though, since it'd be temporary)? |
cb542fb
to
c7daeb8
Compare
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/a36bdfddf296cae/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/a36bdfddf296cae/output.txt Total script time: 2.41 mins Published |
The latest version of the patch does something along those line, and will thus require manual fix-ups after the next two releases but then "things should just work"TM. |
I'm fine with the approach taken here. If this is merged, I'll extend the release wiki page so we don't forget to manually update the website. |
bb48d92
to
ad3b4f1
Compare
Thanks for the review, hopefully I've managed to address all your comments. /botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/4d6a7c9d4dd6b7a/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/4d6a7c9d4dd6b7a/output.txt Total script time: 2.52 mins Published |
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/249570a207f0a54/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/19f8f0b8546dc33/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.215.176.217:8877/19f8f0b8546dc33/output.txt Total script time: 2.17 mins
Image differences available at: http://54.215.176.217:8877/19f8f0b8546dc33/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/249570a207f0a54/output.txt Total script time: 19.74 mins
Image differences available at: http://54.67.70.0:8877/249570a207f0a54/reftest-analyzer.html#web=eq.log |
ad3b4f1
to
c91228f
Compare
c91228f
to
c97c778
Compare
Let's do this. I'm seeing this as a good step forward. Thanks! |
@timvandermeij Thanks for good review comments! I've opened a follow-up PR to clean-up the state on the bots a bit, see mozilla/botio-files-pdfjs#26 |
No description provided.