Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update examples for Reflex 0.4.0 #208

Merged
merged 57 commits into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
1090861
clock app update to radix
Jan 19, 2024
278da6d
converting nba app to radix
Jan 19, 2024
ecf9e3f
update dependencies
Jan 23, 2024
a2e8b53
minor clock change
Jan 23, 2024
69f47c8
update for integration testing
Jan 26, 2024
65b5ca7
update for integration testing
Jan 26, 2024
6a471d0
update requirements.txt
Jan 26, 2024
81262c5
basic crud
jackie-pc Feb 5, 2024
e722e93
todo, snake game
jackie-pc Feb 5, 2024
b93c4f3
github stats
jackie-pc Feb 5, 2024
98703da
convert to new name space
Feb 6, 2024
2264889
convert to new radix namespace
Feb 6, 2024
f00f796
color mode yay!
jackie-pc Feb 7, 2024
f36dddf
list / items yay
jackie-pc Feb 7, 2024
86fd847
move old apps to chakra folder
martinxu9 Feb 13, 2024
e8659fe
Merge pull request #203 from reflex-dev/mx/move-old-apps
masenf Feb 13, 2024
f95287d
Merge pull request #198 from reflex-dev/update-clock-app_radix
tgberkeley Feb 13, 2024
fa70c12
update for reflex 0.4.0
Feb 14, 2024
4bfc3c6
Merge remote-tracking branch 'origin/reflex-0.4.0' into jackie-to-radix
masenf Feb 14, 2024
8159958
Move radix converted examples back to top-level
masenf Feb 13, 2024
6a8e76b
Update requirements to use reflex>=0.4.0a1
masenf Feb 13, 2024
06eb317
snakegame: hide the padding buttons
masenf Feb 13, 2024
0ad4313
basic_crud: replace spacing with gap and separator with divider
masenf Feb 13, 2024
7b0f501
todo: fix up styling, use radix colors
masenf Feb 14, 2024
24b8678
Merge pull request #197 from reflex-dev/jackie-to-radix
masenf Feb 14, 2024
b7b97ca
Merge remote-tracking branch 'origin/reflex-0.4.0' into nba_app_radix
Feb 14, 2024
a3e48b7
convert nba radix to nba
Feb 14, 2024
ce26953
final nab changes
Feb 14, 2024
ec94ff3
twitter app in radix
Feb 14, 2024
ca0ce46
updates from martins comments
Feb 14, 2024
dff5dc3
translator app
martinxu9 Feb 14, 2024
08dcd49
clean up rxconfig
martinxu9 Feb 14, 2024
2c59794
dalle app update
martinxu9 Feb 14, 2024
4e16162
Update GPT app to use radix components
masenf Feb 14, 2024
32e6e55
Merge pull request #204 from reflex-dev/twitter-app-radix
martinxu9 Feb 14, 2024
544fd2d
Merge pull request #199 from reflex-dev/nba_app_radix
martinxu9 Feb 14, 2024
966ae00
Merge pull request #193 from reflex-dev/masenf/convert-gpt-to-radix
masenf Feb 14, 2024
cf2f648
review comments
martinxu9 Feb 14, 2024
19e02ad
no need for form.submit
martinxu9 Feb 14, 2024
eb8eb9f
review comments
martinxu9 Feb 14, 2024
3c762b9
Merge pull request #191 from reflex-dev/martinxu9/dalle-update
martinxu9 Feb 14, 2024
1c20ab5
Merge pull request #192 from reflex-dev/martinxu9/translator-update
martinxu9 Feb 14, 2024
7c62a99
Merge remote-tracking branch 'origin/main' into reflex-0.4.0
martinxu9 Feb 14, 2024
89a7246
update CI
martinxu9 Feb 14, 2024
7c92496
use prerelease to unblock CI
martinxu9 Feb 14, 2024
4679f86
clock_radix -> clock
martinxu9 Feb 14, 2024
4223b0d
fix counter test
martinxu9 Feb 14, 2024
6b9ccc0
use a2
martinxu9 Feb 15, 2024
beced6c
Quiz app to radix namespace (#206)
ElijahAhianyo Feb 15, 2024
3c7b90d
upload app to use radix components, hook up progress bar (#202)
jackie-pc Feb 15, 2024
5891aa0
test again
martinxu9 Feb 15, 2024
c50c463
Merge remote-tracking branch 'origin/reflex-0.4.0' into reflex-0.4.0
martinxu9 Feb 15, 2024
591bb8d
bump up pre-release used
martinxu9 Feb 15, 2024
c46134d
Local auth app to radix namespace (#207)
ElijahAhianyo Feb 16, 2024
49ed041
CI: bump workflows to 0.4.0a4
masenf Feb 16, 2024
4b9162d
Use REFLEX_DEP instead of REFLEX_VERSION (#209)
masenf Feb 16, 2024
377bc38
Update to released version 0.4.0
masenf Feb 17, 2024
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
13 changes: 7 additions & 6 deletions .github/workflows/app_harness.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
name: app-harness
env:
REFLEX_VERSION: "==0.3.8"
# TODO: switch to the official release
REFLEX_DEP: 'reflex==0.4.0'
TELEMETRY_ENABLED: false
APP_HARNESS_HEADLESS: 1
on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
workflow_dispatch:
inputs:
reflex_version:
description: "Reflex version"
reflex_dep:
description: 'Reflex dep (raw pip spec)'

jobs:
list-examples-with-tests:
Expand Down Expand Up @@ -50,6 +51,6 @@ jobs:
python -m venv venv
source venv/bin/activate

pip install 'reflex${{ github.event.inputs.reflex_version || env.REFLEX_VERSION }}' -r requirements.txt -r requirements-dev.txt
pip install '${{ github.event.inputs.reflex_dep || env.REFLEX_DEP }}' -r requirements.txt -r requirements-dev.txt
reflex init
pytest tests -vv
17 changes: 9 additions & 8 deletions .github/workflows/check_export.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
name: check-export
env:
REFLEX_VERSION: "==0.3.8"
# TODO: switch to the official release
REFLEX_DEP: 'reflex==0.4.0'
TELEMETRY_ENABLED: false
on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
workflow_dispatch:
inputs:
reflex_version:
description: "Reflex version"
reflex_dep:
description: 'Reflex dep (raw pip spec)'

jobs:
list-examples:
Expand All @@ -24,7 +25,7 @@ jobs:
run: |
# TODO fix sales export
# TODO fix stable_diffusion export (gets stuck)
EXAMPLES="$(find . -not -name '.*' -maxdepth 1 -type d | cut -f2 -d/ | sort | grep -vw sales | grep -vw stable_diffusion | jq -R | jq -s -c)"
EXAMPLES="$(find . -not -name '.*' -maxdepth 1 -type d | cut -f2 -d/ | sort | grep -vw chakra_apps | jq -R | jq -s -c)"
echo $EXAMPLES
echo "examples=$EXAMPLES" >> $GITHUB_OUTPUT

Expand All @@ -43,7 +44,7 @@ jobs:
echo "$f is not a directory!"
exit 1
fi

cd "$f"

if [[ ! -f requirements.txt ]]; then
Expand All @@ -59,7 +60,7 @@ jobs:
python -m venv venv
source venv/bin/activate

pip install 'reflex${{ github.event.inputs.reflex_version || env.REFLEX_VERSION }}' -r requirements.txt
pip install '${{ github.event.inputs.reflex_dep || env.REFLEX_DEP }}' -r requirements.txt
export OPENAI_API_KEY="dummy"
reflex init
reflex export
Expand Down
Binary file modified basic_crud/assets/favicon.ico
Binary file not shown.
71 changes: 37 additions & 34 deletions basic_crud/basic_crud/basic_crud.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Welcome to Reflex! This file outlines the steps to create a basic app."""

import asyncio
import json

Expand Down Expand Up @@ -107,84 +108,86 @@ async def send_query(self):


def data_display():
return rx.chakra.vstack(
rx.chakra.heading(State.total, " products found"),
return rx.vstack(
rx.heading(State.total, " products found"),
rx.foreach(State.products, render_product),
rx.chakra.spacer(),
rx.spacer(),
width="30vw",
height="100%",
)


def render_product(product: Product):
return rx.chakra.hstack(
rx.chakra.image(src=product.image, height="100%", width="3vw"),
rx.chakra.text(f"({product.code}) {product.label}", width="10vw"),
rx.chakra.vstack(
rx.chakra.text("Stock:", product.quantity),
rx.chakra.text("Category:", product.category),
return rx.hstack(
rx.image(src=product.image, height="100%", width="3vw"),
rx.text(f"({product.code}) {product.label}", width="10vw"),
rx.vstack(
rx.text("Stock:", product.quantity),
rx.text("Category:", product.category),
spacing="0",
width="7vw",
),
rx.chakra.vstack(
rx.chakra.text("Seller:", product.seller),
rx.chakra.text("Sender:", product.sender),
rx.vstack(
rx.text("Seller:", product.seller),
rx.text("Sender:", product.sender),
spacing="0",
width="7vw",
),
rx.chakra.spacer(),
rx.spacer(),
border="solid black 1px",
spcaing="5",
width="100%",
)


def query_form():
return rx.chakra.vstack(
rx.chakra.hstack(
rx.chakra.text("Query:"),
rx.chakra.select(
return rx.vstack(
rx.hstack(
rx.text("Query:"),
rx.select(
["GET", "POST", "PUT", "DELETE"],
on_change=QueryState.update_method,
),
rx.chakra.input(
rx.input(
value=QueryState.url_query,
on_change=QueryState.set_url_query,
width="30vw",
),
),
rx.chakra.text("Body:"),
rx.chakra.text_area(
value=QueryState.body, height="30vh", on_change=QueryState.set_body
rx.text("Body:"),
rx.text_area(
value=QueryState.body,
height="20vh",
width="20vh",
on_change=QueryState.set_body,
),
rx.chakra.hstack(
rx.chakra.button("Clear", on_click=QueryState.clear_query),
rx.chakra.button("Send", on_click=QueryState.send_query),
rx.hstack(
rx.button("Clear", on_click=QueryState.clear_query),
rx.button("Send", on_click=QueryState.send_query),
),
rx.chakra.divider(orientation="horizontal", border="solid black 1px", width="100%"),
rx.chakra.hstack(
rx.chakra.text("Status: ", QueryState.response_code), rx.chakra.spacer(), width="100%"
rx.divider(orientation="horizontal", border="solid black 1px", width="100%"),
rx.hstack(
rx.text("Status: ", QueryState.response_code), rx.spacer(), width="100%"
),
rx.chakra.container(
rx.container(
rx.markdown(
QueryState.f_response,
language="json",
height="30vh",
)
),
# width="50vw",
width="100%",
)


def index() -> rx.Component:
return rx.chakra.hstack(
rx.chakra.spacer(),
return rx.hstack(
rx.spacer(),
data_display(),
rx.chakra.spacer(),
rx.chakra.divider(orientation="vertical", border="solid black 1px"),
rx.spacer(),
rx.divider(orientation="vertical", border="solid black 1px"),
query_form(),
rx.chakra.spacer(),
rx.spacer(),
height="100vh",
width="100vw",
spacing="0",
Expand Down
2 changes: 1 addition & 1 deletion basic_crud/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
reflex>=0.3.8
reflex>=0.4.0
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading