[aerogear-dev] pipeline node.js experiment

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[aerogear-dev] pipeline node.js experiment

Luke Holmquist

Last week i decided to start playing around with converting the AeroGear.js Pipeline library to run in node.js

I thought this would be a good place to start when thinking about how ES6 modules work, and how the code would need to be structured.

This is no doubt a WIP, but have a look see here:

https://github.com/lholmquist/aerogear-pipeline

currently it only deals in JSON

For usage checkout the tests. The Usage should be similar but since this is node.js, i’m following some of their conventions for how they do callbacks. The convention is to have a callback where the first argument is the err

an example read:

pipe.read({ id: 1 }, function(err, data, response) {
});

or to read all

pipe.read(function (err, data, response) {
});

and since this is just wrapping a http.request, it will also emit any events the http.request emits

For those wondering about my code style here, i’ve adapted the style from the yeoman project, with 1 difference, 4 spaces instead of 2

I'm not sure what part of the library could be next, datamanager might not make sense here since there is no "client side" storage per say.

I have a WIP implentation of a SimplePush client here: https://github.com/lholmquist/aerogear-simplepush-node-client

Thoughts?


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] pipeline node.js experiment

tolis emmanouilidis
looks great

+1 for using some conventions of npm code styling

It would be nice to follow one more npm-code-style convention about callbacks, which says that the callback is always the last argument in the list. It will be easier for users to use our API and it improves consistency.


2014-05-27 17:27 GMT+03:00 Lucas Holmquist <[hidden email]>:

Last week i decided to start playing around with converting the AeroGear.js Pipeline library to run in node.js

I thought this would be a good place to start when thinking about how ES6 modules work, and how the code would need to be structured.

This is no doubt a WIP, but have a look see here:

https://github.com/lholmquist/aerogear-pipeline

currently it only deals in JSON

For usage checkout the tests. The Usage should be similar but since this is node.js, i’m following some of their conventions for how they do callbacks. The convention is to have a callback where the first argument is the err

an example read:

pipe.read({ id: 1 }, function(err, data, response) {
});

or to read all

pipe.read(function (err, data, response) {
});

and since this is just wrapping a http.request, it will also emit any events the http.request emits

For those wondering about my code style here, i’ve adapted the style from the yeoman project, with 1 difference, 4 spaces instead of 2

I'm not sure what part of the library could be next, datamanager might not make sense here since there is no "client side" storage per say.

I have a WIP implentation of a SimplePush client here: https://github.com/lholmquist/aerogear-simplepush-node-client

Thoughts?


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] pipeline node.js experiment

Sebastien Blanc
Nice !
For the datamanager, it would make sense if we had adapters for "backend" persistence solution and that would be a fantastic library ;)



On Tue, May 27, 2014 at 5:23 PM, tolis emmanouilidis <[hidden email]> wrote:
looks great

+1 for using some conventions of npm code styling

It would be nice to follow one more npm-code-style convention about callbacks, which says that the callback is always the last argument in the list. It will be easier for users to use our API and it improves consistency.


2014-05-27 17:27 GMT+03:00 Lucas Holmquist <[hidden email]>:

Last week i decided to start playing around with converting the AeroGear.js Pipeline library to run in node.js

I thought this would be a good place to start when thinking about how ES6 modules work, and how the code would need to be structured.

This is no doubt a WIP, but have a look see here:

https://github.com/lholmquist/aerogear-pipeline

currently it only deals in JSON

For usage checkout the tests. The Usage should be similar but since this is node.js, i’m following some of their conventions for how they do callbacks. The convention is to have a callback where the first argument is the err

an example read:

pipe.read({ id: 1 }, function(err, data, response) {
});

or to read all

pipe.read(function (err, data, response) {
});

and since this is just wrapping a http.request, it will also emit any events the http.request emits

For those wondering about my code style here, i’ve adapted the style from the yeoman project, with 1 difference, 4 spaces instead of 2

I'm not sure what part of the library could be next, datamanager might not make sense here since there is no "client side" storage per say.

I have a WIP implentation of a SimplePush client here: https://github.com/lholmquist/aerogear-simplepush-node-client

Thoughts?


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] pipeline node.js experiment

Luke Holmquist
In reply to this post by tolis emmanouilidis

On May 27, 2014, at 11:23 AM, tolis emmanouilidis <[hidden email]> wrote:

looks great

+1 for using some conventions of npm code styling

It would be nice to follow one more npm-code-style convention about callbacks, which says that the callback is always the last argument in the list. It will be easier for users to use our API and it improves
consistency.

+1, and it might do that sort of already,  but maybe not  :)



2014-05-27 17:27 GMT+03:00 Lucas Holmquist <[hidden email]>:

Last week i decided to start playing around with converting the AeroGear.js Pipeline library to run in node.js

I thought this would be a good place to start when thinking about how ES6 modules work, and how the code would need to be structured.

This is no doubt a WIP, but have a look see here:

https://github.com/lholmquist/aerogear-pipeline

currently it only deals in JSON

For usage checkout the tests. The Usage should be similar but since this is node.js, i’m following some of their conventions for how they do callbacks. The convention is to have a callback where the first argument is the err

an example read:

pipe.read({ id: 1 }, function(err, data, response) {
});

or to read all

pipe.read(function (err, data, response) {
});

and since this is just wrapping a http.request, it will also emit any events the http.request emits

For those wondering about my code style here, i’ve adapted the style from the yeoman project, with 1 difference, 4 spaces instead of 2

I'm not sure what part of the library could be next, datamanager might not make sense here since there is no "client side" storage per say.

I have a WIP implentation of a SimplePush client here: https://github.com/lholmquist/aerogear-simplepush-node-client

Thoughts?


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] pipeline node.js experiment

Lukas Fryc
Hey Luke,

speaking about ES6, have you considered to adopt Promises in Pipes as well? :-)

...read().then().catch() obsession


On Tue, May 27, 2014 at 5:29 PM, Lucas Holmquist <[hidden email]> wrote:

On May 27, 2014, at 11:23 AM, tolis emmanouilidis <[hidden email]> wrote:

looks great

+1 for using some conventions of npm code styling

It would be nice to follow one more npm-code-style convention about callbacks, which says that the callback is always the last argument in the list. It will be easier for users to use our API and it improves
consistency.

+1, and it might do that sort of already,  but maybe not  :)



2014-05-27 17:27 GMT+03:00 Lucas Holmquist <[hidden email]>:

Last week i decided to start playing around with converting the AeroGear.js Pipeline library to run in node.js

I thought this would be a good place to start when thinking about how ES6 modules work, and how the code would need to be structured.

This is no doubt a WIP, but have a look see here:

https://github.com/lholmquist/aerogear-pipeline

currently it only deals in JSON

For usage checkout the tests. The Usage should be similar but since this is node.js, i’m following some of their conventions for how they do callbacks. The convention is to have a callback where the first argument is the err

an example read:


pipe.read({ id: 1 }, function(err, data, response) {
});

or to read all


pipe.read(function (err, data, response) {
});

and since this is just wrapping a http.request, it will also emit any events the http.request emits

For those wondering about my code style here, i’ve adapted the style from the yeoman project, with 1 difference, 4 spaces instead of 2

I'm not sure what part of the library could be next, datamanager might not make sense here since there is no "client side" storage per say.

I have a WIP implentation of a SimplePush client here: https://github.com/lholmquist/aerogear-simplepush-node-client

Thoughts?


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] pipeline node.js experiment

Luke Holmquist

On May 27, 2014, at 2:43 PM, Lukáš Fryč <[hidden email]> wrote:

Hey Luke,

speaking about ES6, have you considered to adopt Promises in Pipes as well? :-)

...read().then().catch() obsession

i do,  but i wanted to wait until we got rid of the jQuery dependency for the browser lib first

for the node.js version,  it can happen anytime 

:)



On Tue, May 27, 2014 at 5:29 PM, Lucas Holmquist <[hidden email]> wrote:

On May 27, 2014, at 11:23 AM, tolis emmanouilidis <[hidden email]> wrote:

looks great

+1 for using some conventions of npm code styling

It would be nice to follow one more npm-code-style convention about callbacks, which says that the callback is always the last argument in the list. It will be easier for users to use our API and it improves
consistency.

+1, and it might do that sort of already,  but maybe not  :)



2014-05-27 17:27 GMT+03:00 Lucas Holmquist <[hidden email]>:

Last week i decided to start playing around with converting the AeroGear.js Pipeline library to run in node.js

I thought this would be a good place to start when thinking about how ES6 modules work, and how the code would need to be structured.

This is no doubt a WIP, but have a look see here:

https://github.com/lholmquist/aerogear-pipeline

currently it only deals in JSON

For usage checkout the tests. The Usage should be similar but since this is node.js, i’m following some of their conventions for how they do callbacks. The convention is to have a callback where the first argument is the err

an example read:

pipe.read({ id: 1 }, function(err, data, response) {
});

or to read all

pipe.read(function (err, data, response) {
});

and since this is just wrapping a http.request, it will also emit any events the http.request emits

For those wondering about my code style here, i’ve adapted the style from the yeoman project, with 1 difference, 4 spaces instead of 2

I'm not sure what part of the library could be next, datamanager might not make sense here since there is no "client side" storage per say.

I have a WIP implentation of a SimplePush client here: https://github.com/lholmquist/aerogear-simplepush-node-client

Thoughts?


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev