Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Tags: effector/reflect

Tags

v10.1.0

Toggle v10.1.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix: address mapProps review points (#1-#4, B1, B2) (#103)

Follow-up to PR #102 (mapProps feature). Addresses all review points:

#1 — Runtime tests added for variant, list, createReflect (no-ssr + ssr).
      Previously only reflect had mapProps coverage.
#2 — Unknown mapProps keys now error at the key site itself, not on fn's
      return. MapPropsFromSources resolves unknown-key entries to never,
      producing a TS2322 at the key line. Replaces the old
      'K extends keyof Props ? Props[K] : never' fn-return approach that
      had a silent-failure path (never-returning fn compiled cleanly).
#3 — Documented the Store<any> variable-source widening limitation.
      Type tests (3a positive, 3b widening) pin the current behavior.
#4 — fn is skipped when its key is overridden by an external prop.
      'if (key in props) continue' in src/core/reflect.ts. Spy assertions
      in reflect and createReflect tests verify fn is not called.
B1 — bind + mapProps key collision is now a type error. MapPropsFromSources
      takes Bind as a type parameter; a key in both bind and mapProps
      resolves to never. Runtime skip ('if (key in storeProps) continue')
      is a defense-in-depth for JS/type-bypass scenarios (covers stores;
      events/data/functions are covered by the type fix).
B2 — mapItem + mapProps key collision in list is a type error. MapItem's
      mapped type now omits keyof Sources alongside keyof Bind. Partial:
      bypassable with explicit item-parameter annotation (known TS
      limitation with mapped-type extends constraints), documented in the
      type-test comment.

All four operators (reflect, createReflect, list, variant) are covered
by the type fixes and runtime tests.

Docs updated in docs/pages/docs/reflect.mdx:
- mapProps keys must be props of the view; unknown keys error at the key
- a key must not appear in both bind and mapProps
- in list, a key must not appear in both mapItem and mapProps
- source should be an inline literal for best inference
- fn is not invoked when its key is overridden

80 runtime tests + type tests pass.

v10.0.3

Toggle v10.0.3's commit message

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
ci: include over exclude fields for dist/package.json

v10.0.2

Toggle v10.0.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix: do not spawn additional stores inside variant (#98)

* fix: do not spawn additional stores inside variant

* less hacky typecasts

* Remove useless typecast

* even less hacky typecast

v10.0.1

Toggle v10.0.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix(types): relax variant behavior on incompatible props (#97)

* fix(types): relax variant behavior on incompatible props

`variant` blocking on "incompatible props" use-case is bad for DX
it only protects against bad spreads, which are antipattern anyway

* Support more edge-cases

* Update type tests

v10.0.0

Toggle v10.0.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Bump react (#96)

* Bump react

* fix runtime tests

* Fix fromTag types

* Fix types-reflect VFC usage

* Fix types-variant tests

v9.2.0

Toggle v9.2.0's commit message
Cleanup hooks

v9.1.1

Toggle v9.1.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fix store function types (#84)

* Add type tests

* Handle edge-cases

v9.1.0

Toggle v9.1.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
improvement: bind hooks' callbacks to a scope (#82)

* fix: function and variable declarations to be more correct

* test: hooks calls in a scope

* improvement: unify a way to declare type

* improvement: bind hooks' callbacks to be fired in a scope

---------

Co-authored-by: ivan posokhin <i.posokhin@redmadrobot.com>

v9.0.0

Toggle v9.0.0's commit message
Fix publish

v8.4.0

Toggle v8.4.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Allow effector 23 (#78)

Morty Proxy This is a proxified and sanitized view of the page, visit original site.