As CAP is fully written in javascript. There is no technical reason that the logic can't run inside the browser client. Therefor this milestone aims to run a private CAP node inside the browser clients as a Service Worker. There are certain limitation for running inside a Service Worker. Which will primarily be broken by the @sap/cds code base. Therefor it is required to write a converter middleware that will force @sap/cds to comply to the Service Worker limitations. If this converter exists all the existing CAP code will also automatically become compliant.
Additionally for the file service it is required to support the browser local storage API instead of the cds.utils.fs exposure of the node:fs package. This also allows the browser to run with private persistence which acts like a local draft mechanism out of the box. Additionally it should allow the private cluster node to download and run deployed applications into the Service Worker for full offline functionality.
As
CAPis fully written in javascript. There is no technical reason that the logic can't run inside the browser client. Therefor this milestone aims to run a private CAP node inside the browser clients as a Service Worker. There are certain limitation for running inside a Service Worker. Which will primarily be broken by the@sap/cdscode base. Therefor it is required to write a converter middleware that will force@sap/cdsto comply to the Service Worker limitations. If this converter exists all the existingCAPcode will also automatically become compliant.Additionally for the file service it is required to support the browser local storage API instead of the
cds.utils.fsexposure of thenode:fspackage. This also allows the browser to run with private persistence which acts like a localdraftmechanism out of the box. Additionally it should allow the private cluster node to download and run deployed applications into the Service Worker for full offline functionality.