Skip to content

Commit 6be59dd

Browse files
jodarovecaridy
andauthored
fix: adding backward compatibility notes to wire-reform rfc. (#30)
* fix: adding backward compatibility notes to wire-reform rfc. * Update text/0000-wire-reform.md Co-Authored-By: Caridy Patiño <caridy@gmail.com> * Update text/0000-wire-reform.md Co-Authored-By: Caridy Patiño <caridy@gmail.com> * Update text/0000-wire-reform.md Co-Authored-By: Caridy Patiño <caridy@gmail.com> Co-authored-by: Caridy Patiño <caridy@gmail.com>
1 parent 0e95f14 commit 6be59dd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

text/0000-wire-reform.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ There exist a few restrictions and ambiguities with the IDL for the config objec
100100
* there will be no identity for inline JSON objects when assigned to a property in the config object, e.g.: `@wire(foo, { x: { y: 1 } })` where the value of `x` will be computed every time, instead of cached per instance or per class as today.
101101
* there will be identity preserved when assigning a reference values in the config object, e.g.: `@wire(foo, { x: someValue })` where the value of `x` will be a reference to `someValue` during the class declaration.
102102
* every time that `adapter.update()` is invoked, a new config object will be provided as a first argument, no identity is preserved in this case.
103+
* `adapter.update()` must be invoked initially regardless of the value of the config. e.g.: `@wire(foo, { x: $foo })` will invoke the update even if `this.foo` resolves to `undefined` or was never set.
104+
* `adapter.update()` will be called when the reactive mechanism detects a mutation on a value that was used to compute the config for a wire declaration, even if result of such computation produces the same config that was produced before. It is a responsibility of the adapter to dedupe such calls.
105+
* the reactive tracking for wire configuration can’t track changes on a wire configuration that depends on component's instance "expandos", it only reacts to changes on class' declared fields.
103106

104107
### Context Provider for Wire Adapters
105108

@@ -244,6 +247,7 @@ export function invokeApex(...args) {
244247
* For adapter author, the wire protocol no longer needs registration, which means it is easier to reason about compared to the existing mechanism.
245248
* The new formalized wire protocol is a lot simpler to reasoning about, and simpler to implement.
246249
* As for existing adapters based on `@lwc/wire-service`, they can remain the same until after they get refactored and simplified when possible.
250+
* Testing components using wire: in the current implementation of the wire protocol, rendering a component that uses an invalid wire adapter (ex: `undefined`) never throws; this implementation will break such tests if the wire adapter mocks are not valid. For platform tests, wire-adapter stubs are provided and they will run fine, but for off-platform tests, a valid adapter needs to be provided.
247251

248252
# Unresolved questions
249253

0 commit comments

Comments
 (0)