-
Notifications
You must be signed in to change notification settings - Fork 29
Remove legacy build #13664
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
Merged
Merged
Remove legacy build #13664
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Size Change: 0 B Total Size: 973 kB ℹ️ View Unchanged
|
78bfc13
to
0869192
Compare
Open
0869192
to
86364f6
Compare
JamieB-gu
approved these changes
Apr 30, 2025
86364f6
to
aa61d57
Compare
aa61d57
to
7863369
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this change?
DCR's build process has historically built and served two web builds - 'legacy' and 'modern' with a 'mustard cut' 1 2 to determine the split between the two.
This change removes the legacy build with the assertion that it is not relevant anymore.
The current mustard cut is based on whether the browser supports ES6 module script tags
Loading the legacy build
We add script tags to the HTML page that should only load the legacy scripts if the browser does not support ES6 modules via the nomodule attribute:
dotcom-rendering/dotcom-rendering/src/lib/assets.ts
Lines 128 to 130 in 88db1a5
Setting
window.guardian.mustardCut
We also set
window.guardian.mustardCut
based onnomodule
:dotcom-rendering/dotcom-rendering/src/server/htmlPageTemplate.ts
Lines 283 to 290 in 88db1a5
But afaics this is not used for anything except to load a dynamic import polyfill for browsers that pass the mustard cut (i.e. support es modules):
dotcom-rendering/dotcom-rendering/src/client/dynamicImport.ts
Lines 35 to 37 in 3e72807
However the repo states that this library shouldn't be used anymore as all browsers that support esmodules support dynamic imports:
https://github.com/GoogleChromeLabs/dynamic-import-polyfill
Why?
Supporting Evidence
1. Usage of the legacy build is 0.001% of the regular build
Querying the sampled Athena logs for assets.guim.co.uk on 2025-04-22 we can extrapolate the requests for each type of build to:
Hence requests for legacy scripts account for 0.001% of all scripts requests.
Given we fire ~33 requests for scripts per page, these figures do not exactly correlate to users or page views, which will be substantially lower.
TODO - check if legacy requests are bots
2. All browsers with >= 0.1% usage support ES6 modules
The old method of calculating browser usage from GA and subsequent transpilation support has been deprecated. Using @ashishpuliyel 's spreadsheet to query Ophan usage from the datalake and referencing https://caniuse.com/es6-module, we can see for the vast majority of browsers (with two exceptions) support ES6 modules.
The two exceptions are:
I think the usage amounts are low enough to discount.
Full browser usage as of Mar 2025
3. Core Experience
Given we server side render our content we still deliver the 'core' experience of our journalism that is not dependant on client side JS.
We could instead choose to deliver a close to zero-JS experience for browsers that do not cut the mustard rather than serving a legacy build which increasingly degrades over time.
aiui this is closer to the 'mustard cut' described by 12 where the browsers that do not cut the mustard get a close to zero JS experience rather than a semi-broken experience.
4. Targeted fixes for older browsers
We have recently taken the approach of targeted fixes for older browsers when we spot errors or get user complaints. This then becomes part of the main build available to all users.
Footnotes
https://responsivenews.co.uk/post/18948466399/cutting-the-mustard "Cutting the mustard" ↩ ↩2
https://jakearchibald.com/2013/progressive-enhancement-still-important/ ↩ ↩2