<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Vue.js on Michael-F-Bryan</title><link>https://adventures.michaelfbryan.com/tags/vue.js/</link><description>Recent content in Vue.js on Michael-F-Bryan</description><generator>Hugo</generator><language>en</language><lastBuildDate>Wed, 26 Aug 2026 15:15:33 +0800</lastBuildDate><atom:link href="https://adventures.michaelfbryan.com/tags/vue.js/index.xml" rel="self" type="application/rss+xml"/><item><title>Wiring Up Communication</title><link>https://adventures.michaelfbryan.com/posts/wiring-up-communication/</link><pubDate>Thu, 10 Oct 2019 22:58:00 +0800</pubDate><guid>https://adventures.michaelfbryan.com/posts/wiring-up-communication/</guid><description>&lt;p&gt;As we mentioned &lt;a href="https://adventures.michaelfbryan.com/posts/a-better-frontend/#the-next-step"&gt;in the last AiMC post&lt;/a&gt;&#10;, the next task is to wire up&#10;communications between the simulator&amp;rsquo;s backend and frontend.&lt;/p&gt;&#10;&lt;p&gt;As a general rule, our frontend will have two communication regimes:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;When something happens (e.g. a button is pressed or a job starts sending),&#10;the frontend will send a batch of messages to the backend and interpret the&#10;response&lt;/li&gt;&#10;&lt;li&gt;The frontend will continually poll the backend&amp;rsquo;s state in the background&#10;(e.g. at 10Hz)&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;As it is, the &lt;code&gt;Browser&lt;/code&gt; in our WASM code already provides a method for&#10;sending data to the frontend (&lt;a href="https://michael-f-bryan.github.io/adventures-in-motion-control/aimc_sim/struct.Browser.html#method.send_data" class="external-link" target="_blank" rel="noopener"&gt;&lt;code&gt;Browser::send_data()&lt;/code&gt;&lt;/a&gt;&#10;) and&#10;receiving data from the frontend (&lt;a href="https://michael-f-bryan.github.io/adventures-in-motion-control/aimc_sim/struct.App.html#method.on_data_received" class="external-link" target="_blank" rel="noopener"&gt;&lt;code&gt;App::on_data_received()&lt;/code&gt;&lt;/a&gt;&#10;) so&#10;we shouldn&amp;rsquo;t need to write any Rust code.&lt;/p&gt;</description></item><item><title>A Better Frontend</title><link>https://adventures.michaelfbryan.com/posts/a-better-frontend/</link><pubDate>Fri, 27 Sep 2019 03:47:00 +0800</pubDate><guid>https://adventures.michaelfbryan.com/posts/a-better-frontend/</guid><description>&lt;p&gt;Now we&amp;rsquo;ve got a half-usable motion controller, we need a graphical way for&#10;humans to interact with it. The controller runs in a browser, which makes&#10;&lt;a href="https://vuejs.org/" class="external-link" target="_blank" rel="noopener"&gt;Vue&lt;/a&gt;&#10; a perfect candidate for the UI.&lt;/p&gt;&#10;&lt;h2 id="adding-vue-to-the-frontend"&gt;&#10; Adding Vue to the Frontend&#10; &lt;a class="heading-link" href="#adding-vue-to-the-frontend"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;Now, we don&amp;rsquo;t actually have much frontend code (47 lines of JavaScript to be&#10;exact) so it&amp;rsquo;s actually easier to delete the existing &lt;code&gt;frontend&lt;/code&gt; and use the&#10;&lt;a href="https://cli.vuejs.org/guide/installation.html" class="external-link" target="_blank" rel="noopener"&gt;&lt;code&gt;vue&lt;/code&gt; CLI tool&lt;/a&gt;&#10; to create a new one.&lt;/p&gt;</description></item></channel></rss>