Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 159 additions & 0 deletions blog/2025-06-25-reflex-080.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
---
author: Alek Petuskey
date: 2025-06-25
title: "Reflex v0.8.0"
description: "Enhanced performance, cleaner architecture, and improved developer experience in Reflex v0.8.0"
image: /blog/reflex-080.webp
meta: [
{"name": "keywords", "content": "reflex v0.8.0, python web framework, react router, performance improvements, breaking changes, migration guide"},
]
---

We're excited to announce the release of Reflex 0.8.0, a significant milestone that brings enhanced performance, cleaner architecture, and improved developer experience to our Python web framework. After extensive testing through multiple alpha releases, this version represents one of our most substantial updates yet.

## The Big Change: From Next.js to React Router

**Reflex 0.8.0 marks a major architectural transformation** as we migrate from Next.js to React Router as our underlying frontend framework. This fundamental change is the driving force behind all the performance improvements and enhanced developer experience in this release.

### Why We Made the Switch

The transition from Next.js to React Router allows us to:

- **Significantly improve development performance** with faster hot reloads and build times
- **Reduce bundle size** and improve runtime performance for your applications
- **Simplify the development workflow** with more predictable behavior
- **Better align with modern single-page application (SPA) patterns**
- **Reduce complexity** in our framework internals

### What This Means for Performance

The React Router migration delivers substantial performance improvements across the board:

- **Faster Hot Module Replacement (HMR)** - Development reloads are now significantly faster
- **Reduced build times** - Your applications compile and deploy more quickly
- **Optimized routing** - Client-side navigation is smoother and more responsive
- **Smaller bundle sizes** - Your applications load faster for end users
- **Improved memory usage** - Better resource management during development and production

### Enhanced Developer Experience

The architectural shift also brings significant developer experience improvements:

- **More predictable behavior** during development with cleaner state management
- **Simplified deployment** with streamlined build processes
- **Better error handling** and debugging capabilities
- **Cleaner environment variable handling** with proper `REFLEX_` prefixing requirements
- **Improved static file handling** and asset management

## Breaking Changes and Deprecation Cleanup

**Important**: Reflex 0.8.0 removes several previously deprecated features. Please review your code before upgrading:

### Removed Deprecated Features

- **`UploadFile.filename`** (deprecated in 0.7.1) - Use `UploadFile.name` instead
- **`App.error_boundary`** (deprecated in 0.7.1) - Use `App.app_wraps`
- **`App.api`** (deprecated in 0.7.9) - Use `api_transformer=your_fastapi_app`
- **`App.add_custom_404_page`** (deprecated in 0.6.7) - Use `add_page` with `/404` route
- **Non-prefixed config environment variables** (deprecated in 0.7.13) - Now require `REFLEX_` prefix
- **Various Gunicorn configuration variables** - Use direct Gunicorn environment flags instead

### Environment Variable Changes

All Reflex configuration environment variables now require the `REFLEX_` prefix:
```bash
# Old (no longer supported)
ENV_FILE=.env

# New (required)
REFLEX_ENV_FILE=.env
```

## Migration Guide

The transition from Next.js to React Router is handled automatically by Reflex, but there are some important steps to ensure a smooth upgrade:

### Automatic Migration

**Good news**: The Next.js to React Router migration is handled automatically by the framework. Your existing Reflex applications will continue to work without code changes in most cases.

### Manual Steps Required

1. **Update your installation:**
```bash
pip install reflex==0.8.0
```

2. **Update environment variables** to use the `REFLEX_` prefix:
```bash
# Old (no longer supported)
ENV_FILE=.env

# New (required)
REFLEX_ENV_FILE=.env
```

3. **Review deprecated features** in your codebase and update accordingly (see breaking changes above)

4. **Test your application thoroughly**, paying special attention to:
- **Routing behavior** - navigation between pages
- **File upload functionality** - update any `UploadFile.filename` usage
- **Custom 404 pages** - migrate to the new `add_page` method
- **Environment variable usage** - ensure all use the `REFLEX_` prefix

