Compiling user code as an extension of a host application in a browser environment

    公开(公告)号:US11995458B1

    公开(公告)日:2024-05-28

    申请号:US17338116

    申请日:2021-06-03

    发明人: Stefan Retief

    IPC分类号: G06F9/455 G06F8/41 G06F16/11

    摘要: In an example embodiment, a technique is provided for compiling user code. A browser, executing on a local computing device, receives a request to compile the user code. A bundler, executing in the browser, retrieves contents of the user code and dependencies of the user code on one or more host packages of a host application. The bundler transforms, compiles and bundles the user code to produce a compiled bundle. The transforming imports each host package as a property of a global window object of the browser, wherein the property has a name that includes the host package name appended with a predetermined string, and a value that indicates an entry point into the host package. The compiles the user code as an extension of the host application in order to utilize the host packages in an already compiled form. The compiled bundle is then provided as an output.