Fix inline if/unless with component args as condition#21380
Fix inline if/unless with component args as condition#21380
Conversation
Agent-Logs-Url: https://github.com/emberjs/ember.js/sessions/eeaec1fb-7e92-497a-9eae-adcc5fbc23b9 Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
📊 Size reportTarball size — dist/dev No changes
dist/prod No changes
smoke-tests/v2-app-hello-world-template/dist No changes
🤖 This report was automatically generated by wyvox/pkg-size |
|
@copilot use strict mode. Follow the example in the issue report more closely. Don't forget linting |
…omponent branch Agent-Logs-Url: https://github.com/emberjs/ember.js/sessions/c9384514-8a79-4fd1-997c-859207137897 Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Done in commit 13ad9c6. The tests now use strict mode with The fix is in Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
{{if @isOk Ok Ko}}in a child component's template (whereOkandKoare components) fails to reactively update when@isOkchanges — while the block form{{#if @isOk}}updates correctly.Root Cause
In
StdAppend,VM_CONTENT_TYPE_OPinstalls anAssertFilterthat only monitors content type changes (component vs string etc.). When@isOkflips, bothOkandKoare components so the type never changes —AssertFilternever firesvm.throw()and no re-render occurs.Changes
Bug fix in
packages/@glimmer/opcode-compiler/lib/opcode-builder/helpers/stdlib.ts: addedVM_ASSERT_SAME_OPto the dynamic Component branch ofStdAppend. This installs anAssertupdating opcode that monitors the specific reference value. When the value changes from one component to another,Assertfiresvm.throw()to trigger a re-render.Regression tests in
updating-test.tsusing strict mode (defineComponent+trackedObj), following the issue report pattern:Tests cover
ifandunlesswith component values, and a@trackedclass property driving the condition through a parent component.