Commit Graph

68 Commits

Author SHA1 Message Date
Jonas Jenwald
45933545f1 Merge pull request #8394 from yurydelendik/l10n
Wraps mozL10n to async calls; splits firefox and generic l10n libs.
2017-05-31 17:31:22 +02:00
Yury Delendik
5438ce9b98 Wraps mozL10n to async calls; splits firefox and generic l10n libs. 2017-05-31 09:22:25 -05:00
Yury Delendik
bd288df909 Merge pull request #8396 from mukulmishra18/streams-lib
Adds streams-lib polyfill and exports ReadableStream from shared/util.
2017-05-31 08:42:48 -05:00
Jonas Jenwald
7d3a3252b5 Allow specifying the PDFJS_NEXT build flag via an environment variable when running the various gulp commands
After PR 8459, the run-time of the various `gulp` test commands has regressed quite badly on Windows. For me, `gulp test` now takes approximately *twice* as long when run locally on Windows.
The problem seems to be the Babel transpilation step, which takes well over five minutes to run.[1]

For someone like me, who runs tests a lot locally, this slowdown is really hurting the overall development experience.
To get around this I tested setting `PDFJS_NEXT = true` in `gulpfile.js`, since the transpilation step isn't necessary when testing in a modern browser.

However, having to edit `gulpfile.js` every time that I need to run tests isn't very practical. Hence this patch, which adds an environment variable that allows you to disable the transpilation simply by using e.g. `PDFJS_NEXT=true gulp test`.

I hope that this can be considered an acceptable solution, such that I don't need to maintain this patch locally (or worse, edit `gulpfile.js` locally before testing).

