You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having issued with JinjaX collected list of javascript and css.
Creating a small snippet to reproduce the problem is not that easy, but here is a pseudo code of the problem:
env = jinja2.Environment(
loader=jinja2.PackageLoader('udb'),
auto_reload=True,
autoescape=True,
trim_blocks=True,
lstrip_blocks=True,
extensions=['jinja2.ext.i18n'],
)
env.add_extension(jinjax.JinjaX)
catalog = jinjax.Catalog(jinja_env=env, root_url="/static/")
catalog.add_folder(resource_filename('udb', 'templates/components'))
# Generating first template
env.get_template('templates1.html').render()
# Generating second templates
env.get_template('templates2.html').render()
# Issue : Ouput of this command include all the javascript and css collected so far. That include javascript and css from templates1.
# Expected behavior: I'm expecting calls to render() to reset the list of collected javascript and css to only include those required for templates2
Possible I'm using the library the wrong way. So don't hesitate to correct me.
Thanks
The text was updated successfully, but these errors were encountered:
I have issue with this approach because the framework I'm using required a jinja_env to work with. Not a Catalog.
Also, not all my templates are define (or converted to components) yet. To my knowledge, calling catalog.render("templates1") will only work with components. So this is causing me issue as I want to render Jinja templates that include JinjaX components.
That also make me wonder, are collected_css and collected_js thread safe ? I don't think so.
Hello,
I'm having issued with JinjaX collected list of javascript and css.
Creating a small snippet to reproduce the problem is not that easy, but here is a pseudo code of the problem:
Possible I'm using the library the wrong way. So don't hesitate to correct me.
Thanks
The text was updated successfully, but these errors were encountered: