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

Review generate HTML files #934

Closed
6 of 7 tasks
Denz1994 opened this issue Apr 13, 2020 · 3 comments
Closed
6 of 7 tasks

Review generate HTML files #934

Denz1994 opened this issue Apr 13, 2020 · 3 comments
Assignees

Comments

@Denz1994
Copy link
Contributor

Denz1994 commented Apr 13, 2020

Related to #872 for reviewing generateDevelopmentHTML.js and generateTestHTML.js:

generateDevelopmentHTML.js

  • Top-level documentation reads "... using the current brand's splash and preloads". However const brands = 'phet' is hard-coded (line 43). Should the top-level doc be specific to phet brand because it is hard-coded?

  • Documentation in generateTestHTML.options.stylesheets reads : // Note the preceding whitespace which makes the formatting match IDEA formatting. Should bodystyle in generateDevelopmentHTML.js include documentation as to why the white space is "essential"? Is it for the same reason?

  • Organization: I would move the indentLines() declaration above the preloads declaration so the helper functions are grouped together

  • Within stringifyArray, rename arr.map().join() to stringifiedPreload. It would make the return value more readable.

  • Within stringifyArray, prefix is concatenated to the end of the return value (like this [ arr.map().join() + prefix ]. Prefix in this case isn't really a prefix, it is a suffix. Consider renaming to indentation, based on it being concatenated to the beginning and end of the string in stringifyArray.


generateTestHTML.js

  • Shouldn't this file use strict mode? use strict is missing.

  • module.exports = async ( repo, options ) is missing its jsDoc.

Assigning to @jonathanolson to respond to review comments.

@jonathanolson
Copy link
Contributor

Should bodystyle in generateDevelopmentHTML.js include documentation as to why the white space is "essential"? Is it for the same reason?

I don't think a ton of comments about matching indentation style are particularly necessary. What would you change to add documentation? (Feel free to add docs)

Within stringifyArray, rename arr.map().join() to stringifiedPreload. It would make the return value more readable.

To me, the inline version is much more readable. isolating that into a variable doesn't give a whole lot more information, and the inline version shows where the content will end up in the string. Thoughts?

Otherwise, the review issues should be handled, good finds!

@Denz1994
Copy link
Contributor Author

Re: Indentation for bodystyle; I wasn't clear on whether the indentation was required in generateDevelopmentHTML.options.bodystyle for the same reason it is required for generateTestHTML.options.stylesheets ( to match IDEA formatting).

Also, the inline version of arr.map().join() looks much better.

@Denz1994
Copy link
Contributor Author

Closing this issue since the above items have been addressed.

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

No branches or pull requests

2 participants