Comments (9)
This is a good idea. I would need to bump the version number as this would be a breaking change.
We should probably review the API to see what other usability changes we can include if we're going to push out a major version upgrade.
from openwhisk-client-js.
support both for backward compatibility?
from openwhisk-client-js.
as long as we prefer xName
to name
... this should be sufficient, in terms of backwards compatibility? the only cases i can think of are those that, before, would result in an error, and now will not; e.g. ow.actions.create({name: 'foo'})
would before result in an error, and now succeed...
perhaps that is ok?
from openwhisk-client-js.
+1 that's better than breaking all the existing actions. since we just forced everyone to get off whisk.js would be nice not to make another forced change.
from openwhisk-client-js.
i just added a projection suggestion to the initial feature request comment (i.e. at the top). either ow.x.getXxx
or ow.x.get('foo', 'xxx')
if the former, i would start with any of the fields that are of array type. e.g. parameters for all entity types, plus actions packages.
from openwhisk-client-js.
Supporting Different Parameters
I'm going to support the resource identifiers returned by the platform API to chaining promises together. This will be name
in most examples but there are additional edge cases like activationId
.
I will maintain support for the existing parameter names for backwards capability.
Support String Parameters
I also might support passing in the identifier as a string, in addition to the object, to simplify simple invocations.
ow.actions.invoke('actionName')
Any objections?
Chaining Promises
Looking at the example above about chaining promises, it will encounter an issue that the API uses inheritance to share a base class and needs the lexical context bound to the invocation. Arrow functions will be needed to resolve this without resorting to function.bind
Promise.all(triggers.map(trigger => ow.triggers.invoke(trigger)))
I don't like the style of having a separate method for interacting with multiple resources. It feels cluttered to me.
I suggest supporting array parameters for the relevant resource methods, as shown here:
ow.actions.list()
.then(actions => ow.actions.invoke(actions))
.then(result => ...)
That seems to be a relatively clean way to support interacting with multiple resources without having to remember different API calls.
from openwhisk-client-js.
this all seems reasonable. thanks!
from openwhisk-client-js.
I've been refactoring the library to make supporting these features easier. id
is now supported along with the old style.
Remaining items.
- update docs with new features
- support string identifiers
- support array of identifiers
- verify changes with integration tests
from openwhisk-client-js.
This is now ready with v3.3.0.
from openwhisk-client-js.
Related Issues (20)
- main.d.ts (typescript declarations) are a missing some optional arguments HOT 1
- Remove `version` option from actions
- Integration tests are broken with feed testing failing.
- Update package dependencies to latest versions.
- Add CI/CD tools for NPM module dependency management. HOT 3
- CI/CD pipeline should test on all Node.js versions in runtime-nodejs
- Remove use of whisk.system packages in integration tests HOT 1
- result only action invokes are not setting proper query parameter
- blocking invoke that is demoted is not handled correctly HOT 1
- Error occurs in typescript project HOT 6
- Allow clients to override the namespace for the api gateway APIs
- Propagate __OW_TRANSACTION_ID when invoking actions
- Unable to create trigger with feed
- Unable to create web and web-secure action HOT 2
- OpenWhiskError message missing activation id HOT 1
- typings do not allow for nodejs:10 action kind HOT 1
- Typescript types incorrect: Missing 'main' property from Action.Exec
- service requests modify query string with every retry
- Missing parameter 'id' in actions.list()
- Please publish a new minor version 3.22.0 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openwhisk-client-js.