-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
transform-middleware for webrequests #9
Comments
https://www.npmjs.com/package/xhook <-- Im going to experiment to see if i can inject this into an agent. |
There are a couple of important details that may decide the scope of this problem. There are currently 3 types of network requests:
I am guessing this is about the 3rd item only. In this case I think the spec should somehow tie into If this is the case (if it's about multiplexed fetch + processing), couldn't we write a custom action to do something like this? For example we can create a custom action like
Above One could call this in the following manner using
This approach wouldn't require any additional code on Jasonette side, but you can implement the entire logic as just a JSON markup and reuse it everywhere (maybe even turn it into mixins) What I thought was interesting about the idea you shared in the chatroom was the possibility of fetching multiple sources and processing them into a single result. But upon thinking about this more, I think we might be able to take the same approach as above and use $require instead of Are there any other cases I missed out? Also please let me know what you think. |
Hm this seems to be a better approach. aggregation of dataJasonette seems to already support aggregation of data using $require and mixins.
Not really sure how to bundle/pipeline several requests into one.
|
This is an idea from the slackchat:
A simple middleware pattern could allow all jasonette-clients (web/ios/android) to aggregate or transform incoming data and/or outgoing data.
Usecases
Example middleware in jasonette json
This is just thinking out loud, and can probably be improved a LOT
Basic idea
Considerations
Im curious about your feedback, and I'm definately not sure whether we should pursue this path.
reasons to not support it
Sometimes deciding not to write a feature can be also be a huge blessing.
All the logic above could also be written as a proxy-api server-implementation, instead of a client implementation..
reasons to support it
These days all focus is rather on the frontend, that's where the money is.
Therefore flexible transformation-features of i/o can be very attractive, all power to the frontend-dev.
CRUD Server-development seems to be a necessary evil these days (imho), preferrably abstracted away by phrases like 'serverless','apaas' etc.
The text was updated successfully, but these errors were encountered: