Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

feat(core): Use ngStrictDi in production #1302

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/lib/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var config = require('../config'),
*/
module.exports.initLocalVariables = function (app) {
// Setting application local variables
app.locals.env = process.env.NODE_ENV;
app.locals.title = config.app.title;
app.locals.description = config.app.description;
if (config.secure && config.secure.ssl === true) {
Expand Down
2 changes: 1 addition & 1 deletion modules/core/server/views/layout.server.view.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html lang="en" {% if env === "production" %}ng-strict-di{% endif %}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a downside to not having this turned on all the time. Is there?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ilanbiala Wouldn't work if you use ngAnnotate? (I saw a PR at some point for that but not sure if it's already included)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ilanbiala right now ngAnnotate is only being used in build task for production so I kept ngStrictDi only for production otherwise it will break.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could just annotate in development too, which I'm not opposed to. Honestly I think ngStrictDi would prevent errors in production if we also check it in development.

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
Expand Down