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

Break eager cycle for "deprecate" function #20714

Merged
merged 1 commit into from
Jul 11, 2024
Merged

Break eager cycle for "deprecate" function #20714

merged 1 commit into from
Jul 11, 2024

Commits on Jul 5, 2024

  1. Break eager cycle for "deprecate" function

    There is a module cycle involving `@ember/debug/index` and `@ember/debug/lib/deprecate`, and it's somewhat intentional since both are sharing mutable state with the other that's intended to allow users to replace the implementations.
    
    The cycle wouldn't be a big deal except for the fact that index **eagerly** consumes the `deprecate` function from `lib/deprecate`, which means that if you get unlucky in the evaluation order it just explodes.
    
    There's no need to eagerly consume it. This PR makes the consumption lazy.
    
    In general `export function` is resilient to cycles in a way that `export let` is not. There are a bunch more places in `@ember/debug` that are using `export let` when they should probably be using `export function` instead, especially because these function are supposed to *always* be present (even in prod they are no-ops, not missing).
    ef4 committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    89b6d9c View commit details
    Browse the repository at this point in the history