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

Miscellaneous improvements for gulpfile.js (issue 10362) #13490

Merged
merged 3 commits into from
Jun 4, 2021

Conversation

Snuffleupagus
Copy link
Collaborator

  • Replace anonymous functions in gulpfile.js with named functions (issue 10362)

    This replaces all of the Starting '<anonymous>'... lines in the output, when running various gulp tasks, with more meaningful function names.

  • Clean-up gulpfile.js by removing most "-pre" tasks (issue 10362)

    Most of the gulp tasks with a "-pre" suffix, especially those related to the main build-targets, are no longer needed and can simply be inlined in their corresponding tasks. This is likely a left-over from older Gulp-versions, but currently it only adds unnecessary indirection.

    Furthermore, a number of the gulp tasks which are only used internally are converted to standard functions instead. This prevents them from being exposed "globally" and e.g. listed by gulp default.

  • Remove gulp makefile, since it's broken and unused

    Looking at the history of the code, this gulp task was accidentally broken in the Gulp 4 upgrade in PR Upgrade to Gulp 4 #10266 (all the way back in 2018).
    Given that no one has either noticed and/or complained about this since, it's safe to assume that it's completely unused, hence why I suggest that we just remove this gulp task (rather than fixing it).

Fixes #10362

…sue 10362)

This replaces all of the `Starting '<anonymous>'...` lines in the output, when running various `gulp` tasks, with more meaningful function names.
Most of the `gulp` tasks with a "-pre" suffix, especially those related to the main build-targets, are no longer needed and can simply be inlined in their corresponding tasks. This is likely a left-over from older Gulp-versions, but currently it only adds unnecessary indirection.

Furthermore, a number of the `gulp` tasks which are only used *internally* are converted to standard functions instead. This prevents them from being exposed "globally" and e.g. listed by `gulp default`.
@Snuffleupagus
Copy link
Collaborator Author

Snuffleupagus commented Jun 4, 2021

With this PR, gulp default gives the output below. As far as can tell all of these tasks make sense to expose, since they're either actual build-targets or at least useful during development and/or testing.

$ gulp default
[13:30:33] Using gulpfile ~\Git\pdf.js\gulpfile.js
[13:30:33] Starting 'default'...
Available tasks:
  botmakeref
  bottest
  browsertest
  chromium
  clean
  cmaps
  components
  components-legacy
  default
  dev-sandbox
  dist
  dist-install
  externaltest
  fonttest
  generic
  generic-legacy
  image_decoders
  image_decoders-legacy
  importl10n
  integrationtest
  jsdoc
  lib
  lib-legacy
  lint
  lint-chromium
  locale
  makeref
  minified
  minified-legacy
  mozcentral
  mozcentralbaseline
  mozcentraldiff
  npm-test
  publish
  server
  test
  types
  typestest
  unittest
  unittestcli
  web
  wintersmith
[13:30:33] Finished 'default' after 19 ms

Looking at the history of the code, this `gulp` task was *accidentally* broken in the Gulp 4 upgrade in PR 10266 (all the way back in 2018).
Given that no one has either noticed and/or complained about this since, it's safe to assume that it's completely unused, hence why I suggest that we just remove this `gulp` task (rather than fixing it).
@Snuffleupagus
Copy link
Collaborator Author

/botio lint

@pdfjsbot
Copy link

pdfjsbot commented Jun 4, 2021

From: Bot.io (Linux m4)


Received

Command cmd_lint from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/5c43b6a2cffcb80/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jun 4, 2021

From: Bot.io (Windows)


Received

Command cmd_lint from @Snuffleupagus received. Current queue size: 0

Live output at: http://3.101.106.178:8877/0acd2b1520e2086/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jun 4, 2021

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/5c43b6a2cffcb80/output.txt

Total script time: 2.48 mins

  • Lint: Passed

@pdfjsbot
Copy link

pdfjsbot commented Jun 4, 2021

From: Bot.io (Windows)


Success

Full output at http://3.101.106.178:8877/0acd2b1520e2086/output.txt

Total script time: 5.19 mins

  • Lint: Passed

@timvandermeij timvandermeij merged commit ce1ed60 into mozilla:master Jun 4, 2021
@timvandermeij
Copy link
Contributor

Looks much better; thank you for fixing this!

@Snuffleupagus Snuffleupagus deleted the issue-10362 branch June 4, 2021 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the Gulpfile
3 participants