---
[1] This can also be observed on the Windows bot, but it seems fine on Linux.
2017-05-31 14:50:49 +02:00
Yury Delendik
66c8893815 Removes last UMDs from the modules. 2017-05-31 07:14:17 -05:00
Yury Delendik
b66b705ed7 Using pre-built code for testing. 2017-05-30 22:06:21 +02:00
Jonas Jenwald
957dc40ddf Replace a couple of leftover make.js references with gulpfile.js in docs/comments
Also updates a `console.log` statement in the `gulp importl10n` command (since I forgot it in a previous patch, and it didn't seem necessary with a separate patch for it).
2017-05-19 23:45:54 +02:00
Mukul Mishra
c9f44f30e5 Adds streams-lib polyfill and exports ReadableStream from shared/util.
Added test for ReadableStream.

Adds ref-implementation license-header in streams-lib
and change gulp task to copy external/streams/ in build/
external/streams/ and build/dist/external/streams folder.

Adds README.md and LICENSE.md
2017-05-20 00:26:34 +05:30
Yury Delendik
996805f953 Produces source maps for built files. 2017-05-05 08:15:21 -05:00
Yury Delendik
c9d3c20e2c Fix esprima tests. 2017-05-04 08:24:44 -05:00
Yury Delendik
2ac410625b Fixes shell parameters quoting after #8349 2017-05-03 08:17:31 -05:00
Tim van der Meij
0c99429291 Merge pull request #8349 from timvandermeij/remove-make
Migrate `make.js` to `gulpfile.js`
2017-05-02 01:12:56 +02:00
Tim van der Meij
f748407b26
Remove make.js and the target fetching in gulpfile.js
Note that we have to use `fs.writeFileSync` since `.to()` is not
available anymore. Moreover, introduce `safeSpawnSync` to make sure that
we check the return codes of the spawned processes properly.
2017-05-02 01:00:52 +02:00
Tim van der Meij
145c0cea39
Remove unused Gulp target for testing
To run the regression tests, developers use `gulp browsertest` and the
bot uses `gulp bottest`. We're not passing the `noreftest` option
anywhere in the code (probably because the `bottest` command takes care
of this already), so we should remove this.
2017-05-02 00:47:53 +02:00
Tim van der Meij
19cc9bcded
Port the mozcentraldiff target to Gulp 2017-05-02 00:47:51 +02:00
Tim van der Meij
74854fb4cc
Port the mozcentralbaseline target to Gulp
The baseline fix is dead code since three years, so we can safely remove
it.
2017-05-02 00:45:52 +02:00
Jonas Jenwald
7560f12a17 Enable the object-shorthand ESLint rule
Please see http://eslint.org/docs/rules/object-shorthand.

Unfortunately, based on commit 9276d1dcd9, it seems that we still need to maintain compatibility with old Node.js versions, hence certain files/directories that are executed in Node.js are currently exempt from this rule.

Furthermore, since the files specific to the Chromium extension are not run through Babel, the `/extensions/chromium/` directory is also exempt from this rule.
2017-04-30 11:13:34 +02:00
Yury Delendik
140dd0f15b Removes builder.build(). 2017-04-28 12:47:20 -05:00
Yury Delendik
9276d1dcd9 Allow older versions on node.js to run gulpfile. 2017-04-28 09:20:21 -05:00
Jonas Jenwald
b3582ccbad Add the commit hash to the README.mozilla file (issue 8347) 2017-04-27 23:01:22 +02:00
Jonas Jenwald
ae04cf1c37 Enable running the ui_utils unit-tests on Travis
With the exception of just one test-case, all the current `ui_utils` unit-tests can run successfully on Node.js (since most of them doesn't rely on the DOM).

To get this working, I had to first of all add a new `LIB` build flag such that `gulp lib` produces a `web/pdfjs.js` file that is able to load `pdf.js` successfully.
Second of all, since neither `document` nor `navigator` is available in Node.js, `web/ui_utils.js` was adjusted slightly to avoid errors.
2017-04-25 13:37:56 +02:00
Jonas Jenwald
a77130a0c2 Remove the signchromium target from make.js
According to the IRC discussion starting at http://logs.glob.uno/?c=mozilla%23pdfjs&s=18+Apr+2017&e=18+Apr+2017#c59676, and in particular http://logs.glob.uno/?c=mozilla%23pdfjs&s=18+Apr+2017&e=18+Apr+2017#c59682, this build target is unused and can thus be removed.
2017-04-19 23:13:16 +02:00
Yury Delendik
1d30cea914 Moves dist and minifiedpost tragets from make.js. 2017-04-18 14:00:53 -05:00
Tim van der Meij
27c3c33eec Merge pull request #8288 from yurydelendik/mv-make-web
Moves 'web' target to the gulpfile.
2017-04-15 00:03:29 +02:00
Yury Delendik
89df5ef033 Moves 'web' target to the gulpfile. 2017-04-14 16:57:53 -05:00
Yury Delendik
5855c0a8be Allow to convert (some of) ES6 code to ES5. 2017-04-14 14:39:25 -05:00
Yury Delendik
46646a9dd1 Merge pull request #8131 from timvandermeij/remove-umd-validation
ES6 modules: remove UMD header validation
2017-04-13 10:49:41 -05:00
Georg Fritzsche
4e8cd2b7d3 Rename PdfJsTelemetry-addon.jsm to PdfJsTelemetry-stub.jsm
And remove unused linting comments.
2017-04-12 13:11:04 +02:00
Yury Delendik
31f8875614 Merge pull request #8157 from Snuffleupagus/api-RenderTask-cancel-Error
[api-minor] Reject the `RenderTask` with an actual `Error`, instead of just a `string`, when rendering is cancelled
2017-04-04 09:38:47 -05:00
Andrew McCreight
d804881151 Split bootstrap script.
pdfjschildbootstrap.js will always be run, but
pdfjschildbootstrap-enabled.js will only be run if PdfJs.enabled is
true. This will let us avoid some work in the child process in the
next patch.

This will need to be landed in the mozilla-central repository at the
same time as a change to nsBrowserGlue.js. See bug 1352218.
2017-03-31 13:22:39 -07:00
Yury Delendik
25873e92f0 Enable babel translation to enable ES module support. 2017-03-27 07:25:09 -05:00
Jonas Jenwald
6d672c4ba6 [api-minor] Add a pdfjsNext parameter, and PDFJS_NEXT build flag, to allow backwards incompatible API changes 2017-03-13 18:43:43 +01:00
Tim van der Meij
5eb090f288
ES6 modules: remove UMD header validation
This patch is another step towards enabling Babel. Since we're moving
towards ES6 modules, we will not be using UMD headers anymore, so we can
remove the validation.
2017-03-04 21:43:25 +01:00
Jonas Jenwald
af44ef15f7 Don't include web/compatibility.js in the output for gulp lib (PR 8120 follow-up)
First of all, `compatibility.js` is already available in `lib/shared/compatibility.js`. Second of all, as can be seen in 9142301f35 (diff-9432ebaa58e10ab02874fcb86f689caa), the `lib/web/compatibility.js` file cannot work since the `require` statement isn't compatible with the output of `gulp lib`.
2017-03-04 18:34:28 +01:00
Yury Delendik
39e8ad24f7 Creates 'lib' for the 'dist' build target. 2017-03-03 16:37:58 -06:00
Brendan Dahl
8be4db1c34 Add gulp task to generate refs. 2017-02-24 16:59:01 -08:00
Yury Delendik
facefb0c79 Move compatibility code to the shared/compatibility.js. 2017-02-23 19:18:44 -06:00
Tim van der Meij
cada411af4 Merge pull request #8091 from timvandermeij/gulp-baseline
Gulp: migrate `baseline` target from `make.js`
2017-02-22 00:31:43 +01:00
Tim van der Meij
0f4e6fdb9d
Gulp: migrate baseline target from make.js 2017-02-21 23:50:57 +01:00
Jonas Jenwald
2aaeb17037 Include the pdfjschildbootstrap.js file in the output for gulp mozcentral builds (PR 8023 follow-up)
*Yet another thing that I unfortunately missed during review of PR 8023.*

Note that previously, in `make.js` this file was being preprocessed, however as far as I can tell that wasn't actually necessary. Hence this patch just copies the file to the proper output directory.

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1338395#c8.
2017-02-13 23:25:54 +01:00
Jonas Jenwald
991c7c196d Write the l10n files to the correct destination for gulp mozcentral builds (PR 8023 follow-up)
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1338395#c2.
2017-02-10 11:46:14 +01:00
Yury Delendik
0759066be0 Saving old-style JS module name of dist libraries. 2017-02-08 16:48:37 -06:00
Yury Delendik
a048519fa1 Replace copyright headers; changes UMD to CommonJS. 2017-02-08 16:35:58 -06:00
Yury Delendik
eb4c88cd44 Replacing custom bundling with webpack2. 2017-02-08 16:32:15 -06:00
Yury Delendik
a5ad2b166b Moves sed processing into the preprocessing tasks and merging tasks. 2017-02-07 08:53:33 -06:00
Jonas Jenwald
bc736fdc7d Adjust the brace-style ESLint rule to disallow single lines (and also enable no-iterator)
See http://eslint.org/docs/rules/brace-style.
Having the opening/closing braces on the same line can often make the code slightly more difficult to read, in particular for `if`/`else if` statements, compared to using new lines.

This patch also, for consistency with `mozilla-central`, enables the [`no-iterator`](http://eslint.org/docs/rules/no-iterator) rule. Note that this rule didn't require a single code change.
2017-02-04 15:53:08 +01:00
Yury Delendik
2049cf01db Moves preprocessor stuff to the gulpfile. 2017-02-04 08:19:46 -06:00
Yury Delendik
f1abd834d8 Moves locale and cmaps tasks to gulpfile. 2017-01-10 11:50:38 -06:00
Yury Delendik
c45300e06c Enables some unit tests on travis. 2017-01-09 15:43:45 -06:00
porlan1
d9e1cb7955 unit test files as UMD modules 2017-01-09 11:40:57 -05:00