You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/learn/add-react-to-an-existing-project.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -46,16 +46,16 @@ First, install ReactPy, Starlette, and your preferred ASGI webserver.
46
46
47
47
Next, configure your ASGI framework to use ReactPy's Jinja2 template tag. The method for doing this will vary depending on the ASGI framework you are using. Below is an example that follow's [Starlette's documentation](https://www.starlette.io/templates/):
48
48
49
+
!!! abstract "Note"
50
+
51
+
The `ReactPyJinja` extension enables a handful of [template tags](../reference/jinja.md) that allow you to render ReactPy components in your templates. The `component` tag is used to render a ReactPy SSR component, while the `pyscript_setup` and `pyscript_component` tags can be used together to render CSR components.
52
+
49
53
```python linenums="0" hl_lines="6 11 17"
50
54
{% include "../../examples/add_react_to_an_existing_project/asgi_configure_jinja.py"%}
51
55
```
52
56
53
57
Now you will need to wrap your existing ASGI application with ReactPy's middleware, define the dotted path to your root components, and render your components in your existing HTML templates.
54
58
55
-
!!! abstract "Note"
56
-
57
-
The `ReactPyJinja` extension enables a handful of [template tags](/reference/templatetags/) that allow you to render ReactPy components in your templates. The `component` tag is used to render a ReactPy SSR component, while the `pyscript_setup` and `pyscript_component` tags can be used together to render CSR components.
Copy file name to clipboardExpand all lines: docs/src/learn/creating-a-react-app.md
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ These standalone executors are the easiest way to get started with ReactPy, as t
20
20
21
21
In order to serve the initial HTML page, you will need to run a server. The ASGI examples below use [Uvicorn](https://www.uvicorn.org/), but you can use [any ASGI server](https://github.com/florimondmanca/awesome-asgi#servers).
22
22
23
-
Executors on this page can either support client-side rendering ([CSR](https://developer.mozilla.org/en-US/docs/Glossary/CSR)) or server-side rendering ([SSR](https://developer.mozilla.org/en-US/docs/Glossary/SSR))
23
+
Executors on this page can either support client-side rendering ([CSR](https://developer.mozilla.org/en-US/docs/Glossary/CSR)) or server-side rendering ([SSR](https://developer.mozilla.org/en-US/docs/Glossary/SSR)).
24
24
25
25
### Running via ASGI SSR
26
26
@@ -93,3 +93,7 @@ Support for WSGI executors is coming in a [future version](https://github.com/re
93
93
### Running via WSGI CSR
94
94
95
95
Support for WSGI executors is coming in a [future version](https://github.com/reactive-python/reactpy/issues/1260).
96
+
97
+
### Running as a native app
98
+
99
+
Support for native apps (iO, Android, Windows, etc.) is coming in a [future version](https://github.com/reactive-python/reactpy/issues/570).
Copy file name to clipboardExpand all lines: docs/src/learn/editor-setup.md
+12-27Lines changed: 12 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -17,54 +17,39 @@ A properly configured editor can make code clearer to read and faster to write.
17
17
18
18
Other popular text editors used in the React community include:
19
19
20
-
-[WebStorm](https://www.jetbrains.com/webstorm/) is an integrated development environment designed specifically for JavaScript.
21
20
-[Sublime Text](https://www.sublimetext.com/) has support for [syntax highlighting](https://stackoverflow.com/a/70960574/458193) and autocomplete built in.
22
21
-[Vim](https://www.vim.org/) is a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as "vi" with most UNIX systems and with Apple OS X.
23
22
24
23
## Recommended text editor features
25
24
26
25
Some editors come with these features built in, but others might require adding an extension. Check to see what support your editor of choice provides to be sure!
27
26
28
-
### Python Linting
27
+
### Linting
29
28
30
-
Linting is the process of running a program that will analyse code for potential errors. [Flake8](https://flake8.pycqa.org/en/latest/) is a popular, open source linter for Python.
29
+
Linting is the process of running a program that will analyse code for potential errors. [Ruff](https://docs.astral.sh/ruff/) is Reactive Python's linter of choice due to its speed and configurability. Additionally, we recommend using [Pyright](https://microsoft.github.io/pyright/) as a performant type checker for Python.
31
30
32
-
-[Install Flake8](https://flake8.pycqa.org/en/latest/#installation) (be sure you have [Python installed!](https://www.python.org/downloads/))
33
-
-[Integrate Flake8 in VSCode with the official extension](https://marketplace.visualstudio.com/items?itemName=ms-python.flake8)
34
-
-[Install Reactpy-Flake8](https://pypi.org/project/reactpy-flake8/) to lint your ReactPy code
31
+
Be sure you have [Python installed](https://www.python.org/downloads/) before you proceed!
35
32
36
-
### JavaScript Linting
37
-
38
-
You typically won't use much JavaScript alongside ReactPy, but there are still some cases where you might. For example, you might want to use JavaScript to fetch data from an API or to add some interactivity to your app.
39
-
40
-
In these cases, it's helpful to have a linter that can catch common mistakes in your code as you write it. [ESLint](https://eslint.org/) is a popular, open source linter for JavaScript.
41
-
42
-
-[Install ESLint with the recommended configuration for React](https://www.npmjs.com/package/eslint-config-react-app) (be sure you have [Node installed!](https://nodejs.org/en/download/current/))
43
-
-[Integrate ESLint in VSCode with the official extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
44
-
45
-
**Make sure that you've enabled all the [`eslint-plugin-react-hooks`](https://www.npmjs.com/package/eslint-plugin-react-hooks) rules for your project.** They are essential and catch the most severe bugs early. The recommended [`eslint-config-react-app`](https://www.npmjs.com/package/eslint-config-react-app) preset already includes them.
33
+
-[Install Ruff using the VSCode extension](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff) or the [standalone package](https://docs.astral.sh/ruff/installation/).
34
+
-[Install Pyright using the VSCode extension](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance) or the [standalone package](https://microsoft.github.io/pyright/#/installation).
46
35
47
36
### Formatting
48
37
49
-
The last thing you want to do when sharing your code with another contributor is get into an discussion about [tabs vs spaces](https://www.google.com/search?q=tabs+vs+spaces)! Fortunately, [Prettier](https://prettier.io/) will clean up your code by reformatting it to conform to preset, configurable rules. Run Prettier, and all your tabs will be converted to spaces—and your indentation, quotes, etc will also all be changed to conform to the configuration. In the ideal setup, Prettier will run when you save your file, quickly making these edits for you.
38
+
The last thing you want to do when sharing your code with another contributor is get into an discussion about [tabs vs spaces](https://www.google.com/search?q=tabs+vs+spaces)! Fortunately, [Ruff](https://docs.astral.sh/ruff/) will clean up your code by reformatting it to conform to preset, configurable rules. Run Ruff, and all your tabs will be converted to spaces—and your indentation, quotes, etc will also all be changed to conform to the configuration. In the ideal setup, Ruff will run when you save your file, quickly making these edits for you.
50
39
51
-
You can install the [Prettier extension in VSCode](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) by following these steps:
40
+
You can install the [Ruff extension in VSCode](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff) by following these steps:
52
41
53
42
1. Launch VS Code
54
43
2. Use Quick Open, press ++ctrl+p++
55
-
3. Paste in `ext install esbenp.prettier-vscode`
44
+
3. Paste in `ext install charliermarsh.ruff`
56
45
4. Press Enter
57
46
58
-
#### Formatting on save
47
+
**Formatting on save**
59
48
60
49
Ideally, you should format your code on every save. VS Code has settings for this!
61
50
62
51
1. In VS Code, press ++ctrl+shift+p++
63
-
2. Type "settings"
52
+
2. Type "workspace settings"
64
53
3. Hit Enter
65
-
4. In the search bar, type "format on save"
66
-
5. Be sure the "format on save" option is ticked!
67
-
68
-
!!! abstract "Note"
69
-
70
-
If your ESLint preset has formatting rules, they may conflict with Prettier. We recommend disabling all formatting rules in your ESLint preset using [`eslint-config-prettier`](https://github.com/prettier/eslint-config-prettier) so that ESLint is _only_ used for catching logical mistakes. If you want to enforce that files are formatted before a pull request is merged, use [`prettier --check`](https://prettier.io/docs/en/cli.html#--check) for your continuous integration.
|[ReactPy Router](https://reactive-python.github.io/reactpy-router/)| URL router for ReactPy to help you build single-page applications. |
14
+
|[ReactPy Django](https://reactive-python.github.io/reactpy-django/)| A Django integration for ReactPy. Comes with several Django-exclusive features. |
15
+
16
+
## Third party packages
17
+
18
+
There are also a number of third-party packages that can help you build your projects.
19
+
20
+
You can find a list of these packages on the [ReactPy GitHub Discussions](https://github.com/reactive-python/reactpy/discussions/categories/third-party-packages).
0 commit comments