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

[IMPL] - added support for sass and scss stylesheet languages #4292

Open
wants to merge 47 commits into
base: main
Choose a base branch
from

Conversation

KronosDev-Pro
Copy link

  • better checking of stylesheets to be compiled
  • added support for sass and scss stylesheet languages
  • the stylesheets files are now copied to ".web/styles/" at compile time
  • relock poetry file for libsass deps
  • stylesheet compiler unit tests also check the contents of the file

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

New Feature Submission:

  • Does your submission pass the tests?
  • Have you linted your code locally prior to submission?

Changes To Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

 - better checking of stylesheets to be compiled
 - added support for sass and scss stylesheet languages
 - the stylesheets files are now copied to ".web/styles/" at compile time
 - relock poetry file for libsass deps
 - stylesheet compiler unit tests also check the contents of the file
pyproject.toml Outdated Show resolved Hide resolved
reflex/compiler/compiler.py Outdated Show resolved Hide resolved
reflex/compiler/compiler.py Outdated Show resolved Hide resolved
reflex/compiler/compiler.py Outdated Show resolved Hide resolved
reflex/compiler/compiler.py Outdated Show resolved Hide resolved
reflex/compiler/compiler.py Outdated Show resolved Hide resolved
reflex/compiler/compiler.py Outdated Show resolved Hide resolved
reflex/compiler/compiler.py Outdated Show resolved Hide resolved
reflex/compiler/compiler.py Outdated Show resolved Hide resolved
reflex/compiler/compiler.py Outdated Show resolved Hide resolved
reflex/compiler/compiler.py Outdated Show resolved Hide resolved
Copy link
Member

@adhami3310 adhami3310 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks much better now, a few nitpicks and we should be good to go !

reflex/compiler/compiler.py Outdated Show resolved Hide resolved
reflex/compiler/compiler.py Outdated Show resolved Hide resolved
reflex/compiler/compiler.py Outdated Show resolved Hide resolved
benedikt-bartscher and others added 15 commits November 7, 2024 14:08
* improve typing for serializer decorator

* use wrapped logic

* dang it darglint

---------

Co-authored-by: Khaleel Al-Adhami <[email protected]>
* Add Missing Table props

* add more props
* Codeblock cleanup in markdown

* Initial approach to getting this working with rx.memo and reflex web

* abstract the map var logic

* the tests are not valid + pyright fix

* darglint fix

* Add unit tests plus mix components

* pyi run

* rebase on main

* fix darglint

* testing different OS

* revert

* This should fix it. Right?

* Fix tests

* minor fn signature fix

* use ArgsFunctionOperation

* use destructured args and pass the tests

* fix remaining unit tests

* fix pyi files

* rebase on main

* move language regex on codeblock to markdown

* fix tests

---------

Co-authored-by: Khaleel Al-Adhami <[email protected]>
These are useful for typing purposes and should be exposed at the top level to
avoid requiring deep imports from subpackages that we may need to change later.
@KronosDev-Pro
Copy link
Author

Sorry, that's why I can't see the error...

Unit tests, cp312
Unit tests, cp310

@KronosDev-Pro
Copy link
Author

KronosDev-Pro commented Nov 11, 2024

Units tests

python package check
cp39
+libsass
-libsass
cp310
+libsass
-libsass
cp311
+libsass
-libsass
cp312
+libsass
-libsass

Attempting to initialize relationship fields in a sqlmodel model throws an
error, so only pass defined pydantic __fields__ if the type is a Model.
@KronosDev-Pro
Copy link
Author

well, for the integration-node-latest / check_latest_node (3.12, 1, node), I don't know why he raises some errors

* Astral 0.5.0 path change

https://github.com/astral-sh/uv/releases

Use XDG (i.e. ~/.local/bin) instead of the Cargo home directory in the installer

* Fix path in production-app-platform example

---------

Co-authored-by: Masen Furer <[email protected]>
reflex/compiler/compiler.py Outdated Show resolved Hide resolved
@@ -165,7 +239,7 @@ def test_compile_stylesheets_exclude_tailwind(tmp_path, mocker):

assert compiler.compile_root_stylesheet(stylesheets) == (
str(Path(".web") / "styles" / "styles.css"),
"@import url('../public/styles.css'); \n",
"@import url('./styles.css'); \n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure this won't break anything?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know where this could cause a problem, since all the supported stylesheet files in the app/assets directories and subdirectories are copied or compiled and saved in the .web/styles directory and no longer in the .web/public directories.

and also, I checked the second batch of the tests/integration group and the tests/integration/test_tailwind.py (which is the only one to have tests impacted by the changes) passed the tests without any errors, which is why I don't understand the error in the first batch of the tests/integration group.

adhami3310 and others added 17 commits November 12, 2024 12:36
* redesign error boundary screen

* pyi time

* add color

* i hate python 3.9
* Temporarily downpin @radix-ui/themes <3.1.5

A visual/style regression was introduced in @radix-ui/themes 3.1.5
as described in radix-ui/themes#627 which reflex needs to avoid.

* Get expected radix library version from component
…eflex-dev#4371)

Because of some dodgy logic in Base.get_value and State.dict / State.get_delta
when the value of some state var X happened to be the name of another var in
the state Y, then the value for X would be returned as the value of Y.

wat.

Fixes reflex-dev#4369
 - better checking of stylesheets to be compiled
 - added support for sass and scss stylesheet languages
 - the stylesheets files are now copied to ".web/styles/" at compile time
 - relock poetry file for libsass deps
 - stylesheet compiler unit tests also check the contents of the file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants