![]() ![]() Of course, sometimes this is not always possible. To make most use of domains, try to not duplicate work and note code under dom/ can be required on the server from the lib directory.įor that reason, you may want this code to stay browser agnostic. If they are, however, they will pull in the dependencies (althoug only from this domain) they need to operate. It will not append the files to the output, unless any of them have been required from the client. The domain method is set, modul8 will add a domain for named after the plugin (specified in name). It is recommended to put all these files within a dom subdirectory of your node module lib root. If a domain is exported, it should be clear on the server what files are available to the client by looking at the directory structure of the plugin. The domain method must return a path corresponding to the root of the exporting domain. If a string is passed from data it will be assumed to be a pre-serialized object that evaluates so something sensible via eval.Īnything else will be internally serialized for you with eirther JSON.stringify or. The data method must return an object or a pre-serialized object/array to attach to the data domain. This name should be configurable from the class constructor to avoid clashes, but it should default to the plugin name. It will specify the name of the key exported to the data domain (if it exports data), as well as the name of the domain exported to (if it exports behaviour). The name key must be specified and have a default indicating the name used by the plugin. The skeleton of such a plugin class should look something like this in CoffeeScriptĬonstructor : number, = number | 0 # force to ?= 'inessential param' ![]() ![]() Writing PluginsĪ plugin can export as many things as it wants to be used on the server, but it needs a class instance of a particular format to be compatible with modul8. See the project itself for more information. The mongoose plugin will export sanitized versions of your explicitly exported mongoose models, along with helpers Logic that should be reused on the client. Mongoose in the BrowserĪ way to use mongoose models on the server to generate validation logic on the client.Ī web application using mongodb as its backend and using mongoose as an ORM layer on the server ends up defining a lot of validation logic on the server. See the project itself for more information and sample model implementations. This module allows these states to simply synchronize with the server. If a web application wishes to store all its templates in localStorage, then they can become out of date with the server as they update there. Template Version Control SystemĪ simple version control system for web application templates. Plugins can also be loaded - albeit somewhat primitively - via the CLI Available PluginsĪ small current selection of available plugins follow. Note that all code that is exported by plugins have to be explicitly required to actually get pulled into the bundle. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |