Skip to content
This repository was archived by the owner on Dec 7, 2025. It is now read-only.

Commit 4db067c

Browse files
CopilotMathiasVDA
andcommitted
Add detailed comments explaining UMD export structure and plugin registration
Co-authored-by: MathiasVDA <[email protected]>
1 parent 76be0dd commit 4db067c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/App.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ import GeoPlugin from "yasgui-geo-tg";
55
export default function App() {
66
useEffect(() => {
77
// Yasgui is loaded from public/yasgui/yasgui.min.js and is available as a global variable
8-
// The UMD build exports the constructor as window.Yasgui.default or window.Yasgui.Yasgui
8+
// The UMD build exports the constructor at window.Yasgui.default (ES6 default export)
9+
// or window.Yasgui.Yasgui (named export). This handles both export patterns.
910
const Yasgui = window.Yasgui?.default || window.Yasgui?.Yasgui;
1011

1112
if (!Yasgui) {
1213
console.error("Failed to load Yasgui library. Please ensure yasgui.min.js is properly loaded.");
1314
return;
1415
}
1516

16-
// Register the geo plugin
17+
// Register the geo plugin if Yasr (result renderer) is available
18+
// Yasr is a sub-component of Yasgui that handles result visualization
1719
if (Yasgui.Yasr) {
1820
Yasgui.Yasr.registerPlugin("geo", GeoPlugin);
1921
}

0 commit comments

Comments
 (0)