This blog post is just for the update record.
## Why do I Update the Blog Application? Actually the framework of this blog, LightPress, is far from having been finished developing. Some important features, such as SEO and analytics, hasn't been implemented. Besides, I'm going to share something I learned recently like Fourier Transform, which has a lot to do with mathematics symbols and formulars. And with the current rich text editor, TinyMCE, I find it very difficult to organize the content. So I need anohter more powerful text editor. ## What's New in This Update? In this version, I have implemented a few things: ### Dependencies Updates Last update of this framework was almost 2 years ago. Quite a few new version of the dependent libraries have been released. Some of the major updates: * **ReactJS** and **Ant Design**: From v15 to v16 and from v2 to v3 respectively. * **VueJS** related stuffs: 2 years ago, there were lots of deficiencies in VueJS related libraries, expecially those about server side rendering, and I had to do some tricks to handle it. Now I can do it in a more "Vue" way. And to avoid polluting the global **Vuex** store and reduce to initial chunk size, I used a tricky way to implement it. However, I find that there may be problems in concurrent condition and with the support of dynamic registering and unreigstering store modules, I've dropped the tricky way and use the offical modulized stores instead. ### Plugin Mechanism In order to try my best to decouple the new features from LightPress Core, I decided to add the plugin mechanism to LightPress. Features such as SEO and analytics were built on it. The design of file structure of the plugin mechanism is basically from Wordpress. Eech application has its own plugins, and when the application starts up, a plugin manager will scan all installed plugins and activate all activated ones. In addition, while the application is running, the site owner can activate and deactivate them in real time. Each plugin can provide a JS bundle of Admin pages for the owner to configure the behavior of itself. To reduce the initial bundle size of the admin site, the bundle will only be loaded on demand. ### Filters To let the plugins to add abilities to the application, one of the most common ways is to use filters. Like Wordpress, no matter inside the core or in the plugins, you can register and unreigster filters to add capacities to certain points whenever necessary. ### Dynamic Routing Control All of the routing of LightPress are handled by **koa-router**. However, it isn't possible to change the routes at all once you've setup the routing config. To solve this problem, I wrote a koa middleware to make it possible to add and remove routers dyanmically in the runtime. ### Markdown I added the capcity to LightPress to edit and show markdown content. And this feature completely embodies the advantage of using full JS stack developing. The markdown module is one of the isomorphic modules shared among frontend styling, editing in administration site and server markdown-to-html rendering. All configurations the part of the codes are all the same to keep all their behaviors identical furthest. ### Other Trivial Updates * I had developed another router for **React** for smaller footprint. But to make it possible modify admin navigation menu and load remote plugin bundles dyanmically, I redesigned the data structure of routing and used **react-router** instead. * Some potential concurrent problems and other bug fixes. ## What's Next? Well, it depends on what new features I need and what kinds of experiments I want to do in the future. Dockerize the services may be one of my choices. However, I haven't done it now for the following reasons: 1. I'm using a very cheap VPS to host this blog. Using docker will require more resources for upgrading the system and other things. 1. I had spent some time to build a docker image for this blog but I gave up for the poor network condition behind GFW and the slow building process made me feel very frustrated to debug. ## The Last But Not Least I know some implementations are not elegant (or maybe something is awful :see_no_evil:), but it works and satisfies me by now. The better design may take me a longer in some other time.