perf: form-bundle rollup pipeline — collapse serial ES module hops (FORMS-24968)#193
Open
dmaurya929 wants to merge 1 commit into
Open
perf: form-bundle rollup pipeline — collapse serial ES module hops (FORMS-24968)#193dmaurya929 wants to merge 1 commit into
dmaurya929 wants to merge 1 commit into
Conversation
…module hops Port the HDFC-validated bundle optimization to the boilerplate so all downstream EDS Forms projects inherit the performance gains: - 12 JS fetches → 1 bundle + 2 shims (−11 requests) - 5 serial import hops → 2 hops (parallel preload) - Worker startup: −31% (afb-runtime.min.js instead of full source) New files: rollup/form.rollup.config.js, blocks/form/form.source.js, blocks/form/rules/index.source.js, scripts/swap-shims.js Modified: form.js and rules/index.js → 1-line shims; head.html adds 5 modulepreloads; package.json adds build/build:dev/build:form-bundle scripts; pre-commit shim guard added Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
Commits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports the FORMS-24968 performance enhancement from the HDFC
forms-engineproject toaem-boilerplate-formsso all downstream EDS Forms projects inherit the gains.What this does: bundles
form.js+rules/index.jsand their static deps into a singleform-bundle.min.jsvia Rollup, eliminating 5+ serial ES module fetches that currently block form startup. Adds<link rel="modulepreload">hints inhead.htmlso the browser fetches all critical modules in parallel during HTML parse.Performance impact (measured on HDFC staging)
Changes
rollup/form.rollup.config.js— new Rollup config; dual output (unminified dev + terser prod);redirectRulesIndexplugin handles boilerplate'srepeat.jsimportingsubscribefromrules/index.jsblocks/form/form.source.js— full form logic as Rollup input (never served at runtime)blocks/form/rules/index.source.js— full rules logic as Rollup inputblocks/form/form.js— replaced with 1-line shim re-exporting fromform-bundle.min.jsblocks/form/rules/index.js— replaced with 1-line shim re-exportingsubscribefromform-bundle.min.js(preserves singletonformSubscriptionsMap for custom components)blocks/form/rules/RuleEngineWorker.js+functionRegistration.js— switched toafb-runtime.min.js(−31% worker startup)scripts/swap-shims.js— dev↔prod toggle;npm run build(prod) /npm run build:dev(dev + sourcemaps)package.json— addsbuild,build:dev,build:form-bundlescriptshead.html— 5<link rel="modulepreload">hints forform.js,form-bundle.min.js,constant.js,afb-runtime.min.js,afb-formatters.min.js.husky/pre-commit.mjs— shim guard blocks commits that reference unminified bundles (dev-mode left on)blocks/form/form-bundle.js+form-bundle.min.js— generated bundles committed to repoTest plan
npm run buildcompletes without errors;form-bundle.js(110 KB) andform-bundle.min.js(56 KB) are generatednpm run build:devflips all shims to.js;npm run buildflips them back to.min.jsblocks/form/form.jsafterbuild:dev→ commit should fail withERROR: ... points at an unminified bundleform.js(shim) +form-bundle.min.jsfetched for form logic — no separaterules/index.js,util.js, etc.(preload)initiatorRelated
JIRA: https://jira.corp.adobe.com/browse/FORMS-24968
🤖 Generated with Claude Code