Juro Oravec
8677ee7941
refactor: deprecate template caching, get_template_name, get_template, assoc template with Comp cls ( #1222 )
...
* refactor: deprecate template caching, get_template_name, get_template, assoc template with Comp cls
* refactor: change implementation
* refactor: handle cached template loader
* refactor: fix tests
* refactor: fix test on windows
* refactor: try to fix type errors
* refactor: Re-cast `context` to fix type errors
* refactor: fix linter error
* refactor: fix typing
* refactor: more linter fixes
* refactor: more linter errors
* refactor: revert extra node metadata
2025-06-01 19:20:22 +02:00
Juro Oravec
ccf02fa316
chore: util to manage URLs in the codebase ( #1179 )
...
* chore: util to manage URLs in the codebase
* docs: mentiion validate_links and supported_versions in docs
* refactor: fix linter errors
2025-05-11 14:59:34 +02:00
Juro Oravec
6253042e9e
refactor: remove middleware, add strategy "raw", and call render_deps() from within Template.render() ( #1166 )
...
* refactor: remove middleware, add strategy "raw", and call render_deps() from within Template.render()
* refactor: fix formatting
* refactor: fix benchmark tests
* refactor: avoid processing deps if rendered HTML contains no components
* refactor: remove comments
* refactor: rename "raw" to "ignore"
2025-05-06 21:36:41 +02:00
Juro Oravec
28b61c1609
refactor: Update docs and tests to use get_template_data() ( #1161 )
...
* refactor: update docs and tests to use get_template_data()
* refactor: fix linting
* docs: add note about difference between the two methods
2025-05-03 12:04:10 +02:00
Juro Oravec
bf7a204e92
feat: add "simple", "prepend", and "append" render types ( #1156 )
...
* feat: add "simple", "prepend", and "append" render types
* refactor: explicitly set strategy for "document" in tests
2025-05-02 15:07:16 +02:00
Juro Oravec
a49f5e51dd
feat: component URL ( #1088 )
...
* feat: allow to set defaults
* refactor: remove input validation and link to it
* feat: component URL
* refactor: fix linter errors
* refactor: fix linter errors + update examples to use Component.View..get
* docs: update comment
* refactor: revert change to hash_comp_cls
* docs: update comment
2025-04-07 10:44:41 +02:00
Juro Oravec
588053803d
refactor: fix component recursion ( #936 )
2025-02-01 17:19:21 +01:00
Juro Oravec
d94a459c8d
refactor: rename template_name to template_file ( #878 )
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-01-01 17:06:14 +01:00
Juro Oravec
715bf7d447
feat: allow to set main JS and CSS from files + lazy-load component m… ( #870 )
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-12-30 18:00:46 +01:00
Juro Oravec
4dab940db8
feat: Add support for HTML fragments ( #845 )
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-12-19 10:03:35 +01:00
Juro Oravec
58b3ad3c8d
refactor: fix sampleproject component-relative ( #833 )
...
Closes #830
2024-12-08 09:28:24 +01:00
Juro Oravec
5fd45ab424
chore: Push dev to master to release v0.110 ( #767 )
...
* feat: skeleton of dependency manager backend (#688 )
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* refactor: selectolax update and tests cleanup (#702 )
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* refactor: move release notes to own file (#704 )
* chore: merge changes from master (#705 )
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yassin Rakha <yaso2go@gmail.com>
Co-authored-by: Emil Stenström <emil@emilstenstrom.se>
fix for nested slots (#698 ) (#699 )
* refactor: remove joint {% component_dependencies %} tag (#706 )
Co-authored-by: Emil Stenström <emil@emilstenstrom.se>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* refactor: split up utils file and move utils to util dir (#707 )
* docs: Move docs inside src/ to allow imports in python scripts (#708 )
* refactor: Docs prep 1 (#715 )
* refactor: Document template tags (#716 )
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* refactor: pass slot fills in template via slots param (#719 )
* chore: Merge master to dev (#729 )
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yassin Rakha <yaso2go@gmail.com>
Co-authored-by: Emil Stenström <emil@emilstenstrom.se>
Co-authored-by: Tom Larsen <larsent@gmail.com>
fix for nested slots (#698 ) (#699 )
* fix: Do not raise error if multiple slots with same name are flagged as default (#727 )
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* refactor: tag formatter - allow fwd slash in end tag (#730 )
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* refactor: Use lowercase names for registry settings (#731 )
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* docs: add docstrings (#732 )
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* feat: define settings as a data class for type hints, intellisense, and docs (#733 )
* refactor: fix reload-on-change logic, expose autodiscover's dirs-getting logic, rename settings (#734 )
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* docs: document settings (#743 )
* docs: document settings
* refactor: fix linter errors
* feat: passthrough slots and more (#758 )
* feat: passthrough slots and more
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* refactor: remove ComponentSlotContext.slots
* refactor: update comment
* docs: update changelog
* refactor: update docstrings
* refactor: document and test-cover more changes
* refactor: revert fill without name
* docs: update README
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* fix: apostrophes in tags (#765 )
* refactor: fix merge error - duplicate code
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Emil Stenström <emil@emilstenstrom.se>
2024-11-25 09:41:57 +01:00
Juro Oravec
e1382d3ccd
refactor: Remove safer_staticfiles, replace STATICFILES_DIRS with COMPONENTS.dirs, support [app]/components
( #652 )
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-11 08:45:55 +02:00
Juro Oravec
841dd77e91
refactor: Fix template caching, expose cached_template
, Component.template API changes ( #647 )
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-06 22:40:39 +02:00
Juro Oravec
e771a0aaaf
refactor: Use top-level exports as public API ( #562 )
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-08-03 08:30:39 +02:00
Juro Oravec
23d91218bd
refactor: usage notes + tests for safer_staticfiles ( #538 )
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-07-08 07:25:03 +02:00
Juro Oravec
fee26ec1d8
feat: refactor render fn and allow slots as functions
2024-06-02 16:22:38 +02:00
Juro Oravec
3fc90e4956
feat: merge context settings, replace if_filled tag with var
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-01 20:55:09 +02:00
Juro Oravec
1b6cc7c192
refactor: fix settings in sampleproject
2024-04-16 23:25:13 +02:00
Juro Oravec
7b64aa6791
refactor: update example of config to sampleproject settings
2024-04-16 23:25:12 +02:00
Juro Oravec
37fd901908
Resolve media and template files relative to component class dir ( #395 ), thanks @JuroOravec
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Emil Stenström <emil@emilstenstrom.se>
2024-03-23 19:01:39 +01:00
Juro Oravec
b14dec9777
Add mypy support ( #396 ), thanks @JuroOravec
2024-03-15 23:31:15 +01:00
Dylan Castillo
25fe39c6d6
Merge branch 'master' into add-type-hints
2024-03-04 21:45:37 +01:00
Dylan Castillo
2ed3b40d05
Add type hints
2024-03-02 14:39:26 +01:00
Emil Stenström
edf3885632
Replace all instances of component_block with component. Remove duplicate tests.
2024-02-21 22:38:06 +01:00
Emil Stenström
ef6a082238
Remove component tag in favour of component_block.
2024-02-21 22:38:06 +01:00
Dylan Castillo
dc9f1b46b2
Fix issue #368 and add tests ( #369 )
2024-01-27 23:10:03 +01:00
Dylan Castillo
91b4accfeb
Render components as views ( #366 ) (thanks @dylanjcastillo)
2024-01-24 22:36:57 +01:00
Dylan Castillo
70a2a01400
Implement single file components
2024-01-14 22:36:55 +01:00
adriaan
2d86f042da
Implement #231 – default slot filling ( #269 )
...
* Add 'default' slot option + implicit fills; tests; docs
* Differentiate between standard fillnodes and implicitfillnodes on type lvl
* Reworking slot-fill rendering logic. Simplifying component interfact. Add new get_string_template method
* First working implementation of chainmap instead of stacks for slot resolution
* Stop passing FillNode to Component initalizer -> better decoupling
* Treat fill name and alias and component name as filterexpression, dropping namedvariable
* Name arg of if_filled tags and slots must be string literal
2023-05-18 14:58:46 +02:00
adriaan
6f49339c91
fix/263 performance regression ( #264 )
...
* Replace deep copies in Component.render
* Add 2nd example component to sampleproject
2023-04-13 14:20:43 +02:00
adriaan
fa41387a53
Introduce safer_staticfiles app as user-friendly security measure for #260 ( #261 )
...
* Introduce safer_staticfiles app to ignore .py,.html as security measure. Docs up-to-date
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-04-11 13:55:11 +02:00
KimSia, Sim
bb256f2ec8
🐛 Prevent potential null elements
...
because {% component_js_dependencies %} loads all the components regardless
2022-07-23 14:42:48 +08:00
Emil Stenström
c0ed45b920
Improve structure of sampleproject.
2022-07-18 09:13:36 +02:00
Emil Stenström
2a72329041
Add sample project to repo to show config.
2022-07-17 13:27:17 +02:00
Emil Stenström
16e2a8dda9
Introduce a sample project to illustrate setup.
2022-07-17 09:29:15 +02:00