Generate a Fuse project with:
$ npm install -g slush-xfuse
XFuse comes with the following generators:
Create a new folder for your project:
$ mkdir my-app
Run the generator from within the new folder:
$ cd my-app$ slush xfuseWhat is the name of your app? my-app...Which language will you use?
The following file structure is then created:
js/src/- app.js- api.js
The files in
/dist on any modification.
gulp(default) - compile ES6
gulp watch- watch
/js/srcfor changes and compile ES6 to ES5 in
ts/src/- app.ts- api.tstsconfig.json
TypeScript support has been added as per the TypeScript Gulp guide
Start by making sure you have installed TypeScript globally
$ npm install -g typescript
TypeScript can then be used follows:
gulp ts- compile TypeScript from
gulp watch-ts- watch
/ts/srcfor changes and compile to ES5 in
tsconfig.json can be used to configure TypeScript compilation. By default it is set to:
js/src with typescript files in
Note: Typescript can directly include
.js files if needed.
First install leinigen
ClojureScript is by default set up with lein-figwheel to allow for a fluid workflow with automatic browser updates
core.cljs exports a
hello variable that is accessible from within the Fuse app.
app.js file exports an
api variable by default, which references the API Object in
You can call
api.getData() to return data served to the app, such as from a remote server via a socket connection or HTTP requests etc.
Hint: Customize the API Object to best suite your app!
You can extract pieces of your application as libraries that can be reused across different apps.
xfuse:library generator to create a fusepm compatible library.
FusePM is a (community driven) package manager for Fuse.
$ slush xfuse:library$ What is the name of your library? BigPanel$ What is the description? A very big panel$ Does the library have a view? yesGenerates the following project files:- BigPanel.ux- bigpanel_include.unoproj
See this list of community packages. A package is a library.
Fuse encourages breaking your app into components (classes) for several reasons:
Good practice. Component-orientation keeps your code base clean, testable, scaleable and easy to maintain. Reuse. It is useful to create components to allow reusing pieces of UI and logic in multiple places. Styling. Creating new classes based on primitives is the recommended way to create a consistent look and feel throughout your project.
To create components for your app:
$ slush xfuse:component$ What is the name of your component? BigPanel$ What is the description? A very big panel$ Does the component view have a model? yes
The following file structure is created
components/- BigPanel.ux- BigPanel.js
The View will be auto-linked to the Model via:
If you answer
Slush is a tool that uses Gulp for project scaffolding.
Slush does not contain anything "out of the box", except the ability to locate installed slush generators and to run them with liftoff.
To find out more about Slush, check out the documentation.
See the CONTRIBUTING Guidelines
If you have any problem or suggestion please open an issue here.
The MIT License
Copyright (c) 2016, Kristian Mandrup
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.