Skip to content

fix: backward compatability for did-update#92

Open
aklkv wants to merge 1 commit intoemberjs:masterfrom
aklkv:fix/compat-layer
Open

fix: backward compatability for did-update#92
aklkv wants to merge 1 commit intoemberjs:masterfrom
aklkv:fix/compat-layer

Conversation

@aklkv
Copy link
Copy Markdown
Contributor

@aklkv aklkv commented Apr 13, 2026

as part of modernization I broke compatibility layer on did-update, this adds it back in self contained way

@aklkv aklkv force-pushed the fix/compat-layer branch from 9fee911 to e7fadc4 Compare April 13, 2026 09:47
Copy link
Copy Markdown
Contributor

@NullVoxPopuli NullVoxPopuli left a comment

Choose a reason for hiding this comment

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

Don't we want the original macro conditions?

const untrack = (function () {
  if (macroCondition(dependencySatisfies('ember-source', '> 3.27.0-beta.1'))) {
    // ember-source@3.27 shipped "real modules" by default, so we can just use
    // importSync to get @glimmer/validator directly
    return importSync('@glimmer/validator').untrack;
  } else if (
    macroCondition(dependencySatisfies('ember-source', '>= 3.22.0-alpha.1'))
  ) {
    // we can access `window.Ember` here because it wasn't deprecated until at least 3.27
    // eslint-disable-next-line no-undef
    return Ember.__loader.require('@glimmer/validator').untrack;
  } else {
    // nothing needed here, we do not call `untrack` in this case
  }
})();

@aklkv
Copy link
Copy Markdown
Contributor Author

aklkv commented Apr 13, 2026

yeah my thought was the same initially but I re-tested the original macro path and confirmed it still fails at runtime in the consumer (same DidUpdateModifier tracking assertion Assertion Failed: You attempted to update '...' on '...', but it had already been used previously in the same computation.), even though the build warning is gone; the runtime capability-based resolver is the only variant that fixed the real regression in practice.

@aklkv aklkv force-pushed the fix/compat-layer branch from e7fadc4 to bb73339 Compare April 13, 2026 18:17
@aklkv aklkv requested a review from NullVoxPopuli April 14, 2026 20:34
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