React Integration Template Tags

Django template tags for the secret list app.

smarter.apps.secret.templatetags.react_secret_list.secret_list_react_assets()[source]

Load CSS and JS files for a React app entry point based on its manifest.json.

Return type:

AssetDict

smarter.apps.secret.templatetags.react_secret_list.templatetag_manager = <smarter.lib.django.templatetags.smarter_react_templatetag_manager.SmarterReactTemplateTagManager object>

Manages integration of Vite-built React assets into Django templates. Expects to find a Vite-generated manifest.json in the file path static/react/@smarter/secret-list/.

Example manifest.json structure:

{
    "_rolldown-runtime.js": {
        "file": "assets/rolldown-runtime.js",
        "name": "rolldown-runtime"
    },
    "_xterm-TdnZ7DQy.css": {
        "file": "assets/xterm-TdnZ7DQy.css",
        "src": "_xterm-TdnZ7DQy.css"
    },
    "_xterm.js": {
        "file": "assets/xterm.js",
        "name": "xterm",
        "imports": [
            "_rolldown-runtime.js"
        ],
        "css": [
            "assets/xterm-TdnZ7DQy.css"
        ]
    },
    "index.html": {
        "file": "assets/index.js",
        "name": "index",
        "src": "index.html",
        "isEntry": true,
        "imports": [
            "_rolldown-runtime.js",
            "_xterm.js"
        ],
        "css": [
            "assets/index-DvLY75bJ.css"
        ]
    }
}