Skip to content

Commit b7f99eb

Browse files
committed
Use official documentation links
1 parent 8e39331 commit b7f99eb

File tree

2 files changed

+3
-24
lines changed

2 files changed

+3
-24
lines changed

apps/website/docs/factories/index.md

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ outline: [2, 3]
66

77
In Effector's world any factory is a function that returns a set of [_Stores_](https://effector.dev/docs/api/effector/store), [_Events_](https://effector.dev/en/api/effector/event/) or [_Effects_](https://effector.dev/docs/api/effector/effect). It's a way to encapsulate some logic and reuse it in different places.
88

9-
If your application has any unit-tests or meant to be rendered on the server (SSR) factories have to be added to `factories` field in config of [`effector/babel-plugin`](https://effector.dev/docs/api/effector/babel-plugin/) or [`@effector/swc-plugin`](https://github.com/effector/swc-plugin). The reasons of this limitation are described in [this article](https://farfetched.pages.dev/recipes/sids.html).
9+
If your application has any unit-tests or meant to be rendered on the server (SSR) factories have to be added to `factories` field in config of [`effector/babel-plugin`](https://effector.dev/docs/api/effector/babel-plugin/) or [`@effector/swc-plugin`](https://effector.dev/en/api/effector/swc-plugin/). The reasons of this limitation are described in [this article](https://effector.dev/en/explanation/sids/).
1010

1111
In real world it is easy to add any third-party library that uses factories to the config because it has an exact import path. But adding factories from your own code is a bit more complicated. There are no automatic ways to validate that all factories are added to the config. This library is solving this problem: just add `@withease/factories` to the config and use it to create and invoke factories.
1212

@@ -32,28 +32,7 @@ npm install @withease/factories
3232

3333
:::
3434

35-
Second, you need to add `@withease/factories` to the config of [`effector/babel-plugin`](https://effector.dev/docs/api/effector/babel-plugin/) or [`@effector/swc-plugin`](https://github.com/effector/swc-plugin):
36-
37-
::: code-group
38-
39-
```json [effector/babel-plugin]
40-
{
41-
"plugins": [["effector/babel-plugin"]]
42-
}
43-
```
44-
45-
```json [@effector/swc-plugin]
46-
{
47-
"$schema": "https://json.schemastore.org/swcrc",
48-
"jsc": {
49-
"experimental": {
50-
"plugins": [["@effector/swc-plugin"]]
51-
}
52-
}
53-
}
54-
```
55-
56-
:::
35+
Second, you need to setup [`effector/babel-plugin`](https://effector.dev/docs/api/effector/babel-plugin/) or [`@effector/swc-plugin`](https://effector.dev/en/api/effector/swc-plugin/). Please follow the instructions in the corresponding documentation.
5736

5837
That's it! Now you can use `@withease/factories` to create and invoke factories across your application.
5938

apps/website/docs/factories/motivation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Let us elaborate on these problems.
99

1010
## Controlling that factories are invoked correctly
1111

12-
In Effector's ecosystem, all factories [have to be added to the code-transformation plugin's config](https://farfetched.pages.dev/recipes/sids.html). But it is really easy to forget to add a factory to the config after creating it. Effector's plugin will not throw an error in this case, but the factory will not work correctly in case of SSR.
12+
In Effector's ecosystem, all factories [have to be added to the code-transformation plugin's config](https://effector.dev/en/explanation/sids/). But it is really easy to forget to add a factory to the config after creating it. Effector's plugin will not throw an error in this case, but the factory will not work correctly in case of SSR.
1313

1414
In case of using this library, you have to remember only one thing: all factories have to be created using `createFactory` function from `@withease/factories` library. The result of this function is not callable, so you will get an error if you try to invoke it directly.
1515

0 commit comments

Comments
 (0)