Skip to content

Commit 7621e37

Browse files
authored
Use "backend" instead of "server" (#726)
* rename server to backend * rework docs to use backend instead of server * update import * add changelog entry * fix doctree * fix doc ref * rename to sections to "using a custom ..." * move build dir to _client * improve docstring * misc doc fixes - "server" -> "web server" - "Built-in Backends" -> "Native Backends" - spelling mistakes * more minor doc improvements
1 parent e43bcc0 commit 7621e37

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+154
-135
lines changed

.gitignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# --- Build Artifacts ---
2+
src/idom/_client
3+
14
# --- Jupyter ---
25
*.ipynb_checkpoints
36
*Untitled*.ipynb
@@ -37,6 +40,5 @@ pip-wheel-metadata
3740
.vscode
3841

3942
# --- JS ---
40-
4143
node_modules
42-
src/idom/client
44+

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
recursive-include src/idom/client *
1+
recursive-include src/idom/_client *
22
recursive-include src/idom/web/templates *
33
include src/idom/py.typed

docs/app.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from sanic import Sanic, response
66

77
from idom import component
8+
from idom.backend.sanic import Options, configure, use_request
89
from idom.core.types import ComponentConstructor
9-
from idom.server.sanic import Options, configure, use_request
1010

1111
from .examples import get_normalized_example_name, load_examples
1212

docs/source/about/changelog.rst

+5
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ Changed:
4848

4949
- IDOM's client now uses Preact instead of React - :pull:`721`
5050

51+
- Renamed ``idom.server`` to ``idom.backend`` - :pull:`726`
52+
53+
Other references to "server implementations" have been renamed to "backend
54+
implementations" throughout the documentation and code.
55+
5156
Removed:
5257

5358
- ``redirect_root`` server option - :pull:`721`

docs/source/about/contributor-guide.rst

+13-10
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ Still aren't sure what you have to offer? Just :discussion-type:`ask us <questio
3232
we'll help you make your first contribution.
3333

3434

35-
.. note::
36-
37-
If you have any questions during set up or development post on our
38-
:discussion-type:`discussion board <question>` and we'll answer them.
39-
40-
4135
Making a Pull Request
4236
---------------------
4337

@@ -53,21 +47,25 @@ about how to get started. To make a change to IDOM you'll do the following:
5347
You use a ``git clone`` command to copy the code from GitHub to your computer.
5448

5549
`Create a new branch <https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging>`__:
56-
You'll ``git checkout -b your-first-branch`` to create a new space to start your work
50+
You'll ``git checkout -b your-first-branch`` to create a new space to start your work.
5751

5852
:ref:`Prepare your Development Environment <Development Environment>`:
59-
We explain in more detail below how to install all IDOM's dependencies
53+
We explain in more detail below how to install all IDOM's dependencies.
6054

6155
`Push your changes <https://docs.github.com/en/github/using-git/pushing-commits-to-a-remote-repository>`__:
6256
Once you've made changes to IDOM, you'll ``git push`` them to your fork.
6357

58+
:ref:`Create a changelog entry <Creating a changelog entry>`:
59+
Record your changes in the :ref:`changelog` so we can publicize them in the next release.
60+
6461
`Create a Pull Request <https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request>`__:
6562
We'll review your changes, run some :ref:`tests <Running The Tests>` and
6663
:ref:`equality checks <Code Quality Checks>` and, with any luck, accept your request.
6764
At that point your contribution will be merged into the main codebase!
6865

66+
6967
Creating a Changelog Entry
70-
..........................
68+
--------------------------
7169

7270
As part of your pull request, you'll want to edit the `Changelog
7371
<https://github.com/idom-team/idom/blob/main/docs/source/about/changelog.rst>`__ by
@@ -112,6 +110,11 @@ might look like:
112110
Development Environment
113111
-----------------------
114112

113+
.. note::
114+
115+
If you have any questions during set up or development post on our
116+
:discussion-type:`discussion board <question>` and we'll answer them.
117+
115118
In order to develop IDOM locally you'll first need to install the following:
116119

117120
.. list-table::
@@ -120,7 +123,7 @@ In order to develop IDOM locally you'll first need to install the following:
120123
* - What to Install
121124
- How to Install
122125

123-
* - Git_
126+
* - Git
124127
- https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
125128

126129
* - Python >= 3.7

docs/source/guides/adding-interactivity/components-with-state/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ does not work:
2222

2323
Try clicking the button to see that it does not cause a change.
2424

25-
After clicking "Next", if you check the server logs, you'll discover an
25+
After clicking "Next", if you check your web server's logs, you'll discover an
2626
``UnboundLocalError`` error. It turns out that in this case, the ``index = index + 1``
2727
statement is similar to `trying to set global variables
2828
<https://stackoverflow.com/questions/9264763/dont-understand-why-unboundlocalerror-occurs-closure>`__.

docs/source/guides/adding-interactivity/responding-to-events/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Event Data Serialization
100100

101101
Not all event data is serialized. The most notable example of this is the lack of a
102102
``target`` key in the dictionary sent back to the handler. Instead, data which is not
103-
inherhently JSON serializable must be treated on a case-by-case basis. A simple case
103+
inherently JSON serializable must be treated on a case-by-case basis. A simple case
104104
to demonstrate this is the ``currentTime`` attribute of ``audio`` and ``video``
105105
elements. Normally this would be accessible via ``event.target.currentTime``, but here
106106
it's simply passed in under the key ``currentTime``:

docs/source/guides/creating-interfaces/index.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ conditionally display more complex UIs.
4545
Section 1: HTML with IDOM
4646
-------------------------
4747

48-
In a typical Python-base web application the resonsibility of defining the view along
48+
In a typical Python-base web application the responsibility of defining the view along
4949
with its backing data and logic are distributed between a client and server
5050
respectively. With IDOM, both these tasks are centralized in a single place. The most
5151
foundational pilar of this capability is formed by allowing HTML interfaces to be
@@ -112,7 +112,7 @@ Section 3: Rendering Data
112112
The last pillar of knowledge you need before you can start making :ref:`interactive
113113
interfaces <adding interactivity>` is the ability to render sections of the UI given a
114114
collection of data. This will require you to understand how elements which are derived
115-
from data in this way must be orgnized with :ref:`"keys" <Organizing Items With Keys>`.
115+
from data in this way must be organized with :ref:`"keys" <Organizing Items With Keys>`.
116116
One case where we might want to do this is if items in a todo list come from a list of
117117
data that we want to sort and filter:
118118

docs/source/guides/escape-hatches/index.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Escape Hatches
66

77
javascript-components
88
distributing-javascript
9-
writing-your-own-server
10-
writing-your-own-client
9+
using-a-custom-backend
10+
using-a-custom-client
1111

1212
.. note::
1313

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. _Writing Your Own Backend:
2+
.. _Using a Custom Backend:
3+
4+
Using a Custom Backend 🚧
5+
=========================
6+
7+
.. note::
8+
9+
Under construction 🚧
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. _Writing Your Own Client:
2+
.. _Using a Custom Client:
3+
4+
Using a Custom Client 🚧
5+
========================
6+
7+
.. note::
8+
9+
Under construction 🚧

docs/source/guides/escape-hatches/writing-your-own-client.rst

-8
This file was deleted.

docs/source/guides/escape-hatches/writing-your-own-server.rst

-8
This file was deleted.

docs/source/guides/getting-started/_examples/run_fastapi.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# :lines: 11-
22

33
from idom import run
4-
from idom.server import fastapi as fastapi_server
4+
from idom.backend import fastapi as fastapi_server
55

66

77
# the run() function is the entry point for examples
@@ -11,7 +11,7 @@
1111
from fastapi import FastAPI
1212

1313
from idom import component, html
14-
from idom.server.fastapi import configure
14+
from idom.backend.fastapi import configure
1515

1616

1717
@component

docs/source/guides/getting-started/_examples/run_flask.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# :lines: 11-
22

33
from idom import run
4-
from idom.server import flask as flask_server
4+
from idom.backend import flask as flask_server
55

66

77
# the run() function is the entry point for examples
@@ -11,7 +11,7 @@
1111
from flask import Flask
1212

1313
from idom import component, html
14-
from idom.server.flask import configure
14+
from idom.backend.flask import configure
1515

1616

1717
@component

docs/source/guides/getting-started/_examples/run_sanic.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# :lines: 11-
22

33
from idom import run
4-
from idom.server import sanic as sanic_server
4+
from idom.backend import sanic as sanic_server
55

66

77
# the run() function is the entry point for examples
@@ -11,7 +11,7 @@
1111
from sanic import Sanic
1212

1313
from idom import component, html
14-
from idom.server.sanic import configure
14+
from idom.backend.sanic import configure
1515

1616

1717
@component

docs/source/guides/getting-started/_examples/run_starlette.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# :lines: 11-
22

33
from idom import run
4-
from idom.server import starlette as starlette_server
4+
from idom.backend import starlette as starlette_server
55

66

77
# the run() function is the entry point for examples
@@ -11,7 +11,7 @@
1111
from starlette.applications import Starlette
1212

1313
from idom import component, html
14-
from idom.server.starlette import configure
14+
from idom.backend.starlette import configure
1515

1616

1717
@component

docs/source/guides/getting-started/_examples/run_tornado.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# :lines: 11-
22

33
from idom import run
4-
from idom.server import tornado as tornado_server
4+
from idom.backend import tornado as tornado_server
55

66

77
# the run() function is the entry point for examples
@@ -12,7 +12,7 @@
1212
import tornado.web
1313

1414
from idom import component, html
15-
from idom.server.tornado import configure
15+
from idom.backend.tornado import configure
1616

1717

1818
@component

docs/source/guides/getting-started/_static/embed-idom-view/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from sanic.response import file
33

44
from idom import component, html
5-
from idom.server.sanic import Options, configure
5+
from idom.backend.sanic import Options, configure
66

77

88
app = Sanic("MyApp")

docs/source/guides/getting-started/index.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ Section 2: Running IDOM
106106

107107
Once you've :ref:`installed IDOM <Installing IDOM>`, you'll want to learn how to run an
108108
application. Throughout most of the examples in this documentation, you'll see the
109-
:func:`~idom.server.utils.run` function used. While it's convenient tool for development
110-
it shouldn't be used in production settings - it's slow, and could leak secrets through
111-
debug log messages.
109+
:func:`~idom.backend.utils.run` function used. While it's convenient tool for
110+
development it shouldn't be used in production settings - it's slow, and could leak
111+
secrets through debug log messages.
112112

113113
.. idom:: _examples/hello_world
114114

docs/source/guides/getting-started/installing-idom.rst

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
Installing IDOM
22
===============
33

4-
Installing IDOM with ``pip`` will generally require doing so alongside a supported
5-
server implementation. This can be done by specifying an installation extra using square
6-
brackets. For example, if we want to run IDOM using `Starlette
7-
<https://www.starlette.io/>`__ we would run:
4+
You will typically ``pip`` install IDOM to alongside one of it's natively supported
5+
backends. For example, if we want to run IDOM using the `Starlette
6+
<https://www.starlette.io/>`__ backend you would run
87

98
.. code-block:: bash
109
1110
pip install "idom[starlette]"
1211
13-
If you want to install a "pure" version of IDOM without a server implementation you can
14-
do so without any installation extras. You might do this if you wanted to user a server
15-
which is not officially supported or if you wanted to manually pin your dependencies:
12+
If you want to install a "pure" version of IDOM without a backend implementation you can
13+
do so without any installation extras. You might do this if you wanted to :ref:`use a
14+
custom backend <using a custom backend>` or if you wanted to manually pin your
15+
dependencies:
1616

1717
.. code-block:: bash
1818
1919
pip install idom
2020
2121
22-
Officially Supported Servers
23-
----------------------------
22+
Native Backends
23+
---------------
2424

25-
IDOM includes built-in support for a variety web server implementations. To install the
25+
IDOM includes built-in support for a variety backend implementations. To install the
2626
required dependencies for each you should substitute ``starlette`` from the ``pip
2727
install`` command above with one of the options below:
2828

@@ -39,15 +39,15 @@ If you need to, you can install more than one option by separating them with com
3939
pip install "idom[fastapi,flask,sanic,starlette,tornado]"
4040
4141
Once this is complete you should be able to :ref:`run IDOM <Running IDOM>` with your
42-
chosen server implementation.
42+
chosen implementation.
4343

4444

45-
Installing In Other Frameworks
46-
------------------------------
45+
Other Backends
46+
--------------
4747

48-
While IDOM can run in a variety of contexts, sometimes web frameworks require extra work
49-
in order to integrate with them. In these cases, the IDOM team distributes bindings for
50-
various frameworks as separate Python packages. For documentation on how to install and
48+
While IDOM can run in a variety of contexts, sometimes frameworks require extra work in
49+
order to integrate with them. In these cases, the IDOM team distributes bindings for
50+
those frameworks as separate Python packages. For documentation on how to install and
5151
run IDOM in these supported frameworks, follow the links below:
5252

5353
.. raw:: html
@@ -96,8 +96,8 @@ run IDOM in these supported frameworks, follow the links below:
9696
:transparent-text-color:`Plotly Dash`
9797

9898

99-
Installing for Development
100-
--------------------------
99+
For Development
100+
---------------
101101

102102
If you want to contribute to the development of IDOM or modify it, you'll want to
103103
install a development version of IDOM. This involves cloning the repository where IDOM's

0 commit comments

Comments
 (0)