-
25 August 2021Refactoring lots and lots of files
Wow, long time no write! I am alive!!
Refactorin' the fronts and ends
The past few months I've been busy refactoring the way that the "frontend" side of the site is packaged together. In developer terms, I have moved the entire frontend build to ViteJs, and then thanks to Vite's easy configuration I was able to add support for Tailwind's new "Just In Time" (JIT) mode. The changes are currently in feature/use-vite PR.
I need your help! Since I refactored a lot of code I'd rather avoid updating live (here) too soon. Instead I have pushed the new code to staging dot koohii dot com. If you type that URL you will be able to use exactly the same site, and use your account normally. You can tell it's not the live site because of the gray coloured header bar. Simply use the site as you would normally, and please let me know if you find any issues that are not present on live. Particularly if you use older models of phones / tablets / browsers. Please note this update will definitely END support for Internet Explorer (any relatively recent version of Microsoft EDGE should be ok).
I'm embarrassed that I still am not working on new improvements or features. But on the development side of things, these are really exciting changes. The ability to develop all JavaScript for the site in a single Vite build adds a new lease of life to the site. I should now, in theory, be able to easily add support for UX framework like "element plus". While Tailwind JIT will be a real boon in updating outdated stylesheets.
Side projects
Earlier this year, with the announcement of Diablo II Resurrected, I was finally motivated to do a full rewrite of an old little site called Runewizard. This was the perfect opportunity for me to gain experience with Vue 3 and TypeScript, and especially starting a new project from scratch.
It turns out there were new exciting developments in the JavaScript world that happened right around that time:
First, ViteJs was announced. As I worked on the Runewizard rewrite, I became confident that Vite was stable enough and provided all the features I needed to replace Webpack for building the JavaScript on Kanji Koohii.
Next, Tailwind announced the Just In Time mode. Tailwind JIT works really well with Vite, and it will be a real boon when phasing out old css, and write new code.
So I completed my rewrite of Diablo II Runewizard, and published the code on Github. This is a really small site that gives me a room to experiment, as well as just take a break now and then. I expect that with the release of Diablo II Resurrected there will likely be new Runewords released for new ladders, so the site can receive contributions to update stats and what not.
Apple Silicon
Other things that kept me busy, or distracted me... I needed a change from working in the Ubuntu environment. I was also becoming tired of switching between Windows and Ubuntu partitions. So with the excitement around the Apple M1 chips, I decided to just go for it : switch back to OS X, and use just one OS for personal use and for development purposes.
So "Back to the Mac"... indeed I did have a few years of experience on OS X way back around 2009-2010. And in fact after I sold my late 2009 iMac and bought a PC, I bought a LED Cinema display because I loved the screen. I am still using that display to this day; and this led me to cancel my iMac order and go for the M1 Mac Mini instead. In retrospect, with the announcement of the Steam Deck in particular, I think it was the right choice.
So incidentally it means I am not yet enjoying the 5K resolution, which is one of the things that really got me excited at first. I think for previewing a site on phone / tablet it may be useful, but on the other hand the majority of users out there are still on 1080p or 1440p monitors and I think I prefer to preview the site I'm working on just how most users will see it. It takes some time getting used again to the font smoothing on OS X (some say it got worse because it is now optimized for 5K), but now I'm just used to it.
To be perfectly honest the Docker setup on this Mac Mini M1 feels slower. Even running Vite's dev server feels noticeably slower. Likely due to Docker using emulation on the M1, even with ARM images. I'm not sure. But the overall improvement in my user experience is well worth it. To be fair I am using almost the same suite of tools I was in Ubuntu. VSCode, SublimeText, SublimeMerge, MacVIM, and the Terminal is very similar.
I needed to update the Kanji Koohii repository as well, since I needed an ARM64 image for MySQL. Mariadb was recommended and thankfully it was truly a "drop in" replacement for MySQL, a few changes in the Docker configuration and it worked right away.
Next
I am excited to experiment with this new Vite setup. First I'll need to chose a UX framework and stick to it. I have had good experience with element-ui, so I am leaning towards element-plus which should be easy to add with Vite. It can be a little bloated though, and I have no idea how much "weight'" those frameworks will add to the JavaScript bundles.
But things are looking good. Going forward I will be able to write a lot more on the frontend side of things, while the aging php framework will act more like an API.
One of the things I could experiment first with, is to replace the old dialogs, so I can completely phase out the YUI2 library. Then perhaps improve the "Star / Copy / Report" buttons in the Shared Stories list, by using a proper modal for a better user experience (it's really not obvious the vote / report buttons are toggles for example).
Rewriting the Study page entirely with Vite would be fun.. but also realistically a ton of work. So I am looking at incremental improvements. I've wanted to rewriote the Shared Stories list for a long time and this could be a good candidate. Have a "Shared Stories List" component. A "Shared Story" individual component. And then I could try to make a better modal for the Star/Copy/Report functionality.
All of this is a lot of work though and I don't even know where to start but what's awesome is it IS possible now, thanks to ViteJs.
In about a week from now I will update the live site with the refactored code. Hopefully by then we will catch a few minor things before they go live.
I will also update the setup instructions in the github repository's README files, to match the new Vite setup. I'm afraid there is still a lot of legacy code in there, but if anyone wants to fiddle with it, it's definitely possible now to create an entirely new page built completely from the Vue/Tailwind JIT side, and just add one action/route on the php side to render it. So it's much better now to experiment with some ideas.
By Month
- Oct 2024 (1)
- Sep 2024 (1)
- Jun 2024 (2)
- May 2024 (4)
- Apr 2024 (3)
- Mar 2024 (1)
- Feb 2024 (1)
- Dec 2023 (1)
- Nov 2023 (2)
- Oct 2023 (2)
- Apr 2023 (2)
- Mar 2023 (2)
- Feb 2023 (1)
- Jan 2023 (2)
- Dec 2022 (1)
- Nov 2022 (2)
- Oct 2022 (3)
- Sep 2022 (1)
- May 2022 (4)
- Apr 2022 (1)
- Feb 2022 (2)
- Jan 2022 (2)
- Dec 2021 (4)
- Nov 2021 (2)
- Oct 2021 (2)
- Sep 2021 (2)
- Aug 2021 (1)
- Apr 2021 (2)
- Feb 2021 (3)
- Jan 2021 (3)
- Dec 2020 (1)
- Nov 2020 (1)
- May 2020 (1)
- Apr 2020 (1)
- Jan 2020 (1)
- Oct 2019 (1)
- Sep 2019 (1)
- Aug 2019 (4)
- Jul 2019 (3)
- Jun 2019 (1)
- May 2019 (1)
- Mar 2019 (2)
- Jan 2019 (1)
- Nov 2018 (3)
- Oct 2018 (8)
- Sep 2018 (4)
- Aug 2018 (3)
- Jul 2018 (1)
- Jun 2018 (4)
- May 2018 (1)
- Apr 2018 (1)
- Mar 2018 (1)
- Jan 2018 (1)
- Dec 2017 (6)
- Nov 2017 (4)
- Oct 2017 (4)
- Sep 2017 (5)
- Aug 2017 (5)
- Jun 2017 (3)
- May 2017 (2)
- Apr 2017 (3)
- Mar 2017 (7)
- Feb 2017 (10)
- Jan 2017 (11)
- Dec 2016 (6)
- Nov 2016 (5)
- Oct 2016 (6)
- Sep 2016 (7)
- Aug 2016 (3)
- May 2016 (1)
- Mar 2016 (2)
- Jan 2016 (1)
- Dec 2015 (3)
- Nov 2015 (1)
- Oct 2015 (1)
- Sep 2015 (7)
- Jul 2015 (2)
- Jun 2015 (1)
- May 2015 (5)
- Apr 2015 (4)
- Mar 2015 (5)
- Feb 2015 (4)
- Jan 2015 (5)
- Dec 2014 (4)
- Nov 2014 (3)
- Oct 2014 (2)
- Jun 2014 (1)
- Apr 2014 (2)
- Mar 2014 (4)
- Feb 2014 (3)
- Jan 2014 (4)
- Dec 2013 (2)
- Oct 2013 (1)
- Sep 2013 (1)
- Jun 2013 (4)
- May 2013 (1)
- Mar 2013 (1)
- Jan 2013 (2)
- Oct 2012 (2)
- Aug 2012 (1)
- Jul 2012 (2)
- Jun 2012 (2)
- May 2012 (1)
- Mar 2012 (2)
- May 2011 (1)
- Apr 2011 (4)
- Mar 2011 (3)
- Feb 2011 (2)
- Jan 2011 (2)
- Dec 2010 (8)
- Nov 2010 (8)
- Oct 2010 (3)
- Sep 2010 (3)
- Aug 2010 (1)
- Jul 2010 (2)
- Jun 2010 (5)
- May 2010 (1)
- Apr 2010 (3)
- Mar 2010 (4)
- Feb 2010 (2)
- Jan 2010 (1)
- Dec 2009 (5)
- Nov 2009 (5)
- Oct 2009 (1)
- Aug 2009 (1)
- May 2009 (5)
- Apr 2009 (2)
- Mar 2009 (1)
- Feb 2009 (2)
- Jan 2009 (2)
- Nov 2008 (1)
- Oct 2008 (1)
- Sep 2008 (1)
- May 2008 (2)
- Apr 2008 (1)
- Feb 2008 (6)
- Jan 2008 (5)
- Dec 2007 (6)
- Oct 2007 (1)
- Sep 2007 (2)
- Aug 2007 (3)
- Jun 2007 (1)
- May 2007 (5)
- Apr 2007 (1)
- Mar 2007 (2)
- Feb 2007 (1)
- Jan 2007 (4)
- Dec 2006 (3)
- Aug 2006 (1)
- Jun 2006 (3)
- Apr 2006 (6)
- Mar 2006 (8)
- Feb 2006 (1)
- Jan 2006 (4)
- Nov 2005 (1)
- Oct 2005 (4)
- Sep 2005 (1)
- Aug 2005 (11)