Skip to content

Commit

Permalink
Add admonitions for outdated guides and minor corrections (#7635)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored Jan 21, 2025
1 parent 36f4712 commit fa75a03
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions doc/explanation/components/reactive_html_components.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ When you're working on custom applications and dashboards, there are times when

This page will walk you through using the `ReactiveHTML` class to craft custom components without the need for complex JavaScript build tools. You'll be able to leverage basic HTML, CSS, and JavaScript to tailor your components to your specific needs.

:::{admonition} warn
`ReactiveHTML` was the recommended approach for building custom components before so called ESM components were added. Refer to the [custom component how-to guides](../../how_to/custom_components/index) for more details.
:::

## Why Use `ReactiveHTML`?

`ReactiveHTML` empowers you to design and build custom components that seamlessly integrate with your Panel applications. These components can enhance your applications' interactivity and functionality, all while keeping the development process straightforward and free from the complexities of JavaScript build tools.
Expand Down
5 changes: 3 additions & 2 deletions doc/how_to/integrations/FastAPI_Tornado.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Panel generally runs on the Bokeh server which itself runs on Tornado. However,

Following FastAPI's [Tutorial - User Guide](https://fastapi.tiangolo.com/tutorial/) make sure you first have FastAPI installed using: `conda install -c conda-forge fastapi`. Also make sure Panel is installed `conda install -c conda-forge panel`.

:::{admonition} warn
Embedding Panel in a FastAPI server has many drawbacks and shortcomings. We now strongly recommend running Panel directly on a FastAPI server as described in the [FastAPI how-to guide](FastAPI).
:::

## Configuration

Expand All @@ -20,12 +23,10 @@ from fastapi import FastAPI, Request
from fastapi.templating import Jinja2Templates
```


Each of these will be explained as we add them in.

Next we are going to need to create an instance of FastAPI below your imports in `main.py` and set up the path to your templates like so:


```python
app = FastAPI()
templates = Jinja2Templates(directory="examples/apps/fastApi/templates")
Expand Down
4 changes: 2 additions & 2 deletions doc/how_to/migrate/anywidget/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

This guide addresses how to convert [AnyWidget](https://anywidget.dev/) widgets to custom `JSComponent` or `ReactComponent` widgets.

Please note that AnyWidget widgets are [`ipywidgets`](https://ipywidgets.readthedocs.io/en/stable/) and can be used directly in Panel via the [`IpyWidgets`](../../../reference/panes/Image.md) pane and the `Traitlets` `@observe` API without a conversion. We recommend trying this option first. If it does not work for your use case, please consider contributing to the existing `AnyWidget` before converting it to a Panel widget.
Please note that AnyWidget widgets are [`ipywidgets`](https://ipywidgets.readthedocs.io/en/stable/) and can be used directly in Panel via the [`IPyWidgets`](../../../reference/panes/IPyWidget) pane and the `Traitlets` `@observe` API without a conversion. We recommend trying this option first. If it does not work for your use case, please consider contributing to the existing `AnyWidget` before converting it to a Panel widget.

Some reasons you might still want to convert an `AnyWidget` to a custom Panel widget are:

- **Familiar and Optimized API**: This enables you and your users to use the familiar `Param` parameter API for which Panel is optimized.
- **Customization**: You might want to use the `AnyWidget` as a starting point and customize it to your exact needs.
- **Efficiency**: You users avoid loading `AnyWidget`/`ipywidgets` JavaScript libraries which ANECDOTALLY is not insignificant. Your users also avoid the overhead of converting between `Param/Panel/Bokeh` and `Traitlets`/`AnyWidget`/`ipywidgets` objects: ANECDOTALLY, Panel (i.e., Bokeh) utilizes faster serialization and deserialization methods and formats. IS THIS TRUE, PHILIPP? ALSO, WHEN USING THE ANYWIDGET ON THE BOKEH SERVER? DO WE HAVE NUMBERS FOR THIS?
- **Efficiency**: You avoid loading `AnyWidget`/`ipywidgets` JavaScript libraries can add significant overhead.

## Conversion Steps

Expand Down

0 comments on commit fa75a03

Please sign in to comment.