From 7d9fb69f3b61dddb3b2448d59e60f16cd77aaa66 Mon Sep 17 00:00:00 2001 From: Ali <010109ali@gmail.com> Date: Wed, 24 Jun 2026 10:28:31 +0000 Subject: [PATCH] perf(assets): serve desk js/css as hashed bundles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename custom_subtabs.js/.css to .bundle.js/.bundle.css so esbuild emits content-hashed filenames → automatic cache-busting (no more nginx 1-year stale-asset issue on edits). setup_custom_subtabs is defined and called within the file (verified self-contained), so esbuild's IIFE wrap is safe. Co-Authored-By: Claude Opus 4.8 (1M context) --- custom_subtabs/hooks.py | 5 +- ..._subtabs.css => custom_subtabs.bundle.css} | 0 .../custom_subtabs.bundle.HFXJTVZI.css | 68 ++++++ .../custom_subtabs.bundle.HFXJTVZI.css.map | 7 + .../css/custom_subtabs.bundle.6DBL7IOJ.css | 68 ++++++ .../custom_subtabs.bundle.6DBL7IOJ.css.map | 7 + .../dist/js/custom_subtabs.bundle.DIIPT3ZZ.js | 197 ++++++++++++++++++ .../js/custom_subtabs.bundle.DIIPT3ZZ.js.map | 7 + ...om_subtabs.js => custom_subtabs.bundle.js} | 0 9 files changed, 357 insertions(+), 2 deletions(-) rename custom_subtabs/public/css/{custom_subtabs.css => custom_subtabs.bundle.css} (100%) create mode 100644 custom_subtabs/public/dist/css-rtl/custom_subtabs.bundle.HFXJTVZI.css create mode 100644 custom_subtabs/public/dist/css-rtl/custom_subtabs.bundle.HFXJTVZI.css.map create mode 100644 custom_subtabs/public/dist/css/custom_subtabs.bundle.6DBL7IOJ.css create mode 100644 custom_subtabs/public/dist/css/custom_subtabs.bundle.6DBL7IOJ.css.map create mode 100644 custom_subtabs/public/dist/js/custom_subtabs.bundle.DIIPT3ZZ.js create mode 100644 custom_subtabs/public/dist/js/custom_subtabs.bundle.DIIPT3ZZ.js.map rename custom_subtabs/public/js/{custom_subtabs.js => custom_subtabs.bundle.js} (100%) diff --git a/custom_subtabs/hooks.py b/custom_subtabs/hooks.py index bc1cea8..e254fea 100644 --- a/custom_subtabs/hooks.py +++ b/custom_subtabs/hooks.py @@ -25,8 +25,9 @@ app_license = "mit" # ------------------ # include js, css files in header of desk.html -app_include_css = "/assets/custom_subtabs/css/custom_subtabs.css" -app_include_js = "/assets/custom_subtabs/js/custom_subtabs.js" +# Hashed bundles → automatic cache-busting (no nginx 1-year stale-asset issue). +app_include_css = "custom_subtabs.bundle.css" +app_include_js = "custom_subtabs.bundle.js" # include js, css files in header of web template # web_include_css = "/assets/custom_subtabs/css/custom_subtabs.css" diff --git a/custom_subtabs/public/css/custom_subtabs.css b/custom_subtabs/public/css/custom_subtabs.bundle.css similarity index 100% rename from custom_subtabs/public/css/custom_subtabs.css rename to custom_subtabs/public/css/custom_subtabs.bundle.css diff --git a/custom_subtabs/public/dist/css-rtl/custom_subtabs.bundle.HFXJTVZI.css b/custom_subtabs/public/dist/css-rtl/custom_subtabs.bundle.HFXJTVZI.css new file mode 100644 index 0000000..cf468c3 --- /dev/null +++ b/custom_subtabs/public/dist/css-rtl/custom_subtabs.bundle.HFXJTVZI.css @@ -0,0 +1,68 @@ +/* ../../../../../tmp/tmp-18495-vJNc0fl1RN65/custom_subtabs/custom_subtabs/public/css/custom_subtabs.bundle.css */ +.sub-tab-container { + margin: 0 !important; + padding: 0 !important; + display: flex !important; + justify-content: flex-start !important; + border-bottom: 1px solid #ddd !important; +} +.sub-tab-container .sub-tab { + margin: 0 !important; + background: none !important; + border: none !important; + padding: 0 !important; +} +.sub-tab-container .sub-tab a, +.sub-tab-container .sub-tab button { + text-decoration: none !important; + display: block !important; + padding: 6px 15px !important; + color: #555 !important; + border: none !important; + font-size: 14px !important; + font-weight: normal !important; + margin: 0 !important; + background: transparent !important; + box-shadow: none !important; +} +.sub-tab-container .sub-tab a:hover, +.sub-tab-container .sub-tab button:hover { + color: #000 !important; +} +.sub-tab-container .sub-tab.active a, +.sub-tab-container .sub-tab.active button { + color: #000 !important; + font-weight: 600 !important; + border-bottom: 2px solid #000 !important; + background-color: transparent !important; + border-radius: 0 !important; +} +.form-section:has(.sub-tab-container) { + padding-top: 0 !important; + padding-bottom: 0 !important; + margin-bottom: 0 !important; +} +.form-section .section-body:empty, +.form-section .section-body:has(> .form-column > form > .frappe-control[data-fieldname="html_vohk"] > span.tooltip-content:only-child) { + display: none !important; + padding: 0 !important; + margin: 0 !important; + min-height: 0 !important; +} +.sub-tab-container.nav { + display: flex; + list-style: none; + padding: 0; + margin: 0; +} +.sub-tab-container.nav > li[style*="display: none"] { + display: none !important; +} +.sub-tab-container.subtab-hidden { + display: none !important; + visibility: hidden !important; + pointer-events: none !important; + height: 0 !important; + overflow: hidden !important; +} +/*# sourceMappingURL=custom_subtabs.bundle.HFXJTVZI.css.map */ diff --git a/custom_subtabs/public/dist/css-rtl/custom_subtabs.bundle.HFXJTVZI.css.map b/custom_subtabs/public/dist/css-rtl/custom_subtabs.bundle.HFXJTVZI.css.map new file mode 100644 index 0000000..c198156 --- /dev/null +++ b/custom_subtabs/public/dist/css-rtl/custom_subtabs.bundle.HFXJTVZI.css.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../../../../../../tmp/tmp-18495-vJNc0fl1RN65/custom_subtabs/custom_subtabs/public/css/custom_subtabs.bundle.css"], + "sourcesContent": [".sub-tab-container {\n margin: 0 !important;\n padding: 0 !important;\n display: flex !important;\n justify-content: flex-start !important;\n border-bottom: 1px solid #ddd !important;\n}\n\n.sub-tab-container .sub-tab {\n margin: 0 !important;\n background: none !important;\n border: none !important;\n padding: 0 !important;\n}\n\n/* Support both and