Skip to content

Commit d945246

Browse files
authored
Upgrade hyperparam (#36)
* no need for a console error * only send message to the iframe parent for huggingface.co * upgrade hyperparam + add a comment in vite config
1 parent dff23f7 commit d945246

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"dependencies": {
1616
"@huggingface/hub": "2.4.0",
1717
"hightable": "0.18.1",
18-
"hyperparam": "0.3.6",
18+
"hyperparam": "0.3.7",
1919
"react": "18.3.1",
2020
"react-dom": "18.3.1"
2121
},

src/components/App/App.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ export default function App() {
8888
* Note that the iframe has no access to the parent window's location, so
8989
* it might already by in sync, we just don't know.
9090
*/
91-
window.parent.postMessage({ queryString: window.location.search }, 'https://huggingface.co')
91+
const huggingfaceOrigin = 'https://huggingface.co'
92+
if (window.parent.origin === huggingfaceOrigin) {
93+
window.parent.postMessage({ queryString: window.location.search }, huggingfaceOrigin)
94+
}
9295

9396
return <ConfigProvider value={config}>
9497
<Page source={source} navigation={{ row, col }} />

src/lib/huggingfaceSource.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ export function getHuggingFaceSource(sourceId: string, options?: {requestInit?:
9393
fetchVersions,
9494
}
9595
}
96-
} catch (e) {
97-
console.error(e)
96+
} catch {
9897
return undefined
9998
}
10099
}

vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export default defineConfig({
1717
}
1818
},
1919
optimizeDeps: {
20+
// only for dev, not for build
2021
exclude: ["hyperparam"],
21-
},
22+
}
2223
})

0 commit comments

Comments
 (0)