KO
|
EN
gitlite — search
Search
#python
#java
#python3
#arduino
#golang
#machine-learning
#rust
#html
#flask
#javascript
#seismology
#nodejs
recipe
★ 10
Open GitHub ↗
Cook your javascript with recipe.js
Download README (.md)
Explore Similar Repositories
rete
:
Clojure RETE implementation
SimpleMouseTracker
:
Simple Mouse Tracker
travisminer
:
Data extraction and mining scripts for Travis CI data
NEM-VersionChecker
:
NotEnoughMods Mod Version Checker -- Continued by NotEnoughMods themselves! :) See the link:
leaflet-rails-example
:
example app for leaflet embed in rails A
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
recipe
?
Download (.md)
# Cook your javascript with recipe.js[](https://travis-ci.org/sideroad/recipe)[](https://bitdeli.com/free "Bitdeli Badge")[](http://gruntjs.com/) ## Overview - Resolving libraries dependencies (Such as AMD, But It does not use `define` API) - Avoiding browser cache without using cache manifest when you update libraries - Multiple charset setting for each script - Parallel script downloads for web performance. This feature was realized by `head.js` ## Prepare to cook ### Preparing dependencies, version script Before using this plugins, please install [grunt-recipe](https://github.com/sideroad/grunt-recipe/) then make recipe.version.js, recipe.dependencies.js ### Preparing menu for each page #### recipe(options) |Key|Type|Value| |---|----|-----| |libraries|Array<String>|libraries namespace list| |scripts|Array<String>|scripts URL list| |amd|Boolean|Use AMD loading| recipe function return `Deferred` object. `then` function call after all libraries, scripts were loaded ```js recipe({ libraries: [ "fettuccine.alfredo", "acqua.pazza" ], scripts: [ "path/to/script.js" ] }).then(function(){ console.log("Dig in!"); }); ``` Please append `#${charset}` into scripts path, if you want to load script with specified charset. example below ```js recipe({ libraries: [ "fettuccine.alfredo", "acqua.pazza" ], scripts: [ "path/to/script.js#utf-8" ] }).then(function(){ console.log("Dig in!"); }); ``` ### Deploy recipe, version, dependencies and menu scripts |Name |Role |Notice | |-----------------|------------|-----------------------------| |recipe.js |Core library| | |recipe.version.js|Version file|Update version when you release libraries or script for avoiding browser cache | |recipe.dependencies.js|Defining dependencies file|Update dependencies when adding library, changing dependencies | |recipe.amd.dependencies.js|Defining AMD dependencies file|Update dependencies when adding library, changing dependencies | Required: Release your menu files, recipe.js, recipe.version.js, recipe.dependecies.js and recipe.amd.dependencies.js onto same directory. ### Embedded on recipe.js ```html <script charset="UTF-8" src="path/to/recipe.js" data-menu="${name_of_menu}" async="true" ></script> ``` Please set `data-menu` attribute with menu name without extention just like `fettuccine.alfredo`, if your menu file is `fettuccine.alfredo.js`. ## Loading Flow  - recipe.js get version file with random value parameter into request for avoiding cache. this is single point always requested without cache. - recipe.js get dependencies file with version parameter. - recipe.js get menu file. After that, recipe.js resolve libraries dependencies by given options. - recipe.js load libraries and scripts with version parameter. - recipe.js call `then` function