Skip to content

Commit

Permalink
Improve docs about code transformations
Browse files Browse the repository at this point in the history
  • Loading branch information
igorkamyshev committed Sep 29, 2023
1 parent 28aa6c2 commit 102790c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/website/docs/recipes/vite.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Vite

:::info
Farfetched does not require any special configuration for Vite for basic usage. However, if you want to use advanced features like [`cache`](/api/operators/cache) or [SSR](/recipes/ssr), you need to configure Vite. Detailed explanation of the reasons is available in [deep-dive article](/recipes/sids).
Farfetched does not require any special configuration for Vite for basic usage. However, if you want to use advanced features like [`cache`](/api/operators/cache) or [server-side rendering](/recipes/ssr), you need to configure Vite. Detailed explanation of the reasons is available in [deep-dive article](/recipes/sids).
:::

[Vite](https://vitejs.dev/) uses ESBuild under the hood, which does not allow to use its internal AST in the plugins. To apply custom transformations to the code one must use either [Babel](https://github.com/owlsdepartment/vite-plugin-babel) or [SWC](https://github.com/egoist/unplugin-swc), which are allowing custom AST-transformations.
Expand Down
4 changes: 4 additions & 0 deletions apps/website/docs/shared/sids_plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Read more about `effector/babel-plugin` configuration in the [Effector's documen

**SWC plugin**

::: warning
Note that [plugins for SWC are experimental](https://github.com/swc-project/swc/discussions/3540) and may not work as expected. We recommend to stick with Babel for now.
:::

[SWC](https://swc.rs) is a blazing fast alternative to Babel. If you are using it, you can install `@effector/swc-plugin` to get the same DX as with Babel.

::: code-group
Expand Down
2 changes: 1 addition & 1 deletion apps/website/docs/tutorial/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Actually, that is all what you need to start, but consider installing one of the

## Additional tools

For some advanced usage, like [writing tests](/recipes/testing) and [server-side rendering](/recipes/ssr), Farfetched requires a few code transformations. You can write it by hands, but it is a boring job that you can forward to a machine. Effector's ecosystem provides a few tools to help you with that.
For some advanced usage, like [`cache`](/api/operators/cache) or [server-side rendering](/recipes/ssr), Farfetched requires a few code transformations. You can write it by hands, but it is a boring job that you can forward to a machine. Effector's ecosystem provides a few tools to help you with that.

<!--@include: ../shared/sids_plugins.md-->

Expand Down

0 comments on commit 102790c

Please sign in to comment.