Use assets_DO_NOT_HARDCODE in public as well

Summary: Since ~couple of days to last week we cannot download image assets anymore from facebook.com during build, which is worked around in previous diff. This diff fixes it also in the development environment (`yarn start`)

Reviewed By: lblasa

Differential Revision: D46556075

fbshipit-source-id: ee5d912fb06d1632c41ff6d536b64a55608f5848
This commit is contained in:
Michel Weststrate
2023-06-09 04:01:17 -07:00
committed by Facebook GitHub Bot
parent 146a5cf666
commit 56694b441e
3 changed files with 10 additions and 10 deletions

View File

@@ -43,7 +43,7 @@ test('filled icons get correct URL', async () => {
} as const; } as const;
const iconUrl = getPublicIconUrl(icon); const iconUrl = getPublicIconUrl(icon);
expect(iconUrl).toBe( expect(iconUrl).toBe(
'https://facebook.com/assets/?name=star&variant=filled&size=12&set=facebook_icons&density=2x', 'https://facebook.com/images/assets_DO_NOT_HARDCODE/facebook_icons/star_filled_12.png', // TODO: support density?
); );
const staticPath = getRenderHostInstance().serverConfig.paths.staticPath; const staticPath = getRenderHostInstance().serverConfig.paths.staticPath;
const localUrl = getLocalIconUrl(icon, iconUrl, staticPath, false); const localUrl = getLocalIconUrl(icon, iconUrl, staticPath, false);

View File

@@ -183,10 +183,10 @@ exports[`load PluginInstaller list 1`] = `
href="https://yarnpkg.com/en/package/flipper-plugin-hello" href="https://yarnpkg.com/en/package/flipper-plugin-hello"
> >
<div <div
class="css-1kmzf9v-ColoredIconCustom ekc8qeh0" class="css-xl1cnv-ColoredIconCustom ekc8qeh0"
color="var(--light-color-button-active)" color="var(--light-color-button-active)"
size="16" size="16"
src="https://facebook.com/assets/?name=info-circle&variant=filled&size=16&set=facebook_icons&density=1x" src="https://facebook.com/images/assets_DO_NOT_HARDCODE/facebook_icons/info-circle_filled_16.png"
/> />
</a> </a>
</div> </div>
@@ -255,10 +255,10 @@ exports[`load PluginInstaller list 1`] = `
href="https://yarnpkg.com/en/package/flipper-plugin-world" href="https://yarnpkg.com/en/package/flipper-plugin-world"
> >
<div <div
class="css-1kmzf9v-ColoredIconCustom ekc8qeh0" class="css-xl1cnv-ColoredIconCustom ekc8qeh0"
color="var(--light-color-button-active)" color="var(--light-color-button-active)"
size="16" size="16"
src="https://facebook.com/assets/?name=info-circle&variant=filled&size=16&set=facebook_icons&density=1x" src="https://facebook.com/images/assets_DO_NOT_HARDCODE/facebook_icons/info-circle_filled_16.png"
/> />
</a> </a>
</div> </div>
@@ -569,10 +569,10 @@ exports[`load PluginInstaller list with one plugin installed 1`] = `
href="https://yarnpkg.com/en/package/flipper-plugin-hello" href="https://yarnpkg.com/en/package/flipper-plugin-hello"
> >
<div <div
class="css-1kmzf9v-ColoredIconCustom ekc8qeh0" class="css-xl1cnv-ColoredIconCustom ekc8qeh0"
color="var(--light-color-button-active)" color="var(--light-color-button-active)"
size="16" size="16"
src="https://facebook.com/assets/?name=info-circle&variant=filled&size=16&set=facebook_icons&density=1x" src="https://facebook.com/images/assets_DO_NOT_HARDCODE/facebook_icons/info-circle_filled_16.png"
/> />
</a> </a>
</div> </div>
@@ -641,10 +641,10 @@ exports[`load PluginInstaller list with one plugin installed 1`] = `
href="https://yarnpkg.com/en/package/flipper-plugin-world" href="https://yarnpkg.com/en/package/flipper-plugin-world"
> >
<div <div
class="css-1kmzf9v-ColoredIconCustom ekc8qeh0" class="css-xl1cnv-ColoredIconCustom ekc8qeh0"
color="var(--light-color-button-active)" color="var(--light-color-button-active)"
size="16" size="16"
src="https://facebook.com/assets/?name=info-circle&variant=filled&size=16&set=facebook_icons&density=1x" src="https://facebook.com/images/assets_DO_NOT_HARDCODE/facebook_icons/info-circle_filled_16.png"
/> />
</a> </a>
</div> </div>

View File

@@ -59,7 +59,7 @@ function normalizeIcon(icon: Icon): Icon {
} }
export function getPublicIconUrl({name, variant, size, density}: Icon) { export function getPublicIconUrl({name, variant, size, density}: Icon) {
return `https://facebook.com/assets/?name=${name}&variant=${variant}&size=${size}&set=facebook_icons&density=${density}x`; return `https://facebook.com/images/assets_DO_NOT_HARDCODE/facebook_icons/${name}_${variant}_${size}.png`;
} }
export function getIconURL(icon: Icon) { export function getIconURL(icon: Icon) {