Skip to content

Make v0.3.2 compatible with connect #28

Closed
pksunkara opened this Issue Jun 8, 2012 · 10 comments

3 participants

@pksunkara

Current union@0.3.0 is compatible with connect master. v0.3.2 is not. Find out why and fix it.

@jfhbrook
jfhbrook commented Jun 8, 2012

Can you elaborate on "incompatible with connect master" ? There are a lot of ways union could be incompatible.

@pksunkara

All the following connect middlewares do not work with union v0.3.2 (they work with union v0.3.0)

  • bodyParser
  • json
  • multipart
  • urlencoded
@jfhbrook
jfhbrook commented Jun 8, 2012

Does union have tests for these? That would certainly help ensure a lack of breakage in the future.

@pksunkara

http://github.com/pksunkara/connect-union, which is a fork of connect, replaces the connect server in their test suite with union, thus testing union compatibility with each and every connect middleware

@jfhbrook
jfhbrook commented Jun 8, 2012

So why isn't this part of our test suite?

@pksunkara

Because maintaining it becomes a very difficult task, as it constantly needs to be updated from connect and union shim needs to be applied. me and @dscape discussed over it and decided to leave it in a seperate repository.

@jfhbrook
jfhbrook commented Jun 8, 2012

Okay, that makes sense, but what about running those tests as part of the test suite?

@indexzero
a decoupled application framework member

@pksunkara Can you provide empirical evidence for your claims? I'm seeing test/body-parser-test.js pass:

$ vows test/body-parser-test.js --spec

♢ union/body-parser

  When using union with connect bodyParser() a request to /
    ✓ should respond with a body-decoded object

✓ OK » 1 honored (0.016s)

Tested with connect@2.3.2

@pksunkara

After extensive testing by me, I finally found what the problem was. In my http://github.com/pksunkara/connect-union tests, I didn't provide buffer: false to the server. I assume some logic for that has changed between v0.3.0 and v0.3.2.

It should be documented that for union to be compatible with connect, we need to set buffer to false

@pksunkara pksunkara closed this Jun 11, 2012
@pksunkara

But, if we are going to use connect with flatiron and union@0.3.2, we will get errors because buffer is not set to false in http://github.com/flatiron/flatiron/blob/master/lib/flatiron/plugins/http.js#L74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.