tzhf / chatguessr

A Twitch chatbot for GeoGuessr.
https://chatguessr.com
MIT License
38 stars 9 forks source link

[WIP] try vue with parcel #26

Closed ReAnnannanna closed 1 year ago

ReAnnannanna commented 2 years ago

This PR rewrites the icons column with Vue, so most of the UI interactions are there. if we can get this to work nicely we can consider also rewriting other parts, like the scoreboard.

I also moved the actual settings changes and things like that into the Vue file. It still has a few issues on initial load, like it doesn't apply the no compass styles correctly (it only works if you click the button again), and i haven't tested satellite that much.

Overall Vue works quite well with parcel as long as we use the older API style. To get hot reload to work we probably have to add something like this in preload.js:

module.hot.accept("./InGameUI.vue", (updatedModule) => {
    const ingameUi = createApp(updatedModule.default, {
        rendererApi,
        toggleScoreboard,
    });
    ingameUi.mount(document.body);
});

and we'd have to use parcel serve instead of parcel build in the npm start script.