UI5 / UI5/cli

Support route-based code splitting

Open
#380 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

module/ui5-builder
Dominant language
JavaScript
Stars
511
Forks
83
Avg merge
1d 5h
Merged PRs (30d)
55

Description

Expected Behavior

Having the self-contained build is a great improvement in terms of bundle size. Creating sap-ui-custom.js bundles brings huge performance benefits. However, as apps grow, the bundle grows as well. This can become an issue, especially for the initial start up time of such an app.

To address large bundle files lots of tools like Webpack perform Code-Splitting. A common approach is to split bundles by routes. UI5 already comes with a concept of routes and components. It would be great to have the ui5 builder support splitting bundles by routes as well.

Current Behavior

Projects can either be build using the preload or self-contained build. The latter does not allow code splitting.

Sample Project Setup

Imagine the following setup of application using routing and nested Components (each which potentially differing ui5 control includes and dependencies):

projectA (application)
└─(uses sap/m/Page, ...)
  \
   ├──/home  (component)
   │  └─(uses sap/m/Button, sap/f/Avatar)
   │
   ├──/users (component)
   │  └─(uses sap/m/Button, sap/ui/table/Table)
   │
   ├──/report (component)
   │  └─(uses ui5lab/thirdparty/lib)

Affected components (if known)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the self-contained build behavior in ui5-builder and how ui5-server handles the resulting bundles. Trace how routes, components, control includes, and dependencies are represented, then define the split-bundle behavior and verify that route-specific bundles load while the existing preload and self-contained builds continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.