Skip to content

Conversation

@slifty
Copy link
Contributor

@slifty slifty commented Jan 13, 2026

This PR improves our index.html in two ways:

  1. We no longer have environment-specific index files, instead having just one with angular environments determining which dynamic values / tokens to use.

  2. We no longer include vendor code in our index file, instead registering it as a dependency which is inserted via angular.

This is much cleaner and easier to maintain.

Resolves #885

@slifty slifty force-pushed the 885-refactor-index-files branch from f4b384a to 65fe9c8 Compare January 13, 2026 20:42
@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.76%. Comparing base (4aeb05e) to head (73d81f2).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #887      +/-   ##
==========================================
- Coverage   47.79%   47.76%   -0.03%     
==========================================
  Files         351      351              
  Lines       11292    11292              
  Branches     1889     1889              
==========================================
- Hits         5397     5394       -3     
- Misses       5702     5708       +6     
+ Partials      193      190       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@slifty slifty force-pushed the 885-refactor-index-files branch from 65fe9c8 to dd360f2 Compare January 13, 2026 20:53
@slifty slifty mentioned this pull request Jan 13, 2026
@slifty
Copy link
Contributor Author

slifty commented Jan 13, 2026

@cecilia-donnelly @aasandei-vsp I ran this locally and kicked off a dev build -- it appears to be working as expected locally (inspecting I see the config properly injected in an environments object)

Dev is harder to parse since things are minified, but I see index.html is much smaller / linking the external js and the application itself works, so that's a great sign.

It would be worth invoking something that would trigger NewRelic and confirming that the action had the expected effect on NewRelic from dev.


ALSO PLEASE NOTE: this adds a new project dependency, and so you will need to re-build your web-app image.

@aasandei-vsp
Copy link
Contributor

aasandei-vsp commented Jan 15, 2026

This is not my area of expertise, but I tried at least to take it locally and see if it works and I get the following error:

  • I ran npm in web-app, and ran again docker compose
image

@aasandei-vsp
Copy link
Contributor

Some questions:

  • How do we test it on the upper env?
  • Is there any pipeline change necessary?

@slifty
Copy link
Contributor Author

slifty commented Jan 15, 2026

@aasandei-vsp the error you're seeing is related to that note I added in the end of the comment above ALSO PLEASE NOTE: this adds a new project dependency, and so you will need to re-build your web-app image.

You have to blow away the image and rebuild because our docker containers don't update their installations of npm dependencies on start. This is an augmentation we should make since it so regularly causes issues, but it isn't in scope for this specific PR.


For testing in other envs I did deploy to dev and it worked (I don't think there's a great way to test in other envs outside of the deploy cycle, but seeing it work in dev is a good sign)

Copy link
Contributor

@aasandei-vsp aasandei-vsp left a comment

Choose a reason for hiding this comment

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

Made it work locally, thanks @slifty for the help!

We had one index file per environment AND each one included a full copy
of the new relic client.

This commit fixes both items of tech debt. We now use an npm package for
that vendor library, which allows us to (A) remove it from our code and
(B) keep it up to date using package tooling.

We also now have a single index and environment configuration is done
via the angular build tooling

Issue #885 Reduce size of index.html
It seems this isn't actually used any longer, and with our refactor it
was causing issues.
@slifty slifty force-pushed the 885-refactor-index-files branch from 2b06111 to 73d81f2 Compare January 15, 2026 17:38
@slifty slifty enabled auto-merge January 15, 2026 17:38
@slifty slifty merged commit 1d9ba0f into main Jan 15, 2026
6 checks passed
@slifty slifty deleted the 885-refactor-index-files branch January 15, 2026 17:40
@slifty slifty mentioned this pull request Jan 16, 2026
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.

Reduce size of index.html

3 participants