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

Modernize the TTX driver code #17890

Merged
merged 2 commits into from
Apr 8, 2024

Commits on Apr 5, 2024

  1. Remove the timeout logic from the TTX driver code

    The original `test.py` code, see
    https://github.com/mozilla/pdf.js/blob/c2376e5cea1b3cee89d77e6a4e8b0d9b5b8591be/test/test.py,
    did not have any timeout logic for TTX, but it got introduced when
    `test.py` was ported from Python to JavaScript as `test.js` in
    mozilla@c2376e5#diff-a561630bb56b82342bc66697aee2ad96efddcbc9d150665abd6fb7ecb7c0ab2f.
    
    However, I don't think we've ever actually seen TTX timing out.
    Moreover, back then we used a very old version of TTX and ran the font
    tests on the bots (where a hanging process would block other jobs and
    would require a manual action to fix), so this code was most likely
    only included defensively.
    
    Fortunately, nowadays it should not be necessary anymore because we use
    the most recent version of TTX (which either returns the result or
    errors out, but isn't known to hang on inputs) and we run the font tests
    on GitHub Actions which doesn't block other jobs anymore and also
    automatically times the job out for us in the unlikely event that a hang
    would ever occur.
    
    In short, we can safely remove this logic to simplify the code and to get
    rid of a callback.
    timvandermeij committed Apr 5, 2024
    Configuration menu
    Copy the full SHA
    6406514 View commit details
    Browse the repository at this point in the history
  2. Convert the TTX driver code to promises

    This commit removes the final callbacks in this code by switching to a
    promises-based interface, overall simplifying the code. Moreover, we
    document why we write to files on disk and modernize the code using e.g.
    template strings.
    timvandermeij committed Apr 5, 2024
    Configuration menu
    Copy the full SHA
    ac03d70 View commit details
    Browse the repository at this point in the history