Added ES module bundle to the auth package#819
Added ES module bundle to the auth package#819bojeil-google merged 17 commits intofirebase:masterfrom
Conversation
|
Travis probably needs a retry. |
|
May I kindly ask for a review? |
|
Hey @merlinnot, thanks for your contribution. I reran the tests several times and they are all failing. Please fix and I can help review. |
|
I will take a look in the evening. |
|
Travis build: #818 (comment) |
Issue was caused by getting a PID of a command creation, rather than the command itself.
The new name should better reflect the purpose of a function.
|
@bojeil-google test are passing, I'd appreciate a review :) |
bojeil-google
left a comment
There was a problem hiding this comment.
Changes look good. I just have a bunch of requests for additional explanations and some style nits.
| "./node_modules/.bin" | ||
| "../../node_modules/.bin" | ||
| ) | ||
| function evalModule { |
There was a problem hiding this comment.
Declare javadoc or some guidance on this function's usage/signature.
| declare -a nodeModulesBasedirs=( | ||
| "./node_modules/.bin" | ||
| "../../node_modules/.bin" | ||
| ) |
There was a problem hiding this comment.
Add new line after this
packages/auth/gulpfile.js
Outdated
| }).call(typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : {});`; | ||
| const CJS_WRAPPER_PREFIX = `(function() {var firebase = require('@firebase/app').default;`; | ||
| const EMS_WRAPPER_PREFIX = `import firebase from '@firebase/app';(function() {`; | ||
| const WRAPPER_SUFFIX = `}).call(typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : {});`; |
There was a problem hiding this comment.
Line is too long. Split into multiple lines.
packages/auth/gulpfile.js
Outdated
|
|
||
| app.use('/node_modules', express.static(path.resolve(__dirname, '../../node_modules'))); | ||
| app.use( | ||
| '/node_modules', |
There was a problem hiding this comment.
indent 2 additional spaces. Style guide recommendations is to indent 4 spaces for function arguments that spill over to next line.
packages/auth/gulpfile.js
Outdated
| app.use('/node_modules', express.static(path.resolve(__dirname, '../../node_modules'))); | ||
| app.use( | ||
| '/node_modules', | ||
| express.static(path.resolve(__dirname, '../../node_modules')) |
There was a problem hiding this comment.
indent 2 additional spaces.
packages/auth/gulpfile.js
Outdated
| const closureLibRoot = path.dirname(require.resolve('google-closure-library/package.json')); | ||
| // Builds the core Firebase-auth JS. | ||
| const closureLibRoot = path.dirname( | ||
| require.resolve('google-closure-library/package.json') |
There was a problem hiding this comment.
indent 2 additional spaces.
packages/auth/gulpfile.js
Outdated
| } | ||
| })) | ||
| .pipe( | ||
| closureCompiler({ |
There was a problem hiding this comment.
indent entire block 2 additional spaces.
packages/auth/gulpfile.js
Outdated
| 'externs/grecaptcha.js', | ||
| 'externs/gapi.iframes.js', | ||
| path.resolve( | ||
| __dirname, |
There was a problem hiding this comment.
Both arguments need 2 additional spaces, here and below for each path.resolve(.
| const EMS_WRAPPER_PREFIX = `import firebase from '@firebase/app';(function() {`; | ||
| const WRAPPER_SUFFIX = `}).call(typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : {});`; | ||
|
|
||
| const wrap = through(function(file) { |
There was a problem hiding this comment.
Add comment or javadoc to explain what this function does.
|
Thanks for the review, gonna take care of it tomorrow. |
package's gulpfile.
|
@bojeil-google sorry for not aligning with a style guide, it's hard to match all of the criteria when you use other standards on a daily basis. I've fixed the issues you've mentioned and one additional call to align with the rule you've pointed out. |
bojeil-google
left a comment
There was a problem hiding this comment.
Thanks for making the changes! 2 more nits. You are right we should document our style guide. We'll look into it.
packages/auth/gulpfile.js
Outdated
| // For minified builds, wrap the output so we avoid leaking global variables. | ||
| const CJS_WRAPPER_PREFIX = `(function() {var firebase = require('@firebase/app').default;`; | ||
| const CJS_WRAPPER_PREFIX = | ||
| `(function() {var firebase = require('@firebase/app').default;`; |
There was a problem hiding this comment.
Add 2 more spaces here. (if right hand side of = is on second line)
const CJS_WRAPPER_PREFIX =
'value';
packages/auth/gulpfile.js
Outdated
| const WRAPPER_SUFFIX = | ||
| `}).call(typeof global !== 'undefined' ? ` + | ||
| `global : typeof self !== 'undefined' ? ` + | ||
| `self : typeof window !== 'undefined' ? window : {});`; |
There was a problem hiding this comment.
Same here for above block:
Add 2 more spaces here. (if right hand side of = is on second line)
const WRAPPER_SUFFIX =
'value1' +
'value2';
auth package's gulpfile.
|
It is actually documented here, the thing that is missing is an auto-formatting tool that would check for all of these rules. It's enough to have a documentation for people who work on the project on a daily basis, but it's hard to expect from external contributors to learn all of theses rules to make a few small PRs, it's just a waste of time. A tool like Prettier (aren't you already using it in other packages?) or clang would do. Thank you for the approval! |
Resolves #818
There is no changelog entry 'cause I couldn't find it ;)