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

Ensure waiters are discovered even if multiple versions exist #388

Merged
merged 2 commits into from
Apr 7, 2022

Commits on Apr 5, 2022

  1. Ensure waiters are discovered even if multiple versions exist

    Currently, we rely heavily on the highlander logic to ensure that we can
    **only** ever have one version of `@ember/test-waiters` in the build
    outpu. The reason for this is so that when someone calls
    `hasPendingWaiters()` we can reliably ensure that _**ALL**_ waiters that
    have been registered (regardless of version mismatches and whatnot) are
    found.
    
    Unfortunately, we cannot actually rely on the highlander logic to
    guarantee this "waiter map" uniqueness in Embroider builds (because the
    highlander logic is broken by the isolated nature of Embroiders
    compatibility layer).
    
    This change migrates from a strict reliance on the highlander logic to
    guarantee the module scoped variable is shared globally to a mechanism
    of sharing the state on `globalThis` (with fallbacks for various other
    scenarios). Using this pattern allows us to avoid "caring" if the
    highlander code actually enforces a single version, while still ensuring
    that `hasPendingWaiters` will always return the right value.
    
    It is likely that future changes will remove the usage of the highlander
    logic as of a certain version (that includes this change) and higher.
    rwjblue committed Apr 5, 2022
    Configuration menu
    Copy the full SHA
    11b34dd View commit details
    Browse the repository at this point in the history

Commits on Apr 7, 2022

  1. Update addon/@ember/test-waiters/waiter-manager.ts

    Co-authored-by: Steve Calvert <scalvert@linkedin.com>
    rwjblue and scalvert authored Apr 7, 2022
    Configuration menu
    Copy the full SHA
    1ec412b View commit details
    Browse the repository at this point in the history