Skip to content

Conversation

@marjisound
Copy link
Contributor

@marjisound marjisound commented Nov 10, 2025

I collaborated closely with @arelra and @JamieB-gu on this work. They provided helpful ideas, reviewed approaches, and assisted with testing the changes in the iOS app.

What does this change?

This PR adds a new GET endpoint in DCAR /assets/rendered-items-assets. This endpoint renders a page that holds the DCAR fonts and the apps client js bundle. We need this asset for ios offline reading. When the iOS app starts, it fetches this html and downloads the linked assets and keep that in cache. Later, when an article is read but the device is offline, requests for these assets are served from the cache.

The changes are:

  • Create new endpoint and handler
  • Add uniqueName field to FontDisplay type in font-css.ts file to use for class names

There's also a PR in frontend guardian/frontend#28368 which also adds a new endpoint that calls the DCAR /assets/rendered-items-assets.

Testing

This was tested in CODE by using the debug app in device pointing it to CODE. Below is the image of. the article in offline mode which can access the cached assets (fonts & index.client.apps.js)
The steps of testing:

  • Point debug app to CODE MAPI
  • Clear the cache in the app
  • Fully close the app and open it (by swiping it up in order to do a cold start)
  • go to flight mode in app
  • open an article from the home page
  • inspect it in safari developer tool and make sure the assets are loaded (as shown in the below picture)
image

Fixes #8937

@github-actions
Copy link

github-actions bot commented Nov 11, 2025

@marjisound marjisound force-pushed the add-ios-pre-warm-asset-to-dcar branch from f38f20c to 0ac2c80 Compare November 11, 2025 11:50
@github-actions
Copy link

github-actions bot commented Nov 11, 2025

@marjisound marjisound force-pushed the add-ios-pre-warm-asset-to-dcar branch from 9caab65 to ac1c512 Compare November 11, 2025 17:58
- Add class name to font list in fonts-css.ts
- Dynamically create font-face and css classes based on font list
and add the styles to rendered-items-assets-template.html
- Dynamically create divs with class names from font list in
rendered-items-assets-template.html - This is to download the assets on iOS
@marjisound marjisound force-pushed the add-ios-pre-warm-asset-to-dcar branch from ac1c512 to 303f9ae Compare November 12, 2025 09:42
@marjisound marjisound force-pushed the add-ios-pre-warm-asset-to-dcar branch from cd16a1a to 38ab43d Compare November 14, 2025 15:38
@marjisound marjisound force-pushed the add-ios-pre-warm-asset-to-dcar branch 3 times, most recently from 83031e2 to dea0a73 Compare November 19, 2025 12:15
@marjisound marjisound force-pushed the add-ios-pre-warm-asset-to-dcar branch from dea0a73 to f08c8d8 Compare November 19, 2025 14:40
@marjisound marjisound self-assigned this Nov 19, 2025
@marjisound marjisound marked this pull request as ready for review November 19, 2025 15:22
@marjisound marjisound requested a review from a team as a code owner November 19, 2025 15:22
@github-actions
Copy link

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@marjisound marjisound added the run_chromatic Runs chromatic when label is applied label Nov 19, 2025
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DCAR: Generate iOS pre-warm file

2 participants