From 56694b441ef1e64fd06df66ee5d5291f7f613959 Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Fri, 9 Jun 2023 04:01:17 -0700 Subject: [PATCH] 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 --- desktop/app/src/utils/__tests__/icons.node.tsx | 2 +- .../__snapshots__/PluginInstaller.node.tsx.snap | 16 ++++++++-------- desktop/flipper-ui-core/src/utils/icons.tsx | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/desktop/app/src/utils/__tests__/icons.node.tsx b/desktop/app/src/utils/__tests__/icons.node.tsx index 24aa3be05..7e60a42b7 100644 --- a/desktop/app/src/utils/__tests__/icons.node.tsx +++ b/desktop/app/src/utils/__tests__/icons.node.tsx @@ -43,7 +43,7 @@ test('filled icons get correct URL', async () => { } as const; const iconUrl = getPublicIconUrl(icon); 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 localUrl = getLocalIconUrl(icon, iconUrl, staticPath, false); diff --git a/desktop/flipper-ui-core/src/chrome/plugin-manager/__tests__/__snapshots__/PluginInstaller.node.tsx.snap b/desktop/flipper-ui-core/src/chrome/plugin-manager/__tests__/__snapshots__/PluginInstaller.node.tsx.snap index 890169d2f..0cfd86a3a 100644 --- a/desktop/flipper-ui-core/src/chrome/plugin-manager/__tests__/__snapshots__/PluginInstaller.node.tsx.snap +++ b/desktop/flipper-ui-core/src/chrome/plugin-manager/__tests__/__snapshots__/PluginInstaller.node.tsx.snap @@ -183,10 +183,10 @@ exports[`load PluginInstaller list 1`] = ` href="https://yarnpkg.com/en/package/flipper-plugin-hello" >
@@ -255,10 +255,10 @@ exports[`load PluginInstaller list 1`] = ` href="https://yarnpkg.com/en/package/flipper-plugin-world" >
@@ -569,10 +569,10 @@ exports[`load PluginInstaller list with one plugin installed 1`] = ` href="https://yarnpkg.com/en/package/flipper-plugin-hello" >
@@ -641,10 +641,10 @@ exports[`load PluginInstaller list with one plugin installed 1`] = ` href="https://yarnpkg.com/en/package/flipper-plugin-world" >
diff --git a/desktop/flipper-ui-core/src/utils/icons.tsx b/desktop/flipper-ui-core/src/utils/icons.tsx index 87cbba116..b79333e6e 100644 --- a/desktop/flipper-ui-core/src/utils/icons.tsx +++ b/desktop/flipper-ui-core/src/utils/icons.tsx @@ -59,7 +59,7 @@ function normalizeIcon(icon: Icon): 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) {