perf(assets): move form-specific JS off app_include_js into doctype_js
Every app_include_js entry is appended to the desk `Link: rel=preload` header; this deployment's edge proxy has a ~4 KB header buffer and overflowing it returns 502 (see jey_layout/hooks.py). jey_erp was the biggest contributor with 9 desk-wide scripts, 7 of which are form-scoped and were loading on every desk page for nothing (asset.js alone is 1143 lines). - Move vat_calculator/sales_invoice_vat/tax_articles/certificates → Sales Invoice doctype_js; vat_calculator/sales_order_vat → Sales Order; asset → Asset. doctype_js is inlined into form meta server-side, never touching the preload header. Order preserved (vat_calculator first — *_vat.js call jey_erp.vat_calculator.init at load time). - Delete public/js/sales_invoice.js: empty (0 lines) and already a dup doctype_js entry. - app_include_js: 9 → 2 (link_field_fix.js + bank_excel_import.bundle.js). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
db32c972a9
commit
23b83b089e
|
|
@ -9,15 +9,12 @@ app_license = "unlicense"
|
||||||
boot_session = "jey_erp.extend_party_types.apply_vat_boot_patches"
|
boot_session = "jey_erp.extend_party_types.apply_vat_boot_patches"
|
||||||
|
|
||||||
app_include_js = [
|
app_include_js = [
|
||||||
"/assets/jey_erp/js/vat_calculator.js",
|
# Desk-wide scripts ONLY. Every entry here is appended to the desk's
|
||||||
"/assets/jey_erp/js/sales_invoice.js",
|
# `Link: rel=preload` response header; the edge proxy has a ~4 KB header
|
||||||
"/assets/jey_erp/js/sales_invoice_vat.js",
|
# buffer and overflowing it returns 502 (see jey_layout/hooks.py). Keep this
|
||||||
"/assets/jey_erp/js/sales_invoice_tax_articles.js",
|
# list minimal — form-specific scripts belong in doctype_js below.
|
||||||
"/assets/jey_erp/js/sales_invoice_certificates.js",
|
"/assets/jey_erp/js/link_field_fix.js", # global link-field patch
|
||||||
"/assets/jey_erp/js/sales_order_vat.js",
|
"bank_excel_import.bundle.js", # launched from Bank Transaction list + Reconciliation Tool
|
||||||
"/assets/jey_erp/js/asset.js",
|
|
||||||
"/assets/jey_erp/js/link_field_fix.js",
|
|
||||||
"bank_excel_import.bundle.js",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
app_include_css = [
|
app_include_css = [
|
||||||
|
|
@ -26,11 +23,24 @@ app_include_css = [
|
||||||
]
|
]
|
||||||
|
|
||||||
doctype_js = {
|
doctype_js = {
|
||||||
# sales_classification.js loaded via doctype_js (NOT app_include_js) so it
|
# Form-specific scripts load here (NOT app_include_js) so they never enter the
|
||||||
# does NOT bloat the desk's `Link: rel=preload` header — the edge proxy has a
|
# desk `Link: rel=preload` header — the edge proxy has a ~4 KB buffer and
|
||||||
# 4 KB header buffer and overflowing it returns 502. See jey_layout/hooks.py.
|
# overflowing it returns 502 (see jey_layout/hooks.py).
|
||||||
"Sales Invoice": ["public/js/sales_invoice.js", "public/js/sales_classification.js"],
|
# ORDER MATTERS: vat_calculator.js defines jey_erp.vat_calculator and the
|
||||||
"Sales Order": "public/js/sales_classification.js",
|
# *_vat.js scripts call .init() at load time, so it must be listed first.
|
||||||
|
"Sales Invoice": [
|
||||||
|
"public/js/vat_calculator.js",
|
||||||
|
"public/js/sales_invoice_vat.js",
|
||||||
|
"public/js/sales_invoice_tax_articles.js",
|
||||||
|
"public/js/sales_invoice_certificates.js",
|
||||||
|
"public/js/sales_classification.js",
|
||||||
|
],
|
||||||
|
"Sales Order": [
|
||||||
|
"public/js/vat_calculator.js",
|
||||||
|
"public/js/sales_order_vat.js",
|
||||||
|
"public/js/sales_classification.js",
|
||||||
|
],
|
||||||
|
"Asset": "public/js/asset.js",
|
||||||
"Purchase Invoice": "public/js/purchase_invoice.js",
|
"Purchase Invoice": "public/js/purchase_invoice.js",
|
||||||
"Employee": "public/js/employee.js",
|
"Employee": "public/js/employee.js",
|
||||||
"Bank Reconciliation Tool": "public/js/bank_reconciliation_tool.js",
|
"Bank Reconciliation Tool": "public/js/bank_reconciliation_tool.js",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue