mosaic
Search…
Overview
Mosaic - a technology for developing extensible apps

Features

🧞 Plugins
​Plugins can easily stack onto one another, such way modifying the same place of the application multiple times. It is recommended to use the plugin system to implement functionality reusable among several projects.
Initial code
@creator/application/src/index.js
1
/** @namespace Application/getData */
2
const getData = () => {
3
return ['Initial data'];
4
}
5
​
6
const data = getData();
Copied!
With this plugin
@creator/extension/src/plugin/some.plugin.js
1
const plugin = (args, callback, context) => {
2
const data = callback(...args); // ['Initial data']
3
​
4
return [
5
...data,
6
'Data from the plugin'
7
];
8
};
9
​
10
module.exports = {
11
'Application/getData': {
12
function: plugin
13
}
14
}
Copied!
Produces this
1
['Initial data', 'Data from the plugin']
Copied!
πŸ“” Shadowing (Overrides)
​Overrides of parent themes are the base of the theming mechanism. Use overrides to build your application on top of a parent application.
Initial code in the parent theme
parent-ts-react-app/src/App.tsx
1
export class App extends PureComponent<{}, {}> {
2
renderContent() {
3
return <p>This is written in the parent theme in TS</p>;
4
}
5
​
6
render() {
7
return (
8
<div className="Application">
9
{ this.renderContent() }
10
</div>
11
);
12
}
13
}
14
​
15
export default App;
Copied!
With this override in the child theme
react-app/src/App.js
1
import ParentApp from 'Parent/App';
2
​
3
export class App extends ParentApp {
4
renderContent() {
5
return (
6
<>
7
<p>This is written in the child theme in JS</p>
8
{ super.renderContent() }
9
</>
10
);
11
}
12
}
13
​
14
export default App;
Copied!
Produces this HTML output
1
<div class="Application">
2
<p>This is written in the child theme in JS</p>
3
<p>This is written in the parent theme in TS</p>
4
</div>
Copied!

Why use Mosaic?

πŸ”Œ Make your application extensible
By using Mosaic plugins, you may make any part of your project extensible and modifiable either from within the application itself or from installed Mosaic modules.
πŸ‡ Use granular micro-frontend architecture
Make dependencies injected with plugins instead of importing them! This way, you keep ALL the logic related to the module WITHIN the module, even its use cases!
πŸ–ŒοΈ Theming
Build your project by overriding an existing project's functionality! Have infinite amount of parent projects. Similar to straight up forking, but with actual core updating potential.
🀝 Integrations with existing technologies
No manual configuration tinkering required, we got you covered 🀝
There are several ways on how to get Mosaic in your application - we support Next.js, create-react-app, and simple Webpack installation. Some other technologies are coming soon, stay tuned 😎
Last modified 6mo ago
Copy link