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

0.9: Add backwards compatibility for Sails 0.8.x/Express 2.x apps #494

Closed
mikermcneil opened this issue Jun 26, 2013 · 6 comments
Closed
Milestone

Comments

@mikermcneil
Copy link
Member

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

@mikermcneil
Copy link
Member Author

@mikermcneil
Copy link
Member Author

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.

@mikermcneil
Copy link
Member Author

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.

@mikermcneil
Copy link
Member Author

This works. At least for EJS. I think

@mikermcneil
Copy link
Member Author

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)

@Vadorequest
Copy link

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.

https://groups.google.com/forum/#!topic/sailsjs/DfNoEzPFpwM

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

No branches or pull requests

2 participants