Skip to content

Add moment and underscore libs to child theme#96

Merged
JPrevost merged 1 commit into
masterfrom
hours
Apr 28, 2023
Merged

Add moment and underscore libs to child theme#96
JPrevost merged 1 commit into
masterfrom
hours

Conversation

@JPrevost

@JPrevost JPrevost commented Apr 27, 2023

Copy link
Copy Markdown
Member

This seems to resolve date loading on both /docs and /distinctive-collections in the hours multidev environment.

Why are these changes being introduced:

  • These are required for some hours related functionality

Relevant ticket(s):

How does this address that need:

  • registers and enqueues the two libraries

Document any side effects to this change:

  • The child theme loads all required libs and does not limit them to pages that need them

Developer

Secrets

  • All new secrets have been added to Pantheon tiers
  • Relevant secrets have been updated in Github Actions
  • All new secrets documented in README

Documentation

  • Project documentation has been updated
  • No documentation changes are needed

Accessibility

  • ANDI or Wave has been run in accordance to
    our guide and
    all issues introduced by these changes have been resolved or opened as new
    issues (link to those issues in the Pull Request details above)

Stakeholder approval

  • Stakeholder approval has been confirmed
  • Stakeholder approval is not needed

Dependencies

YES | NO dependencies are updated

Code Reviewer

  • The commit message is clear and follows our guidelines
    (not just this pull request message)
  • The changes have been verified
  • The documentation has been updated or is unnecessary
  • New dependencies are appropriate or there were no changes

@JPrevost JPrevost requested a review from matt-bernhardt April 27, 2023 16:15
@matt-bernhardt matt-bernhardt self-assigned this Apr 27, 2023

@matt-bernhardt matt-bernhardt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Short answer: this looks fine, and I've confirmed that this change is necessary for the hours to display on the sites that need them.

Longer, can-of-worms answer: it looks like this change doesn't do quite what I expected it would do - but the thing that is happening is also happening on our legacy site, so 🤷

This change causes the Moment and Underscore libraries to be loaded from somewhere in the WordPress core - not the versions that are in the parent theme's js/libs folder? I'd never noticed that this was happening on the legacy site, and it wasn't until I looked more closely at the network tab that I realized this was happening.

This will probably come back to relevance when we try and update how we handle these internal dependencies - potentially allowing us to just wash our hands of the question - but I don't want to deal with the ramifications now. This change works, and the behavior that it prompts is the same was we see on the legacy site.

:shipit:

Why are these changes being introduced:

* These are required for some hours related functionality

Relevant ticket(s):

* https://mitlibraries.atlassian.net/browse/LM-191

How does this address that need:

* registers and enqueues the two libraries

Document any side effects to this change:

* The child theme loads all required libs and does not limit them to
  pages that need them
@JPrevost JPrevost merged commit a31cc51 into master Apr 28, 2023
@JPrevost JPrevost deleted the hours branch April 28, 2023 17:55
matt-bernhardt pushed a commit that referenced this pull request May 10, 2023
Update testing.yml to use GITHUB_TOKEN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants