-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Use externs/olx.js instead of objectliterals.jsdoc #1954
Conversation
I should also mention that with these changes, the |
The
I'm not sure why the compiler is not renaming those (it is successfully working with the |
@ahocevar I started trying to get the Aside from the documentation issue, this is ready for review. |
@ahocevar - @elemoine - let me know if you have any comments. My thinking is that we should go with a single |
0b578df brings typedefs from olx.js back to the apidocs. |
Thanks @ahocevar. I applied that commit here. I'd like to see #1964 and this merged. I've got a custom-build branch that also uses the Node version of JSDoc to extract @elemoine any comments? |
The single externs/olx.js file describes all of the "options" objects we accept in our constructors. The @typedef annotations are used by the compiler for type checking. The @type annotations include documentation for individual options and serve as externs when compiling a profile of the library. When compiling an application together with the library, the externs/olx.js file is included as one of the sources to provide the @typedef's without generating externs. If we want to maintain multiple src/*.externs.js files instead of one large externs/olx.js file, we can. But while we are still using Plovr, it makes for easier build configurations to have one file. This removes the build tasks that generated the build/src/external/src/externs/types.js and build/src/internal/src/types.js files as those are both replaced by the single externs/olx.js file.
Looks good to me! |
I'll have a look in a few hours when I get back to my hotel room. |
@@ -318,7 +298,7 @@ def action(t): | |||
'inherits': '../../buildcfg/base.json', | |||
'inputs': [ | |||
'../examples/%(id)s.js' % match.groupdict(), | |||
'../build/src/internal/src/types.js', | |||
'../externs/olx.js', |
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 may be hard to understand why an externs file is used as an input file here. I'd add a comment to explain this.
This looks good. Thanks a lot for the effort on this Tim! I just added a few comments. One of them is related to using olx.js as an externs file for the compilation of the examples. I'm also surprised that we do not need to use the keyword Please merge when you think this is ready. |
Both |
The externs/olx.js script includes @typedef annotations for objects that are used in the library. When compiling the examples together with the library, we need these @typedef annotations. In this same case, we don't need the object property names to be treated as externs (they can be safely renamed).
Thanks for the review @elemoine and @ahocevar. I added a comment to I'll send a writeup to the list about adding to |
Use externs/olx.js instead of objectliterals.jsdoc.
Thanks a lot for the explanations @tschaub. It all makes sense. |
The single
externs/olx.js
file describes all of the "options" objects we accept in our constructors. The@typedef
annotations are used by the compiler for type checking. The@type
annotations include documentation for individual options and serve as externs when compiling a profile of the library. When compiling an application together with the library, theexterns/olx.js
file is included as one of the sources to provide the@typedef
s without generating externs.If we want to maintain multiple
src/*.externs.js
files instead of one largeexterns/olx.js
file, we can. But while we are still using Plovr, it makes for easier build configurations to have one file.This removes the build tasks that generated the
build/src/external/src/externs/types.js
andbuild/src/internal/src/types.js
files as those are both replaced by the singleexterns/olx.js
file.