Users who have contributed to this file

Marko + Lasso

The lasso-marko plugin for Lasso.js will automatically compile all imported Marko templates during bundling. In addition, the lasso-marko plugin will automatically bundle any template dependencies (including required CSS).

When Lasso.js bundles up the code above it will automatically bundle up the required ./components/app/index.marko file.

Server-side rendering

If you are rendering the initial UI on the server then it is necessary to make sure that all UI components are bundled and sent to the browser so that UI components can be mounted in the browser. For example:

Browser refresh

browser-refresh is recommended in development for instant page refreshes and hot reloading of Marko templates, styles and other resources. browser-refresh works well with Lasso and Marko and is very easy to use as a drop-in replacement for node:

browser-refresh server.js

Lasso package types commonly used with Marko

For many use cases, the combination of lasso-marko and @lasso/marko-taglib is sufficient to render and bundle components without the need for explicit browser.json files. For more advanced use cases, the following bundle types may be defined in a browser.json for Lasso.

marko-dependencies: (provided by lasso-marko)
Includes all the dependencies needed by template and the code to register all components that would be rendered by the template. It does not automatically initialize the component, so is most useful if you need to initialize components manually.

Note: Ensure Step 2 is inside a DOM-ready wrapper, for the legacy widgets layer to load (if there are widgets built out of Marko 3, that is being used inside a Marko 4 component.)

marko-hydrate: (provided by lasso-marko)
Includes all the dependencies needed by template and the code to register all components that would be rendered by the template. This also includes the code to initialize the rendered components. Including this bundle on the page will automatically hydrate server rendered components.

Note:marko-hydrate will initialize the component if its defined on the global window.$components which is inserted by Marko when it sees a <body> tag. Else, if you are just rendering out and lasso-ing the a portion of a page with a set of components, include <init-components/> at the end of the associated template.marko file that builds out the page fragment.

package:
A collection of dependencies. browser.json is the most common package type.
It could be used to point to another browser.json from within one component's browser.json.
Typically also used when the dependencies of the referred browser.json have to be packaged inline.