-
Notifications
You must be signed in to change notification settings - Fork 398
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
Merge project with socket-controllers #106
Comments
Actually, it's not a library but framework 😉 IoC and other blah blah definitions. I'm into cooperation of routing- and socket-controllers but I'm not sure about merging this together. They are designed for different purposes and I can't imagine that you force koa users to get routing-controllers from npm together with sockets like you don't want to set express and koa as dependencies in package.json. I see only one use-case scenario with integration - mixed controllers. Not mixed parameters in class methods (it makes no sense) but one controller with REST API methods for HTTP and socket endopoint for push notification about changes from other users on this resource. I'm not sure how much routing-controllers and socket-controllers codebases have in common and how to detect which method belong to which "library" - additional decorator is an inelegant solution, looks as bad as separate controllers. |
Guys I'm new here, fascinated by routing-controllers (my god @pleerock you are one magnificent sir for doing ORM like Doctrine and this controllers with decorators in TypeScript) and going to use it in the nearest projects, but what is socket-controllers? Where are they? |
@idchlife there you are this lib to use socket.io library with decorators |
Oh, thanks! About topic, I guess one way is not to merge them making "routing+socket-controlles" but to create third library that will provide functionality for making a project with just choosing dependency like express or koa under the hood, allowing you to use it like a standalone framework for building projects. Maybe even with DI and TypeORM already attached/installed, for more convenient way to create projects using TypeScript + decorators at full power. Because not everyone needs sockets with common routing or routing with sockets. That's why there are 2 separate libraries that for different functionality. |
there is now discussion about complete framework (you can find sample here which contains everything-in-one.
thats something very hard to achieve. Because sometimes people need, sometimes they not... There is multer, session and some libraries used by this lib, but sometimes people don't need uploading. Even if I merge socket controllers into routing controllers in a separate framework - same question arrises there - maybe not all people need that. |
But they are hidden peer dependencies - you are not forced to install it if you don't use it. But there must be some code in I don't mind about extension to integrate sockets into
There is a difference between framework like Angular or TypeStack, which are a collection of libs which cooperate together to help build big app, and IoC libraries aka framework like routing-controllers which focus only on one part of the app/technology. It's not a problem to deliver the gorilla and the entire jungle but it's bad when user only want the banana. |
I'm fine with either an extension or merge. I've been longing for some sort of bridge between socket.io and routing controller. #100 |
I decided not to merge them for now. Plan is to allow typestack cli to generate project with or without socket-controllers enabled. |
Is there an example that uses both these? I am using the below code sample
Socket.io gives a 404 for the above configuration. If I remove router controllers it works fine. |
specify |
@pleerock I specified it (earlier I manually imported it before XMLHttpRequest cannot load http://localhost:9000/socket.io/?id=83&EIO=3&transport=polling&t=LoXMf_w. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4300' is therefore not allowed access. The response had HTTP status code 404. |
I figured out the mistake I made. Posting the answer to anyone who encounters it. The mistake I made was assigning the express instance returned by
|
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I have a plans to merge into this library socket-controllers library. Your thoughts about this decision? adding @19majkel94
The text was updated successfully, but these errors were encountered: