-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Conversation
"no-console": "off", | ||
|
||
// Removed rule "disallow multiple spaces in regular expressions" from recommended eslint rules | ||
"no-regex-spaces": "off", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for all those exceptions?
"plugins": [ | ||
"promise" | ||
], | ||
"extends": "eslint:recommended", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we not use our rules but extend the recommended preset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are auto-generated by Firebase and I didn't bother to review them, tbh
Can we extend our rules / preset and still allow ES6 stuff? Because we don't allow that for our scripting stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should allow ES6 for our Node.js stuff in general now that we run the build in Node 8.
Is just the ESLint config generated by Firebase or the whole code in this directory? If the latter then just add "root": true
to .eslintrc.json
so that it doesn't inherit our config.
b5a07a8
to
1892b18
Compare
Gruntfile.js
Outdated
@@ -316,10 +316,10 @@ module.exports = function(grunt) { | |||
files: [ | |||
// the zip file should not be compressed again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commends needs updating now 😃
Gruntfile.js
Outdated
@@ -356,7 +356,7 @@ module.exports = function(grunt) { | |||
options: { | |||
mode: 'gzip' | |||
}, | |||
src: ['**', '!*.zip'], | |||
src: ['**', '!**/*.{zip,png,jpeg,jpg}'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the **/
part needed? It doesn't seem so 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but aren't the patterns exclusive? So if I do !*.{zip,..
doesn't that only affect files in the first folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, I thought the strings would be concatenated to create a pattern 😥
Gruntfile.js
Outdated
dest: 'uploadDocs/', | ||
dest: 'deploy/docs/', | ||
expand: true | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops, extra expand: true}
😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra as in "this is not needed"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You had
expand: true
}
expand: true
}
Fixed on the subsequent commit, though.
Gruntfile.js
Outdated
@@ -165,7 +167,8 @@ module.exports = function(grunt) { | |||
tmp: ['tmp'], | |||
deploy: [ | |||
'deploy/docs', | |||
'deploy/code' | |||
'deploy/code', | |||
docsScriptFolder + '/functions/html' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be /functions/content
?
(BTW, it might make sense to put some constants that we share accross files into an external file and import that.)
@@ -0,0 +1,4265 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does firebase take this into account?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. Firebase started the npm install process when I ran firebase init functions. And npm tells you to commit the lock file, so I did :D
"name": "functions", | ||
"description": "Cloud Functions for Firebase", | ||
"scripts": { | ||
"lint": "./node_modules/.bin/eslint .", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need the ./node_modules/.bin/
prefix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was also auto-generated by firebase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So? 😛
Both npm
and yarn
will add node_modules/.bin/
to the PATH when executing npm scripts. The current syntax does not run on Windows 😞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It runs on Windows with Git Bash! 👅
# Serving locally: | ||
|
||
- Run `grunt:prepareDeploy`. | ||
This copies docs content files are into deploy/docs and the partials for Search Engine AJAX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
files are into --> files into
"logs": "firebase functions:log" | ||
}, | ||
"dependencies": { | ||
"firebase-admin": "~5.8.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Firebase auto-generates this file when you init the functions, so I'd rather not touch it
'use strict'; | ||
|
||
const functions = require('firebase-functions'); | ||
const path = require('path'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused.
1892b18
to
538f352
Compare
I've now allowed es6 for all our node js scripts |
.eslintrc-node.json
Outdated
}, | ||
"parserOptions": { | ||
// Required for certain syntax usages | ||
"ecmaVersion": 6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's change it to 2017
as Node 8 already supports it: https://kangax.github.io/compat-table/es2016plus/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
This commit restores serving the plain partials (content) when a docs page is accessed with ?_escaped_fragment_=. The Google Ajax Crawler accesses these urls when the page has `<meta type="fragment" content="!">` is set. During the migration to Firebase, this was lost, which resulted in Google dropping the docs almost completely from the index. We are using a Firebase cloud function to serve the partials. Since we cannot access the static hosted files from the function, we have to deploy them as part of the function directory instead, from which they can be read. Related to angular#16432 Related to angular#16417
538f352
to
ab0675b
Compare
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change?
Please check if the PR fulfills these requirements
Other information: