-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
0.9: Add backwards compatibility for Sails 0.8.x/Express 2.x apps #494
Comments
Unfortunately, it isn't quite as simple as plugging express-partials in. Some gaps exist in that module at the moment. For ejs, https://github.com/RandomEtc/ejs-locals works great, but that doesn't cover us for all views. Does anyone have any thoughts on a good default behavior here? Based on the use cases I've worked with, continuing to support a layout file would be ideal. |
This is now solved for ejs with some help from ejs-locals. Jade has built-in support. I think that's probably good enough to start with, but handlebars really ought to go in asap. |
This works. At least for EJS. I think |
This is working for EJS- needs verification for Jade and other view engines. Ideally, we can leverage the conslidate dependency in express (https://github.com/visionmedia/consolidate.js) |
I've create a thread about it on the google group, if you wish to have some user feedback, so far people are mostly asking for handlebars then for jade. |
Express 3 removed the built-in concept of a view partial. This makes sense, because it's more versatile. But it also sucks a little bit if you're trying to upgrade your app.
This is solve-able in a general way, haven't figured out the details yet- particularly since there are so many different view engines in use. Likely, the first pass will be backwards compatibility for ejs and possibly jade. Apps using other view engines will have to migrate to Express 3 themselves (remove the layout file) or use community-contributed Express middleware to simulate the same effect.
More information:
tj/ejs#35
The text was updated successfully, but these errors were encountered: