Skip to content
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

Streaming #15

Closed
gustavnikolaj opened this issue Apr 9, 2015 · 6 comments
Closed

Streaming #15

gustavnikolaj opened this issue Apr 9, 2015 · 6 comments

Comments

@gustavnikolaj
Copy link
Contributor

Hi!

I just merged a pull-request in express-jsxtransformer from @fer8a. This module looks very nice and solves the problem that express-highjackresponse solves in a much prettier way. There's only one problem, and that is the lack of support for streaming.

It's not a problem for modules like express-jsxtransformer, as that is buffering up stuff any way, but it would be nice to see it solved.

Do you have any plans about supporting streaming as well?

/cc @papandreou

@flockonus
Copy link
Contributor

Hi @gustavnikolaj, glad you enjoyed, having a solid and simple use case was our main goal.

The package we've been developing that motivated interceptor also does buffering (we need the whole HTML and change it at once) but definitely streaming can make a strong use case, and thinking of the internals it seems possible, some suggestion on the API for it?

Also, in case you are using ZenHub we are experimenting with prioritizing issues using +1 :)

@gustavnikolaj
Copy link
Contributor Author

As for the API I'd wish that it could be as simple as adding another method, along side intercept, called interceptStream. But I'm not sure that would be enough.

livestyle which @Munter mentioned in #6 uses the streaming functionality of express-hijackresponse, to inject a script tag in html.

I cannot see if it would fit into how you're doing things, or if you need the kind of granular control that express-hijackresponse gives you.

@gustavnikolaj
Copy link
Contributor Author

I will humbly plug my own module here, https://github.com/gustavnikolaj/hijackresponse, which is the spiritual successor to express-hijackresponse. It works much in the same way, and allows you to solve the more demanding problems that the abstraction in express-interceptor does not let you get into.

I think that there's room for both modules, as express-interceptor might be a lot simpler to get into for people with less demanding use cases. And I can't really see how we could provide people with the power of hijackresponse, while keeping the abstraction simple in express-interceptor.

@p1nox
Copy link
Contributor

p1nox commented Feb 3, 2016

You're totally right @gustavnikolaj, I think both modules can coexists. The idea of express-interceptor is to provide a simple api for the most common scenarios.

I'll be adding hijackresponse to our readme file, explaining differences between both modules.

@p1nox
Copy link
Contributor

p1nox commented Apr 3, 2016

@gustavnikolaj a link to your module and a recommendation if users have problems with streaming was added to our readme 👍. Closing this for now.

@p1nox p1nox closed this as completed Apr 3, 2016
@gustavnikolaj
Copy link
Contributor Author

@p1nox Thanks. express-hijackresponse is sort of deprecated now that hijackresponse is out. It's the exact same API, but without monkey patching the response object. :-) https://github.com/papandreou/express-hijackresponse#deprecation-notice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants