<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Windy Integration with React: Seeking Help with Plugin Initialization]]></title><description><![CDATA[<p dir="auto">Hello there,</p>
<p dir="auto">After spending several hours trying to add Windy to a React project, I managed to hack my way into React-ifying Windy and got it to work. I’m planning on releasing the library once it's ready. However, I’ve hit a snag that I could really use some help with.</p>
<p dir="auto"><strong>The Issue:</strong><br />
I can't seem to figure out where the @plugin-menu plugin is initialized so that I can reset it properly. The problem arises when the component unmounts and mounts again. Without resetting, I encounter an error when the plugin tries to reinitialize. I've found and reset some global variables (like window.W) that were causing issues, but I can't locate where the plugins are initialized.</p>
<p dir="auto"><strong>The Error:</strong><br />
When I remount the object multiple times and try to open the menu, I get the same error as many times as I’ve remounted the map. This suggests that some data is stored every time the plugin is initialized—perhaps in a callback function? I’m considering downloading Chromium to dive deeper, but it’s quite heavy, so I wanted to check here first.</p>
<p dir="auto">I also downloaded the library and slowly and painfully de-obfuscating to maybe understand what it does with the plugins after all the variables are a little more readable.</p>
<p dir="auto"><strong>What I Need:</strong><br />
Does anyone know a hacky way to reset the plugin? Any insights would save me a ton of time and effort. Regardless, I need to figure this out for the project I'm working on.</p>
<p dir="auto">Thanks in advance for any help!</p>
]]></description><link>https://community.windy.com/topic/36151/windy-integration-with-react-seeking-help-with-plugin-initialization</link><generator>RSS for Node</generator><lastBuildDate>Sat, 14 Mar 2026 12:55:39 GMT</lastBuildDate><atom:link href="https://community.windy.com/topic/36151.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 15 Aug 2024 18:56:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Windy Integration with React: Seeking Help with Plugin Initialization on Sat, 17 Aug 2024 18:38:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/%CF%83%CF%84%CE%AC%CE%B8%CE%B7%CF%82-%CF%83%CF%84%CE%B1%CE%B8%CF%8C%CF%80%CE%BF%CF%85%CE%BB%CE%BF%CF%82" aria-label="Profile: Στάθης-Σταθόπουλος">@<bdi>Στάθης-Σταθόπουλος</bdi></a> I finally found it. The ClickHandler module adds a global event on click to bubble and get picked up by the menu with data-do="rqstOpen,menu" for example and anything that may have events. When you unmount the component this event handler sticks and on remount it adds again a second time which breaks things because when you loadScript from @plugins/menu it re-defines it causing an error. I will make a public script real soon with the code to integrade windy with React unofficially. 15 hours of de obfuscating paid off :P</p>
]]></description><link>https://community.windy.com/post/197959</link><guid isPermaLink="true">https://community.windy.com/post/197959</guid><dc:creator><![CDATA[Στάθης Σταθόπουλος]]></dc:creator><pubDate>Sat, 17 Aug 2024 18:38:32 GMT</pubDate></item><item><title><![CDATA[Reply to Windy Integration with React: Seeking Help with Plugin Initialization on Sat, 17 Aug 2024 14:18:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/%CF%83%CF%84%CE%AC%CE%B8%CE%B7%CF%82-%CF%83%CF%84%CE%B1%CE%B8%CF%8C%CF%80%CE%BF%CF%85%CE%BB%CE%BF%CF%82" aria-label="Profile: Στάθης-Σταθόπουλος">@<bdi>Στάθης-Σταθόπουλος</bdi></a> After de-obfuscating around 4000 lines of the 15000 I realized the problem is double event handles that are left over from the first initialization and even though I clean things after an un-mount the event listeners are still there and for example on menu click the fetch the new W.define and reload the script. I will keep this post updated when I figure it out. Maybe write a script for the rest of the people struggling with it.</p>
]]></description><link>https://community.windy.com/post/197943</link><guid isPermaLink="true">https://community.windy.com/post/197943</guid><dc:creator><![CDATA[Στάθης Σταθόπουλος]]></dc:creator><pubDate>Sat, 17 Aug 2024 14:18:05 GMT</pubDate></item></channel></rss>