Update mck89/peast composer dependency to 1.15.2

Created on 14 July 2023, 12 months ago
Updated 17 July 2023, 11 months ago

Problem/Motivation

Drupal's core dependency mck89/peast have a bug which was fixed in 1.15.2. This affects Drupal JsOptimizer which is used for JavaScript aggregation and optimization. Before that version async functions were compressed without async keyword which break aggregated JS file completely if such function rely on that (e.g. use await).

Upstream issue https://github.com/mck89/peast/issues/58

Steps to reproduce

Foo = {
  async bar() {},
  baz: async () => {},
}

Expects to be Foo={async bar(){},baz:async()=>{}}; but Foo={bar(){},baz:async()=>{}}; provided.

bar() lost its async prefix and any await inside will lead to JS error and break aggregated JS file completely.

Proposed resolution

This was fixed in 1.15.2 version. We need to udpate dependency for Drupal core.

📌 Task
Status

Fixed

Version

10.1 ✨

Component
Javascript  →

Last updated about 11 hours ago

  • Maintained by
  • 🇬🇧United Kingdom @justafish
  • 🇫🇷France @nod_
Created by

🇷🇺Russia Niklan Russia, Perm

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Niklan
  • 🇷🇺Russia Niklan Russia, Perm
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MariaDB 10.3.22
    last update 12 months ago
    29,438 pass, 1 fail
  • 🇬🇧United Kingdom catch

    That is probably a bug in Peast https://github.com/mck89/peast

  • Status changed to Needs review 12 months ago
  • last update 12 months ago
    29,446 pass
  • 🇷🇺Russia Niklan Russia, Perm

    Seems like it was fixed and available in Peast 1.15.2 release. So I think we have to update this issue to reflect that.

    Not sure if we should keep provided test, because it tests third-party library, actually.

    P.s. I'm not certain about bumping minimal version, but it sounds reasonable, because otherwise it can break aggregation.

  • 🇫🇷France andypost

    Can you add a unit test to prevent regressions in future, that's a bug

  • 🇷🇺Russia Chi

    I think there is no need to create tests for third party packages. If this functionality is critical it's better to submit the test to upstream project.

  • Status changed to RTBC 12 months ago
  • 🇳🇱Netherlands Spokje

    I agree with @Chi on this one (sorry @andypost), let's see what core committers think.

  • 🇬🇧United Kingdom catch

    Peast added their own test coverage so I think it's very unlikely to regress.

    What we could maybe do if we wanted to would be to change the content of another existing test file for that test class, to include the syntax here (since they don't have any particular syntax in, just whitespace to strip) - then we'd be covering this bug without actually adding more tests to maintain overall.

    I will aim to commit this early next week either way so that it definitely lands in the next patch release. Very good find and also extremely encouraging that Peast fixed it within half a day of us opening the issue.

    • catch → committed bf041f4c on 10.1.x
      Issue #3374660 by Niklan, catch, andypost, Chi, Spokje: Update mck89/...
    • catch → committed 8f2d25b6 on 11.x
      Issue #3374660 by Niklan, catch, andypost, Chi, Spokje: Update mck89/...
  • 🇳🇱Netherlands Spokje

    @catch: Could it be that this issue, due to the new non-auto-checkbox-for-credit-checking on d.o. doesn't have the credits which you would expect from reading the commit message?

    I really don't need the credit, but I feel at the very least Niklan should get one for reporting the issue here, writing a fail test and commenting on the peast issue.

  • Status changed to Fixed 11 months ago
  • 🇬🇧United Kingdom catch

    The MR diff didn't cleanly apply to 11.x, I also noticed that it increased the minimum Peast version in composer.json.

    So I did the update locally - Peast still updated to the latest version, but without the composer.json change.

    Committed/pushed to 11.x and cherry-picked to 10.1.x, thanks!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024