5. **Clean rebuild** (recommended):
```bash
reflex clean
reflex init # if prompted
reflex run
```

### Performance Validation

After upgrading, you should notice:
- Faster development server startup
- Quicker hot reloads during development
- Improved build times
- More responsive application performance

## Community Testing and Feedback

This release benefited greatly from our community's participation in the alpha testing program. Through versions 0.8.0a1 through 0.8.0a4, developers provided valuable feedback that helped us identify and resolve issues before the stable release.

Special thanks to all community members who participated in testing and reported issues through [our GitHub discussions](https://github.com/orgs/reflex-dev/discussions/5450).

## Looking Ahead

Reflex 0.8.0 sets the foundation for exciting future developments. We're continuing to focus on:

- Enhanced performance optimizations
- Expanded component library
- Better integration with modern web development tools
- Improved documentation and developer resources

## Get Started Today

Ready to try Reflex 0.8.0? Here's how to get started:

```bash
pip install reflex==0.8.0
reflex init my-app
cd my-app
reflex run
```

For detailed documentation, examples, and migration guides, visit our [official documentation](https://reflex.dev/docs).

## Support and Community

If you encounter any issues with the upgrade or have questions about new features:

- Report bugs on our [GitHub repository](https://github.com/reflex-dev/reflex)
- Join discussions in our [community forum](https://github.com/orgs/reflex-dev/discussions)
- Check our documentation for detailed guides and examples

---

Reflex 0.8.0 represents our commitment to making Python web development more accessible, performant, and enjoyable. We're excited to see what you'll build with these new capabilities!

*The Reflex Team*
207 changes: 207 additions & 0 deletions docs/hosting/databricks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
```python exec
import reflex as rx
from pcweb.styles.styles import get_code_style, cell_style

```

# Deploying Reflex to Databricks

This guide walks you through deploying a Reflex web application on Databricks using the Apps platform.

## Prerequisites

- Databricks workspace with Unity Catalog enabled
- GitHub repository containing your Reflex application
- Reflex Enterprise license (for single-port deployment)

## Step 1: Connect Your Repository

1. **Link GitHub Repository**
- Navigate to your Databricks workspace
- Go to your user directory
- Click **Create** → **Git folder**
- Paste the URL of your GitHub repository containing the Reflex application

## Step 2: Configure Application Settings

### Create Configuration File

Create a new file called `app.yaml` directly in Databricks (not in GitHub):

```yaml
command: [
"reflex",
"run",
"--env",
"prod",
"--backend-port",
"$DATABRICKS_APP_PORT"
]

env:
- name: "HOME"
value: "/tmp/reflex"
- name: "REFLEX_ACCESS_TOKEN"
value: "your-token-here"
- name: "DATABRICKS_WAREHOUSE_ID"
valueFrom: "sql_warehouse"
- name: "DATABRICKS_CATALOG"
value: "your-catalog-name"
- name: "DATABRICKS_SCHEMA"
value: "your-schema-name"
- name: "SHOW_BUILT_WITH_REFLEX"
value: 0
```

### Obtain Required Tokens

1. **Reflex Access Token**
- Visit [Reflex Cloud Tokens](https://cloud.reflex.dev/tokens/)
- Navigate to Account Settings → Tokens
- Create a new token and copy the value
- Replace `your-token-here` in the configuration

2. **Databricks Resources**
- Update `DATABRICKS_CATALOG` with your target catalog name
- Update `DATABRICKS_SCHEMA` with your target schema name

## Step 3: Enable Single-Port Deployment

Update your Reflex application for Databricks compatibility:

### Update rxconfig.py

```python
import reflex as rx
import reflex_enterprise as rxe

rxe.Config(app_name="your-app-name", use_single_port=True)
```

### Update Application Entry Point

Modify your main application file where you define `rx.App`:

```python
import reflex_enterprise as rxe

app = rxe.App(
# your app configuration
)
```

Also remember to add `reflex-enterprise` to your `requirements.txt` file.

## Step 4: Create Databricks App

1. **Navigate to Apps**
- Go to **Compute** → **Apps**
- Click **Create App**

2. **Configure Application**
- Select **Custom App**
- Configure SQL warehouse for your application

## Step 5: Set Permissions

### Catalog Permissions

1. Navigate to **Catalog** → Select your target catalog
2. Go to **Permissions**
3. Add the app's service principal user
4. Grant the following permissions:
- **USE CATALOG**
- **USE SCHEMA**

### Schema Permissions

1. Navigate to the specific schema
2. Go to **Permissions**
3. Grant the following permissions:
- **USE SCHEMA**
- **EXECUTE**
- **SELECT**
- **READ VOLUME** (if required)

## Step 6: Deploy Application

1. **Initiate Deployment**
- Click **Deploy** in the Apps interface
- When prompted for the code path, provide your Git folder path or select your repository folder

2. **Monitor Deployment**
- The deployment process will begin automatically
- Monitor logs for any configuration issues

## Updating Your Application

To deploy updates from your GitHub repository:

1. **Pull Latest Changes**
- In the deployment interface, click **Deployment Source**
- Select **main** branch
- Click **Pull** to fetch the latest changes from GitHub

2. **Redeploy**
- Click **Deploy** again to apply the updates

## Configuration Reference

```python eval
rx.table.root(
rx.table.header(
rx.table.row(
rx.table.column_header_cell("Environment Variable"),
rx.table.column_header_cell("Description"),
rx.table.column_header_cell("Example"),
),
),
rx.table.body(
rx.table.row(
rx.table.cell(rx.code("HOME")),
rx.table.cell("Application home directory"),
rx.table.cell(rx.code("/tmp/reflex")),
),
rx.table.row(
rx.table.cell(rx.code("REFLEX_ACCESS_TOKEN")),
rx.table.cell("Authentication for Reflex Cloud"),
rx.table.cell(rx.code("rx_token_...")),
),
rx.table.row(
rx.table.cell(rx.code("DATABRICKS_WAREHOUSE_ID")),
rx.table.cell("SQL warehouse identifier"),
rx.table.cell("Auto-assigned"),
),
rx.table.row(
rx.table.cell(rx.code("DATABRICKS_CATALOG")),
rx.table.cell("Target catalog name"),
rx.table.cell(rx.code("main")),
),
rx.table.row(
rx.table.cell(rx.code("DATABRICKS_SCHEMA")),
rx.table.cell("Target schema name"),
rx.table.cell(rx.code("default")),
),
rx.table.row(
rx.table.cell(rx.code("SHOW_BUILT_WITH_REFLEX")),
rx.table.cell("Show Reflex branding (Enterprise only)"),
rx.table.cell([rx.code("0"), " or ", rx.code("1")]),
),
),
variant="surface",
margin_y="1em",
)
```

## Troubleshooting

- **Permission Errors**: Verify that all catalog and schema permissions are correctly set
- **Port Issues**: Ensure you're using `$DATABRICKS_APP_PORT` and single-port configuration
- **Token Issues**: Verify your Reflex access token is valid and properly configured
- **Deployment Failures**: Check the deployment logs for specific error messages

## Notes

- Single-port deployment requires Reflex Enterprise
- Configuration must be created directly in Databricks, not pushed from GitHub
- Updates require manual pulling from the deployment interface
5 changes: 4 additions & 1 deletion pcweb/components/docpage/sidebar/sidebar_items/learn.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,10 @@ def get_sidebar_items_hosting():
create_item("CLI Reference", children=cloud_cliref.pages),
create_item(
"Self Hosting",
children=[hosting.self_hosting],
children=[
hosting.self_hosting,
hosting.databricks,
],
),
]
return items
Expand Down