The option nodeFlags
was renamed to v8flags
for accuracy. It can now be a callback taking method that yields an array of flags, or an array literal.
For the environment passed into the launch
callback, configNameRegex
has been renamed to configNameSearch
. It now returns an array of valid config names instead of a regular expression.
The method signature for launch
was changed in this version of Liftoff.
You must now provide your own options parser and pass your desired params directly into launch
as the first argument. The second argument is now the invocation callback that starts your application.
To replicate the default functionality of 0.10, use the following:
const Liftoff = require('liftoff');
const MyApp = new Liftoff({name:'myapp'});
const argv = require('minimist')(process.argv.slice(2));
const invoke = function (env) {
console.log('my environment is:', env);
console.log('my cli options are:', argv);
console.log('my liftoff config is:', this);
};
MyApp.launch({
cwd: argv.cwd,
configPath: argv.myappfile,
require: argv.require,
completion: argv.completion
}, invoke);
# 1.0.0 -> 2.0.0 The option `nodeFlags` was renamed to `v8flags` for accuracy. It can now be a callback taking method that yields an array of flags, **or** an array literal. # 0.11 -> 0.12 For the environment passed into the `launch` callback, `configNameRegex` has been renamed to `configNameSearch`. It now returns an array of valid config names instead of a regular expression. # 0.10 -> 0.11 The method signature for `launch` was changed in this version of Liftoff. You must now provide your own options parser and pass your desired params directly into `launch` as the first argument. The second argument is now the invocation callback that starts your application. To replicate the default functionality of 0.10, use the following: ```js const Liftoff = require('liftoff'); const MyApp = new Liftoff({name:'myapp'}); const argv = require('minimist')(process.argv.slice(2)); const invoke = function (env) { console.log('my environment is:', env); console.log('my cli options are:', argv); console.log('my liftoff config is:', this); }; MyApp.launch({ cwd: argv.cwd, configPath: argv.myappfile, require: argv.require, completion: argv.completion }, invoke); ```
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 19553 | swellard | Move and rename clients | ||
//guest/perforce_software/helix-web-services/main/source/clients/2016.1.0/javascript/node_modules/liftoff/UPGRADING.md | |||||
#1 | 18810 | tjuricek |
First-pass at JavaScript client SDK. JavaScript requires Node with Gulp to "browserfy" the library. It's the easiest way I found to use the swagger-js project; bundle up a wrapping method. There is no JavaScript reference guide. The swagger-js doesn't really document what they do very well, actually. Overall I'm not particularly impressed by swagger-js, it was hard to even figure out what the right method syntax was. We may want to invest time in doing it better. This required setting CORS response headers, which are currently defaulted to a fairly insecure setting. |