Skip to content

Conversation

davidejones
Copy link
Member

@davidejones davidejones commented May 12, 2022

What does this PR do?

This PR removes webpack and uses hugos ability to build javascript instead. The goal is for feature parity with the current js build and to make the minimum amount of changes required to support this work.

The changes:

  • moved javascript from src to assets (so hugo can read them)
  • <script> tags no longer use webpack generated manifest and instead use hugos js.build (so hugo can compile and reference javascript)
  • scripts moved to header-scripts.html or footer-scripts.html. These partials already existed and now we supply some compile options this seemed the perfect place to avoid duplication.
  • post deploy sourcemap upload job is updated to find files correctly after the changes
  • hugo security config updated so we can read a specific environment variable we were using for version

Motivation

Faster local development and build step

Preview

QA the entire site as best as possible especially areas with known javascript specifics.
https://docs-staging.datadoghq.com/david.jones/js/

Additional Notes


Reviewer checklist

  • Review the changed files.
  • Review the URLs listed in the Preview section.
  • Check images for PII
  • Review any mentions of "Contact Datadog support" for internal support documentation.

@github-actions github-actions bot added Architecture Everything related to the Doc backend Github Related to Github configurations labels May 12, 2022
@davidejones davidejones changed the title Hugo js build Updating to use hugo js building May 13, 2022
@davidejones davidejones changed the title Updating to use hugo js building Updating to use hugo js build May 13, 2022
Copy link
Contributor

@stanleegoodspeed stanleegoodspeed left a comment

Choose a reason for hiding this comment

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

should we remove webpack from package.json dependencies as well?

@davidejones
Copy link
Member Author

@stanleegoodspeed Good point, I've removed webpack and babel, there might be some lingering packages but i think this is the majority for now until we do a better audit.

@davidejones davidejones marked this pull request as ready for review May 13, 2022 15:27
@davidejones davidejones requested review from a team as code owners May 13, 2022 15:27
@davidejones davidejones force-pushed the david.jones/js branch 3 times, most recently from 1df91a8 to e0596c5 Compare May 17, 2022 10:14
@cswatt
Copy link
Contributor

cswatt commented May 17, 2022

One thing I just caught in QA: there's a link in the left nav Developers > Service Checks > Submission - API which links to https://docs.datadoghq.com/api/v1/service-checks/ and should redirect to https://docs.datadoghq.com/api/latest/service-checks/, but in the preview, it doesn't redirect, instead it 404s.

as far as i can tell, other redirects are working as expected

@davidejones
Copy link
Member Author

Hey @cswatt I've looked into this and the missing redirect is unrelated to these changes. This currently happens on any preview site as we don't setup the same kind of redirects for each one that prod has.

@davidejones davidejones merged commit 55696c6 into master May 18, 2022
@davidejones davidejones deleted the david.jones/js branch May 18, 2022 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Architecture Everything related to the Doc backend Github Related to Github configurations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants