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

Update Expressjs dependency to 4.x #628

Open
xgenvn opened this issue Jun 7, 2014 · 15 comments
Open

Update Expressjs dependency to 4.x #628

xgenvn opened this issue Jun 7, 2014 · 15 comments

Comments

@xgenvn
Copy link

xgenvn commented Jun 7, 2014

I have a question about compoundjs that will maintainers consider upgrading to expressjs 4.x on roadmap?
I'm looking for fresh framework which is using expressjs 4.x but seems most of them stay using 3.x.

Thank you.

@qfox
Copy link
Contributor

qfox commented Jun 9, 2014

same here.

@xpepermint
Copy link

+1

@alexbaumgertner
Copy link

/cc @xgenvn @zxqfox @xpepermint
Maybe we can help to upgrading to expressjs 4.x? Lets offer this to maintainer :)

@anatoliychakkaev
Copy link
Collaborator

Maintainer don't mind unless you didn't break everything ;) But as far as I
know express 4.0 changes it shouldn't be big problem.

On 9 July 2014 19:44, Alex Baumgertner [email protected] wrote:

/cc @xgenvn https://github.com/xgenvn @zxqfox
https://github.com/zxqfox @xpepermint https://github.com/xpepermint
Maybe we can help to upgrading to expressjs 4.x? Lets offer this to
maintainer :)


Reply to this email directly or view it on GitHub
#628 (comment).

@qfox
Copy link
Contributor

qfox commented Jul 10, 2014

@alexbaumgertner sure, let's do it.

@qfox
Copy link
Contributor

qfox commented Jul 12, 2014

@alexbaumgertner Alex, I have 2 days to work on it. Can you share your work if you started already?

@alexbaumgertner
Copy link

I have weekends to work for it. But I am not very familiar with expressjs and compoundjs, am learning these at the time.

@sachinik19
Copy link

+1

@keeneym
Copy link

keeneym commented Sep 10, 2014

I have migrated a few different internal services to 4.x. I found this article very helpful: http://strongloop.com/strongblog/express-3-to-4-migration-guide/

@jfremy
Copy link
Contributor

jfremy commented Jan 11, 2015

For those interested I have an updated version that so far seems to be working fine with express 4. It's at https://github.com/jfremy/compound/tree/express4.
The only thing I had to modify was the logic in injectMiddleware which does not work with express 4 + the template files to load the mw that are not included with express 4.

NOTE: if you use ejs, know that ejs 2.0 seems to be breaking with compound. So in your package.json, set it to use ejs 1.0.

To test on an existing application:

  • update your package.json to use git+https://github.com/jfremy/compound.git#express4
  • update your package.json to use express 4.x
  • add to your app's package.json the MW that were removed from express: body-parser, cookie-parser, errorhandler, express-session, method-override
  • update your app's environment.js and config/environment/*.js to be express 4 compatible (meaning, load the MW that are not included in express and use them and replace the use of app.configure by an if). You can check the template ones in my compound repo for guidelines.

To test on a new app:

If there is not negative feedback, I'll submit a pull request

@alexiskattan
Copy link

Yeah ejs 2.0 is bringing down the whole shabang. I just found that out after hours and hours of poking around. Any idea why?

@alexiskattan
Copy link

also the npm
"engines": {
"node": "0.10.*",
"npm": "1.4.x"
},

npm can't be upgraded to 2.1.X

Any ideas?

@alexiskattan
Copy link

one other thing, there is an issue with cached js/css
could you add this fix to your repository?
https://github.com/sagish/compound/commit/6986033a53838721ec84f0b3ff0205fd486d37c8

@jfremy
Copy link
Contributor

jfremy commented Jan 15, 2015

My express 4 branch has a fix for compound or you can check my pull request to compound that contains only the fix.
#646

The issue is that render was calling next in the wrong place. In the case of synchronous operations in the template engine, it worked ok, but now that ejs has introduced some level of asynchrony, it failed.

@jfremy
Copy link
Contributor

jfremy commented Feb 26, 2015

sorry for the delay but cached js/css bugfix is in

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

No branches or pull requests

9 participants