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

refactor(build): Make Document.findAll() asynchronous #8302

Merged
merged 2 commits into from
Mar 6, 2023

Conversation

queengooborg
Copy link
Collaborator

@queengooborg queengooborg commented Feb 24, 2023

This changes the findAll() function to an asynchronous function to help improve performance.

This changes the `findAll()` function to an asynchronous function to help improve performance.

Partial fix to mdn#8301.
@github-actions github-actions bot added the markdown markdown related issues and pull requests label Feb 24, 2023
@caugner
Copy link
Contributor

caugner commented Feb 24, 2023

@queengooborg Something's not right here:

FAIL testing/tests/destructive.test.ts (8.328 s)
  ● fixing flaws › can be run in dry-run mode

    expect(received).toContain(expected) // indexOf

    Expected substring: "web/fixable_flaws/bad_pre_tags"
    Received string:    "Would modify \"/tmp/b7c3ee96e90472f73dd8e093d510da2d/content/files/en-us/web/fixable_flaws/index.html\" from fixable flaws."

      100 |       .filter((line) => regexPattern.test(line));
      101 |     expect(dryRunNotices).toHaveLength(4);
    > 102 |     expect(dryRunNotices[0]).toContain(path.join(pattern, "bad_pre_tags"));
          |                              ^
      103 |     expect(dryRunNotices[1]).toContain(path.join(pattern, "deprecated_macros"));
      104 |     expect(dryRunNotices[2]).toContain(path.join(pattern, "images"));
      105 |     expect(dryRunNotices[3]).toContain(pattern);

      at Object.toContain (tests/destructive.test.ts:102:30)

@queengooborg
Copy link
Collaborator Author

Odd that going async changed the order up, but it's now in an order I would expect anyways (and seems to be consistent as well), so a quick fix of the test did the trick!

@queengooborg queengooborg changed the title perf(build): Make Document.findAll() asynchronous refactor(build): Make Document.findAll() asynchronous Feb 25, 2023
Copy link
Contributor

@caugner caugner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested locally.

@caugner caugner merged commit d2abaad into mdn:main Mar 6, 2023
@queengooborg queengooborg deleted the Document-findAll-async branch March 6, 2023 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
markdown markdown related issues and pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants