effector / effector/effector

Deprecate `Domain` unit creator methods

Open
#1,051 1 comment 0 reactions 0 assignees View on GitHub
breaking changes core
Dominant language
TypeScript
Stars
4.9k
Forks
280
Avg merge
2d 6h
Merged PRs (30d)
7

Description

As discussed in #590, methods on `Domain` are hard to work with within plugins (both Babel and SWC).

Proposal

Deprecate the following legacy Unit creators on `Domain`:
- `.event` and `.createEvent`
- `.effect` and `.createEffect`
- `.store` and `.createStore`
- `.domain` and `.createDomain`

There has been an alternative way to attach the domain to a unit via argument since [Encke 22.4.0](https://changelog.effector.dev/#effector-encke-22-4-0) (released Nov 5, 2022), so there's been enough time to adopt it.

Additionally, `Domain` methods provide worse DX by default and are inconsistent with the rest of Effector API.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.