Skip to content

Conversation

@JuroOravec
Copy link
Contributor

@JuroOravec JuroOravec commented Oct 22, 2025

Currently django-components extends Django's template syntax with things like literal lists, dicts, etc. This is currently implemented in Pure python, and it's fairly slow (adds ~1s on the first load for large pages with ~500 components).

I have re-implemented the extended Django syntax as a Rust create.

With that, I want to restructure this repo as monorepo.

There's several reasons:

  • When packaged and built separately, each Rust-based python package comes at about 100MB. So instead I want to have a single djc-core package that provides a single API. So that no matter how many Rust crates there are, the size still is only those 100MB.

  • The Rust->Python binding is done by PyO3. When I was updating this repo to support Python 3.14 (see Support Python 3.14 #10), I had to update it from pyo3 v0.19 to pyo3 v0.27. There was a lot of breaking changes, and it took 1-2 hrs to update it.

    By having a monorepo, I won't have to go through this with every single Rust create. Instead, all creates will be updated and managed simultaneously.

Packages:

  • HTML transformer (current package)
  • Django template parser (planned)
  • Jinja-like in-template Python expression (this is something that needs to be discussed yet)
  • And I have a hunch that there might be need for a CSS transformer for applying custom selectors to CSS for implementing CSS scoping.


## v1.1.0

- Renamed package from `djc-core-html-parser` to `djc-core`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This also means that the package that django-components will depend on will be renamed to djc-core. But the public API of djc-core remains the same.

edition = "2021"
[workspace]
members = [
"crates/djc-core",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

djc-core is the public API of this project. It's what will get exposed to Python. Inside it, it just re-exports other Rust crates.

@JuroOravec
Copy link
Contributor Author

CC @EmilStenstrom

Also note that I have also renamed this repo from djc-core-html-parser to just djc-core

@JuroOravec JuroOravec merged commit 03de1ab into main Oct 22, 2025
14 checks passed
@JuroOravec JuroOravec deleted the jo-monorepo branch October 22, 2025 16:23
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.

1 participant