Commit Graph

64 Commits

Author SHA1 Message Date
Alek Petuskey
0a8b8a89b4
Benchmarking Updates (#3680)
* Benchmark test

* Lighthouse posthog

---------

Co-authored-by: Alek Petuskey <alekpetuskey@Aleks-MacBook-Pro.local>
2024-07-17 17:15:13 -07:00
Masen Furer
f1dafc0373
pyi_generator cleanup: ruff, remove fully qualified reflex. names (#3591)
* pyi_generator: avoid fully qualified names for reflex. types

The previous method added quite a large line diff to the pyi files, so for now,
lets just add the `Breakpoints` import to the default set along with Var,
EventHandler, Style and others.

* pyi_generator: fix generated files using ruff

also generate updated pyi files in reflex/experimental namespace

* remove black from dev dependencies

* poetry.lock: relock deps

* Update all pyi files with new formatting

* pre-commit fixes

* pyi_generator: fix __init__.pyi files again
2024-06-29 08:48:01 -07:00
Thomas Brandého
0d39237b3c
upgrade to latest ruff (#3497)
* upgrade to latest ruff

* try to fix dep review

* try to fix dep review (2)

* upgrade black

* upgrade black (2)

* update allowed dependencies

* update allowed dependencies (2)

* update allowed dependencies (3)

* wait between interim and final in yield test

* remove previous commit, increase delay between yield

* forgot to save on the time.sleep(1) removal

* fix integration (maybe?)

* fix pyi?

* what even is going on

* what is realityi?

* test another fix for app harness

* try to wait even longer?

* force uvloop to be optional

* downpin fastapi < 0.111, remove changes to test
2024-06-19 12:32:13 +02:00
Masen Furer
fb173908db
Only run pyi_generator on files in reflex/components or reflex/__init__.py (#3452) 2024-06-06 21:31:17 -07:00
Elijah Ahianyo
34bf25071a
[REF-2821]Improve Dynamic Imports (#3345)
* Improve import times

* add lazy loading to rx.el

* add lazy loading to reflex core components

* minor refactor

* Get imports working with reflex web

* get imports to work with all reflex examples

* refactor to define imports only in the root.

* lint

* deadcode remove

* update poetry deps

* unit tests fix

* app_harness fix

* app_harness fix

* pyi file generate

* pyi file generate

* sort pyi order

* fix pyi

* fix docker ci

* rework pyi-generator

* generate pyi for __init__ files

* test pyright

* test pyright ci

* partial pyright fix

* more pyright fix

* pyright fix

* fix pyi_generator

* add rx.serializer and others

* add future annotation import which fixes container CI, then also load recharts lazily

* add new pyi files

* pyright fix

* minor fixes for reflex-web and flexdown

* forward references for py38

* ruff fix

* pyi fix

* unit tests fix

* reduce coverage to 68%

* reduce coverage to 67%

* reduce coverage to 66%as a workaround to coverage's rounding issue

* reduce coverage to 66%as a workaround to coverage's rounding issue

* exclude lazy_loader dependency review checks.

* its lazy-loader

* Add docstrings and regenerate pyi files

* add link

* address Pr comments

* CI fix

* partially address PR comments.

* edit docstrings and fix integration tests

* fix typo in docstring

* pyi fix
2024-05-31 16:43:10 +00:00
Elijah Ahianyo
89a83ecd42
[REF-2803] Add imports benchmarks (#3272) 2024-05-14 23:19:46 -07:00
Elijah Ahianyo
93c4f5024e
Windows Pin Bun version (#3192) 2024-05-01 14:47:03 -07:00
Thomas Brandého
0af4770180
generate pyi files when building/publishing 3rd party component (#2945)
* build pyi files when building/publishing 3rd party

* fix typo in workflow

* add future annotation

* add tests to pass coverage check

* add more unit tests

* omit pyi_generator from test coverage

* change black from dev deps to direct deps

* remake all pyi

* format pyi if black is present, return as if otherwise

* fix requested changes

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-03-29 09:54:21 -07:00
Masen Furer
5510eaf820
[REF-2265] ComponentState: scaffold for copying State per Component instance (#2923)
* [REF-2265] ComponentState: scaffold for copying State per Component instance

Define a base ComponentState which can be used to easily create copies of the
given State definition (Vars and EventHandlers) that are tied to a particular
instance of a Component (returned by get_component)

* Define `State` field on `Component` for typing compatibility.

This is an Optional field of Type[State] and is populated by ComponentState.

* Add integration/test_component_state.py

Create two independent counters and increment them separately

* Add unit test for ComponentState
2024-03-29 09:22:25 -07:00
Elijah Ahianyo
e0fedeb419
[REF-1682][REF-1683][REF-1684][REF-2283]Benchmark reflex package size and .web folder (#2880)
* remove codspeed.yml

* test upload job

* minor edits to get upload job working

* perhaps this works

* upload needs relex-install-size

* retrigger pipeline

* test only on ubuntu

* change to save to db directly

* oops

* size benchmarks

* .web for counter

* its timeout-minutes

* se integration.sh to run and kill process

* install psycopg2

* move .web runs to integration_tests.yml to save runners

* fix measurement-type for reflex-web

* add database url to env

* psycopg2

* test run ids

* commit sha gets the job done

* refactor

* add more matrices

* move reflex package size to integration_test.yml

* fix venv path

* test fix

* test fix

* use hyphen

* testing reflex build size

* ls for temp debug

* fix typo in command

* possible fix

* possible fix for windows

* remove dead code

* remove dead code

* remove unwanted comments

* refactor

* rebase on main

* pr_title

* remove pr_title from args

* debug

* should work now

* precommit fix

* print out package size for

* add shell

* test

* trying again

* dont use cached poetry to have accurate measurement of deps

* remove reflex deps calculation step from integration job

* fix script path

* precommit fix

* no real difference on different python versions so use 3.11.5

* remove ls keyword
2024-03-25 08:33:28 +00:00
Elijah Ahianyo
83318530f2
[REF-2284]Benchmark add extra info on publishing data (#2864)
* Benchmark add extra info on publishing data

* fix typo

* get file name for simplicity

* precommit fix

* removesuffix not in python3.8

* add pr_id in case the pr title is changed

* precommit fix
2024-03-21 07:25:40 +00:00
Martin Xu
f80d7978d2
make PR title optional since push event or PR merge will not have the title (#2889) 2024-03-20 16:38:09 -07:00
Martin Xu
fa99407b81
Handle quote marks ' " in PR titles in benchmark CI (#2877)
* escape double quote marks in PR title

* move the pr title into the env
2024-03-20 11:30:47 -07:00
Elijah Ahianyo
a06b570e3a
Benchmark with app harness (#2774) 2024-03-13 15:59:55 -07:00
Masen Furer
4206afeb7b
[REF-1958] Remove shadowed radix css props (#2590)
* style: shorthand replacements need camelCase

Avoid warning on terminal and in browser console from using kebab-case CSS
props with emotion.

* _rename_props only replace prop name once

In case the value also contains the prop name, we don't want to replace it
multiple times.

* pyi_generator: ignore _rename_props in create signature

* Avoid shadowing CSS prop `display` and `gap`

Replace usages of `gap` with `spacing` to retain Radix sizing number system,
while allowing users to specify a responsive `gap` using CSS units.

Remove `display` props from radix components, allowing `display` to accept
responsive lists.

* checkbox: apply `gap` to `flex` if provided

* Remove _rename_props from .create signatures

* Fix spacing prop in blank template

* Fixup tests after changing style shorthand to return camelCase
2024-02-13 10:06:28 -08:00
Masen Furer
d28109f4c4
Merge remote-tracking branch 'origin/main' into reflex-0.4.0 2024-02-08 11:54:02 -08:00
jackie-pc
a4ee985509
CLI script to maintain Chakra backed components in rx namespace in older apps (#2322) 2024-02-08 11:12:20 -08:00
Masen Furer
f99c48806a
Top-level namespace tweaks (#2523)
* pyi_generator: always ignore files starting with `tests`

* Move CodeBlock out of chakra namespace

* Expose additional names in the top-level namespace

* code pyi fixup

* expose input and quote at the top-level

* add text_field to top-level namespace (maybe)

* fixup chakra code.pyi

* Remove `text_field` from top level namespace

* Remove top-level big C Cond

* fixup top level pyi
2024-02-05 11:14:02 -08:00
Masen Furer
35b20d26b5
Merge remote-tracking branch 'origin/main' into reflex-0.4.0 2024-02-02 08:39:10 -08:00
Nikhil Rao
5176a7cb14
Support component create methods as keys in global styles (#2498) 2024-01-31 12:25:18 -08:00
Masen Furer
4df279b060
Merge remote-tracking branch 'origin/main' into reflex-0.4.0 2024-01-31 12:06:51 -08:00
Masen Furer
a5302f1866
[0.4.0] Namespace the Drawer primitive subcomponents (#2492) 2024-01-31 11:39:13 -08:00
Tianze
a14575009c
Minor fix on path to make it work in Windows (#2494) 2024-01-31 10:00:41 -08:00
Nikhil Rao
27b9a10233 Merge branch 'main' into reflex-0.4.0 2024-01-30 16:48:38 -08:00
Masen Furer
2782c0fe3c
Fix pyi_generator relative path determination (#2485) 2024-01-30 15:03:15 -08:00
Tianze
209c5fab7b
Tabs validate parent is proper tab container (#2463) 2024-01-30 11:45:00 -08:00
Masen Furer
763c1c1f07
pyi_generator: Generate stubs for SimpleNamespace classes
If the namespace assigns `__call__` to an existing component `create` function,
generate args and docstring for IDE integration.
2024-01-29 17:38:58 -08:00
benedikt-bartscher
08524e22aa
pyi generator git diff (#2460) 2024-01-26 14:21:25 -08:00
benedikt-bartscher
4219a78e7c
use multiprocessing to speed up pyi generation (#2453) 2024-01-25 13:46:15 -08:00
Masen Furer
1a50a63b98
Docstrings for radix components (#2407) 2024-01-24 12:39:05 -08:00
benedikt-bartscher
0b1b8ee639
auto enable /_upload endpoint only if Upload component is used (#2430) 2024-01-23 12:20:06 -08:00
Elijah Ahianyo
abfc099779
rx.match component (#2318)
* initial commit

* add more tests

* refactor match jinja template

* add docstrings

* cleanup

* possible fix for pyright

* fix conflicts

* fix conflicts again

* comments

* fixed bug from review

* fix tests

* address PR comment

* fix tests

* type error improvement

* formatting

* darglint fix

* more tests

* stringify switch condition and cases as js doesnt support complex types(lists and dicts) in switch cases.

* Update reflex/vars.py

Co-authored-by: Masen Furer <m_github@0x26.net>

* change usages

* Precommit fix

---------

Co-authored-by: Alek Petuskey <alek@pynecone.io>
Co-authored-by: Masen Furer <m_github@0x26.net>
Co-authored-by: Alek Petuskey <alekpetuskey@aleks-mbp.lan>
2024-01-04 09:48:18 -08:00
Thomas Brandého
8ac08e2cb4
color_scheme props added and updated pyi files (#2279) 2023-12-18 20:47:18 -08:00
Masen Furer
a2d5bbc133
[reflex-web tweaks] Do not memoize children of InputGroup (#2230) 2023-11-30 09:48:28 -08:00
Masen Furer
8e7d4819ee
check_generated_pyi: fix diff checking (#2029) 2023-11-17 15:21:52 -08:00
Thomas Brandého
ddb1f8133b
Apply new pyi script (#2041) 2023-11-16 10:27:04 -08:00
Nikhil Rao
33e4816950
Lazy import modules in reflex (#2144) 2023-11-13 19:48:12 -08:00
Alek Petuskey
dd982c5ace
Add benchmarking tests (#2143) 2023-11-08 17:41:08 -08:00
Thomas Brandého
9a5579e1ef
Add datagrid editor (#1941) 2023-10-26 16:17:34 -07:00
Masen Furer
5d590c350e
Refactor pyi_generator to use AST directly (#2034) 2023-10-26 10:56:35 -07:00
Masen Furer
93d19d6dc3
[REF-938] Fix up radix themes issues (#2002) 2023-10-24 14:29:54 -07:00
Alek Petuskey
864a66b20d
Lighthouse Test CI (#1974)
* Initital lighhouse test

* Added seperate lighthouse test

* Added sh

* Added Project dir to bash

* Change proj path sh

* Temp public storage

* Add port check to lighthouse

* Refactor Check

* Refactor Sh

* Change ENV to prod

* Change ENV to prod

* Check port

* Check port

* Change because it doesn't auto detect hmtl

* Change to SPA

* Change to SPA

* HTTPs to HTTP

* Added extra routes

* Add posthog

* Temp save to file for large uploads

* Add distinctid

* Add distinctid to outlevel

---------

Co-authored-by: Alek Petuskey <alekpetuskey@aleks-mbp.lan>
2023-10-16 18:10:49 -07:00
Masen Furer
67606561d3
[REF-668] Wrap MyApp with radix Theme component (#1867)
* partly add some radix-ui/themes based components

* add @radix-ui/themes integration to top-level app

* WiP: compile _app_wrap based on which component library is used

TODO: working color mode

* WiP get color mode working with agnostic provider

still not perfect, as the RadixColorModeProvider seems to trip hydration errors
when using color_mode_cond component, but for now, this provides a nice balance
between the two libraries and allows them to interoperate.

* WiP template _app.js instead of making a separate wrap file

* WiP: use next-themes for consistent darkmode switching

* strict pin chakra deps

* Move ChakraColorModeProvider to separate js file

* move nasty radix themes js code into js files

* remove chakra from default imports

* chakra fixup import to use .js extension

* Add radix theme typography and layout components

* do NOT special case the radix theme...

avoid templating json and applying it, avoid non-customizable logic

just add the radix Theme component as an app wrap if the user specifies it to
rx.App, and any other app-wrap theme-like component could _also_ be used
without having to change the code.

this also allows different themes for different sections of the app by simply
placing elements inside a different rdxt.theme wrapper.

* Theme uses "radius" not "borderRadius"

* move next-themes to main packages.json

this is always used, regardless of the component library

* test_app: test cases for app_wrap interface

* Finish wrapping Button, Switch, and TextField components

* docstring, comments, static fixups

* debounce: use alias or tag when passing child Element

Fix REF-830

* test_app: ruin my beautiful indentation

* py38 compatibility

* Add event triggers for switch and TextField

* Add type hints for radix theme components

* radix themes fixups from writing the tests

* Add integration test for radix themes components

* test_app: mock out package installation

we only need the compile result, we're not actually trying to install packages

* avoid incompatible version of @emotion/react

* test_radix_themes: include theme_panel component

* next-themes default scheme: "light"

until all of our components look good in dark mode, need to keep the default as
light mode regardless of the system setting.
2023-10-16 15:31:50 -07:00
Elijah Ahianyo
c6abeb31a5
Props as Literals (#1921) 2023-10-15 20:16:39 -07:00
Nikhil Rao
8231993e5a
Improvements to custom styles in rx.markdown (#1852) 2023-09-25 15:59:48 -07:00
Thomas Brandého
211dc15995
New API to define triggers (#1820) 2023-09-21 09:47:22 -07:00
Nikhil Rao
264c44e630
Disable metrics in CI (#1822) 2023-09-15 18:15:25 -07:00
Nikhil Rao
1938a6cc58
Add serializers for different var types (#1816) 2023-09-15 17:19:26 -07:00
Thomas Brandého
2d570b3bcd
Fix some docstrings in pyi (#1773) 2023-09-07 12:55:49 -07:00
Thomas Brandého
043648da07
improve pyi files generation (#1765) 2023-09-07 00:23:17 -07:00