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

perf(core/a11y): start loading axe earlier #3372

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sidvishnoi
Copy link
Member

@sidvishnoi sidvishnoi commented Mar 9, 2021

This will start fetching the axe script earlier, giving some performance improvements.
Also, should help in avoiding jasmine timeouts that we often get in CI [^1].

Extracted from https://github.com/w3c/respec/pull/3319

[^1]

  Core — a11y
    ✖ allows overriding options (slow: 5.003 secs)
      Firefox 86.0 (Ubuntu 0.0.0)
    Error: Timeout - Async function did not complete within 5000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL) in node_modules/jasmine-core/lib/jasmine-core/jasmine.js (line 7048)
    <Jasmine>

@@ -43,6 +43,7 @@ function isRunnableModule(plug) {

async function executePreparePass(runnables, config) {
for (const plug of runnables.filter(p => p.prepare)) {
config.state[plug.name] = {};
Copy link
Contributor

@marcoscaceres marcoscaceres Mar 10, 2021

Choose a reason for hiding this comment

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

Hmm... not a fan of attaching more stuff to config. Why not have this as an internal state inside the plugin itself?

Copy link
Member Author

Choose a reason for hiding this comment

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

Plugins can share state among them.
I plan to add a state arg to all functions, but conf.state was easier for starters.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest doing that now... look at what happened with my terrible linter API :( I kept saying, "I'll fix it next week... I'll fix it next week..." and years later, still there 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants