<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by JiyinYiyong on Medium]]></title>
        <description><![CDATA[Stories by JiyinYiyong on Medium]]></description>
        <link>https://medium.com/@jiyinyiyong?source=rss-4d35af79be5b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*tcaeQXFfSgGBU8dj.jpeg</url>
            <title>Stories by JiyinYiyong on Medium</title>
            <link>https://medium.com/@jiyinyiyong?source=rss-4d35af79be5b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 10:02:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jiyinyiyong/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[[WIP] 2020 working projects]]></title>
            <link>https://jiyinyiyong.medium.com/wip-2020-working-projects-38dc6155d6b5?source=rss-4d35af79be5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/38dc6155d6b5</guid>
            <dc:creator><![CDATA[JiyinYiyong]]></dc:creator>
            <pubDate>Sun, 19 Apr 2020 17:29:04 GMT</pubDate>
            <atom:updated>2021-01-01T17:07:15.615Z</atom:updated>
            <content:encoded><![CDATA[<h3>My 2020 working projects</h3><h4>Jan</h4><p>At the end of 2019 the project Wenyan programming was quite popular among Chinese community. I thought Cirru is capable of building something similar. I started <a href="https://github.com/Cirru/jiuzhang-lang">jiuzhang-lang</a>(or <a href="https://zhuanlan.zhihu.com/p/102427608">九章编程</a> in Chinese) and had fun for a while. At least it’s runnable on browser and on Node.js CLI tool</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/0*EBBD0ijnNsy2INBY.jpg" /></figure><p>Later I tried to fix another project of Cirru after fixing Cirru HTML, <a href="https://github.com/Cirru/cirru-script">CirruScript</a>. CirruScript was an early experiment running JavaScript in Cirru syntax. I updated dependencies and updated the REPL a bit after a break of years. It’s not useful though but might be helpful if I want to play with another REPL than CoffeeScript.</p><p><a href="https://github.com/mvc-works/lilac/">Lilac</a> is another project since I noticed I would built myself a data validator based on skills I developed in building Respo. The core idea is the validation rules is actually a lazy tree, built up with help of functions. Functions are like lazy expressions, they do not evaluate before they got the arguments. And a lazy tree can theoretically express any structure of data. Then came Lilac. And it was quite a useful tool in my followed projects.</p><h4>Feb</h4><p>Since I finished a prototype of <a href="https://github.com/Quamolit/phlox">Phlox</a> last year, I figured out I could build a very simple game based on Phlox, which is <a href="https://github.com/Quamolit/pixel-way">pixel-way</a>. I got a small piece of record of playing the game released on <a href="https://weibo.com/1651843872/It9Ut80if?from=page_1005051651843872_profile&amp;wvr=6&amp;mod=weibotime">微博</a>. It quite funny in the first days but turned out to be too simple and kind of boring.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*m1reZnfj7ewLDl9Qwwff_A.png" /></figure><p>The game pixel-way meanwhile made me feel that Phlox has bugs and Phlox is capable of building more interesting demos. So I added more shapes and components. I’m not sure but probably there were only rects and circles in Phlox before Feb and after some work in Feb and Mar now several shapes and components are provided, which can be find on <a href="http://repo.quamolit.org/phlox/">Phlox Demos</a>. Meanwhile I added Lilac in Phlox for props validation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*00nQ4XzlWM1d-LrzV40wmA.png" /></figure><p>Another tiny tool I made is <a href="https://t.co/AVhy0Uwepn?amp=1">HN Reader</a>. It’s simple. Just a tiny reader calling open APIs on Firebase. But I like the UI I build for myself. It’s a lot more convenient to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YqaRr5_x985zrn0p" /></figure><p>With help of Phlox I was able to start working on shiny demos based on PIXI, under the repo <a href="https://github.com/Quamolit/circling-tree">circling-tree</a>. The name was quite random. Very soon I added several more demos to the project. The process was started in Feb but got evolved in several weeks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3rKsHRprFcR7bwBV" /></figure><p>Since Phlox got more and more components for controlling points and numbers, I could build UIs in more interactive ways.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8JR2UEaE1La93voraY8uAg.png" /></figure><p>Maybe you should just play the demos by yourself: <a href="http://repo.quamolit.org/circling-tree/">http://repo.quamolit.org/circling-tree/</a> . I got maybe hundreds of screenshots, some of them are quite funny. I still played that a lot in Mar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bXzbRluhhew-MMwt.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/0*CXGvq7amhIMPzM22.jpg" /></figure><p>Also try…</p><p><a href="https://github.com/Quamolit/circling-tree/pull/11">fix math in drawing cycloid by jiyinyiyong · Pull Request #11 · Quamolit/circling-tree</a></p><h4>Mar</h4><p>Another thing I tried was to experiment a tiny parser based on the idea of Lilac. Previously I learnt about parser combinators and built a <a href="https://github.com/Cirru/parser-combinators/">Clojure version of it</a>. Debugging the parser was a nightmare since states are tremendous. I thought about collecting the information of the steps parsing the code. <a href="https://github.com/mvc-works/lilac-parser">lilac-parser</a> looked like a interesting way of doing visualization. Although the project itself turned out to be really slow and by no means useful in real world.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jmdgx1ynOXhhE3jcifI3Tw.png" /></figure><p>Another major change happened to Respo and its components. I made breaking changes in order to add a feature similar to hooks into Respo. The docs has been updated and I wrote a <a href="https://segmentfault.com/a/1190000022107907">Chinese post explaining that</a>. But it was breaking changes, I have to update a bunch of related projects updating the way how states are handled. And that took quite long time.</p><p><a href="https://github.com/Respo/respo/pull/23">Breaking: refactor states by jiyinyiyong · Pull Request #23 · Respo/respo</a></p><p>And I still find myself joy in playing with curves generated from Phlox as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MrGeshf8AxPjBRpe.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uag_fEKukxC-tkLNzp6vQw.png" /></figure><p>One more thing is I noticed it would be helpful so I picked <a href="https://github.com/Cirru/stack-editor">Stack Editor</a> and updated deps and designs to make it new again. It was early version for Calcit Editor today. The implementation was a lot simpler and people may explore.</p><h4>Apr</h4><p>I did some improvements to Phlox by connecting to by pre-existed Cumulo projects. Added a <a href="https://github.com/Cumulo/cumulo-phlox-workflow">workflow for cumulo phlox</a> and a demo of that is Factwo, a tool with which people may drag points to draw characters, collaboratively.</p><p><a href="https://github.com/TopixIM/fractwo">TopixIM/fractwo</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jh2eAuEoN-kdQR0hjvJvCQ.png" /></figure><p>Also two new components are added to Phlox, one is messages and the other is slider-point.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yFEH4GXTSiTx3-_n6Ox1lg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4SniM8xHoZfR0WMVMvi9KQ.png" /></figure><p>Another thing I tried with Phlox is to draw an <a href="http://repo.quamolit.org/axis/">axis</a> showing <a href="https://github.com/Quamolit/axis">function graphs</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GxlliZ_OhnSTY2yc00Rn8Q.png" /></figure><p>Inside the project a DSL is used to describe math expressions, called calc-dsl. I found it interesting to have a tiny calculator doing math, so I created a standalone package running this calculator.</p><p><a href="https://github.com/Memkits/calc-dsl">Memkits/calc-dsl</a></p><p>I did some updates to Calcit Editor and hn-reader as well, mostly trivial changes.</p><h4>May</h4><p>I bought a new Pad and tried Phlox on Chrome for Android. Turned out PIXI needs special events for tablets, so I changed Phlox to support touch events. It worked as usual.</p><p>I got a small change to try Flutter and made a very simple app for display device information, nothing more. Develop experience is quite nice for me. But I didn’t dig further.</p><p><a href="https://github.com/mvc-works/local_ip">mvc-works/local_ip</a></p><p>Still I made some improvements to lilac-parser and calcit-editor. One thing to mention is the “Picker Mode” which helps in auto-completing variables from current file or namespace imports, or just random node. I iterated it for a while and now it works for some cases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*K1opAm5NscMzZpCbGoXDcg.png" /></figure><p>Later I recorded a screencast(Chinese voice) introducing Calcit Editor features to some of my friends.</p><p><a href="https://www.bilibili.com/video/BV1zV411C76P/">https://www.bilibili.com/video/BV1zV411C76P/</a></p><p>Another thing I added is a tiny Chrome extension for inserting random text into input/textareas, for mocking data during development. It inserts mostly Chinese words, but also use letters and numbers randomly.</p><p><a href="https://github.com/Memkits/random-fill">Memkits/random-fill</a></p><h4>June</h4><p>Using phlox, I made a new graph called <a href="https://github.com/Quamolit/waving-rail">waving-rails</a>, still generating nice shapes with a bunch of lines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B87bevkdX-jK2qOZSOFZnw.png" /></figure><p>Another tool I tried to make was a <a href="https://github.com/Memkits/edn-tree-viewer">data viewer of EDN</a>(like JSON but for Clojure). It was nice but turned out not to be very useful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*pmW_O7YU5EwT1hp-44q1TQ.png" /></figure><p>And WeChat launched new feature called “拍了拍”(pat and pat), people got addicted to that sentence creating game inside chatrooms for some weeks. I was inspired and tried to built a sentence creating game as well called <a href="https://github.com/TopixIM/patlepat">Patlepat</a>. Kind of a boring toy, but proving the usage of Cumulo’s solution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*huXKeo4YbBxDOiDHG6cyhw.png" /></figure><p>When I used HCL color for picking brightness friendly colors, I added a tiny tool called <a href="https://github.com/worktools/color-ring">Color Ring</a> for doing that. Look shiny anyway.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*7UR7U4ZWJpYlsAc8wwIDgw.png" /></figure><p>Another task worth mentioning was a lilac-parser. I figured out it would be used as a string replacer as well, so I added such a <a href="https://github.com/mvc-works/lilac-parser#replacer">function called </a><a href="https://github.com/mvc-works/lilac-parser#replacer">replace-lilac</a>. Quite brilliant idea I think.</p><p>There are several refinements and fixes in Calcit Editor and Respo libraries too.</p><h4>July</h4><p>To optimize performance of Respo and Phlox a bit, I added a new library called <a href="https://github.com/Cumulo/memof">Memof</a>, which is like function memoization solution but I added caching invalidation strategy in it. That means Respo and Phlox, also <a href="https://github.com/Cumulo/recollect">Recollect</a> will try to have memoize their rendering functions, and removes low frequent caches. This is an essential optimization to all my rendering frameworks. The work started in June but mostly done in July, it was quite a lot refinements in different repositories.</p><p>Also I make some changes to <a href="https://github.com/mvc-works/clojars-outdated">clojars-outdated</a> for checking deps.edn file as well.</p><p>And I made an <a href="https://github.com/Memkits/in-time">experiment adding lifetimes</a> of some famous people in a graph for comparing. I can zoom in/out to compare. Not useful as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*UcKtjfH0avSCmSUUgOCsng.png" /></figure><h4>August</h4><p>Starting August I’m trying to build things in Nim, mainly a runtime for the snapshot file from Calcit Editor. At first I made some change to Calcit Editor so that it emits code in a single file of EDN. Then I worked on a library called <a href="https://github.com/Cirru/cirru-edn">cirru-edn</a> trying to load that.</p><p>It’s quite different experience writing Nim after using ClojureScript for so long(although I use TypeScript at work). Nim has types and lots of new syntax, I have to learn as I need them. And I’m slowly shifting my mind to a static language, which is like syntax sugar for C. It’s quite powerful though.</p><p>That took a long while. I made some bugfix and improvements to existing libraries too, that were quick trivial compared to the complicated of Nim.</p><h4>September</h4><p>In September I mainly worked on <a href="https://github.com/Cirru/calcit-runner.nim">calcit-runner</a>, which was previously called interpreter.nim for Cirru syntax. It made use of the libraries of Cirru Parser and Cirru EDN. I used Clojure a lot, so this interpreter, the semantics of the language, is mostly learnt from Clojure. It also brought me chance to implement Macros myself, defmacro based on Cirru syntax. It was quite like Clojure’s defmacro.</p><p>Clojure has its own implementation for persistent data, actually I’m not skilled enough for know details of it’s Java implementation. So I tried to implement it in a simpler way, with Nim, but only using 3 branches. That’s why it’s called “ternary tree”. It took me quite some time to fix the bugs, and for performance, that was being looked into late in October. I’m happy that the library, structural sharing, actually works in my interpreter!</p><p><a href="https://github.com/Cirru/ternary-tree">Cirru/ternary-tree</a></p><p>So besides calcit-runner, I added a new operator in <a href="https://github.com/mvc-works/lilac">lilac</a> called pick-type+, which is supposed to reduce the performance penalty in or+ operator, with an extra :type field. And it would help optimizing props checking performance in Phlox.</p><p>Too much for calcit-runner and ternary-tree. I’ll update later about October…</p><h4>October, November, December</h4><p>I put last 3 months together since the work in these months are all concentrated around calcit-runner and the projects are collected at:</p><p><a href="https://github.com/calcit-lang">Calcit</a></p><p>Quite some APIs are added to calcit-runner to make it a decent tools for runner my code, to generate HTML, to render shapes on canvas, and to do other scripting. There are several libraries I migrated from my previous ClojureScript projects:</p><ul><li><a href="https://github.com/calcit-lang/lilac">Lilac</a>, which is a data validator</li><li><a href="https://github.com/calcit-lang/phlox/">Phlox</a>, which is a canvas drawing tool inspired by virtual DOMs, running on Nim and Cairo. however the final code is a lot different with it’s origin, Quamolit/phlox which based on PIXI.</li><li><a href="https://github.com/calcit-lang/memof">Memof</a>, memoizations library for phlox.</li><li><a href="https://github.com/calcit-lang/stir-template">stir-template</a>, utility functions for generating HTML.</li></ul><p>The most important piece is Phlox. In the first months of 2020, I made a few toys with Quamolit/phlox and now I can use calcit-lang/Phlox, the latter occupies a lot less memory, despite that it’s also simplified a lot. At first I wonder I might fail to wind up Cairo on top of Nim, but luckily Phlox is working well. Now I can <a href="https://github.com/calcit-lang/phlox-examples">draw things with calcit-runner</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9v4iNXGtJdUCJ3m1LCxU2A.png" /></figure><p>And while I’m drawing things, it also forces me to revisit my design solutions and implementation in calcit-runner and to fix the missing pieces. Now there are 200+ operators(including aliases) implemented in calcit-runner, that makes it adequate for basic scripting(although that’s still a distance from a general programming language):</p><p><a href="http://apis.calcit-lang.org/">APIs for calcit-runner</a></p><p>And another demo I made with Phlox is for my old project <a href="https://github.com/dual-balanced-ternary">dual-balanced-ternary</a>, which is a notation of representing value on a 2-D plane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vOFaHzvmnYgR8wSC2sRA5Q.png" /></figure><p>It’s not shown in the pictures but they are interactive demos for introducing dual-balanced-ternary to people. I think at least it’s already a lot better than reading my READMEs…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B94m0gq1ASYEDnTkqhabQw.png" /></figure><h4>Conclusion</h4><p>I struggled a lot, still in 2020. I’m going to be 30&#39;y old in the summer of 2021. Life changes, while I’m still struggling. I have several friends in my age and they are making cool pieces of projects, with more solid code. I had a plan to learn PureScript and to enhance the tools I made, but like always, I found myself intrigued by those shiny and interactive pieces, and struggling to make tools for myself for reaching them. And it will still be my 2021 probably.</p><p>And happy new year!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38dc6155d6b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Year review of 2019, on coding and moods]]></title>
            <link>https://jiyinyiyong.medium.com/year-review-of-2019-on-coding-and-moods-4f4125102e62?source=rss-4d35af79be5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f4125102e62</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[JiyinYiyong]]></dc:creator>
            <pubDate>Tue, 31 Dec 2019 17:33:42 GMT</pubDate>
            <atom:updated>2019-12-31T17:33:42.159Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s a really rushed year. Things came and I was not prepared. I didn’t get much chance to travel and take ease, but lots of time was spent on coding. Another reason is I have a personal Todolist running small tasks, which are mostly related to coding. So as a result coding ate big part of my spare time.</p><h3>Jon on Twitter</h3><p>Almost finished a rushed year 2019.</p><h3>Jon on Twitter</h3><p>and quite heavy work to do at work.</p><p>There were 5 major projects I was working on in 2019, big or small. Other commits belong to the toolchains or tiny apps, or projects running in the company.</p><h4><a href="https://github.com/Respo/composer">Respo Composer</a></h4><p>This project was started beforing Spring Festival. I spent months on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4OdpXHuf3RLthfJRgLbSpw.png" /></figure><p>It was really stupid simple idea first. I was trying to create a UI, like an old tool I tried to edit a DOM tree, to generate simple UI components. Also I can assemble the components into a page. So at last it is mostly a template engine but editing with a UI, as a tree. Mostly part of the work is to build the tree editor, very boring work. Only thrilling part is to see UI generated from by operations on the tree.</p><p>The I encountered the problem of handling user events, like clicking, inputting. I thought I could try turning them into actions like in Redux and add code in a really app. But at last it turned out to be a very impractical solution. I would rather write ClojureScript than generating UI from the tree. Plus the ClojureScript is more maintainable.</p><p>But I did have some achievements. I had a chance to share that idea to my friends on VueConf Shanghai, despite that the editor is totally a ClojureScript project. And the work on the editor discontinued after that due to some problems on my healthy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/0*lY5a2S5eiPDQ12y9.jpg" /><figcaption>Editor from a Pad</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ngW9aM66qlQFahHd.jpg" /><figcaption>Tree editor UI</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L6_VQSbnC6RwCahg.jpg" /><figcaption>Preview of a component created with tree editor</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pmgESxdgxG_fV5or.jpg" /><figcaption>Overview mode generated from composed templates and mocking data</figcaption></figure><h4><a href="https://github.com/Cirru/parser.nim">Cirru Parser in Nim</a></h4><p>I tried Nim after I found ClojureScript was really slow compared to native languages. I did want to learn something fast, but I can’t remember all crazy details in languages like C/C++, or Haskell. I noticed Nim was a quite neat choice for me. It’s minilistic indentation-based language like CoffeeScript and also like Python. I had years of CoffeeScript experience.</p><p>It was not much barriers for me to finally finished writing a new Cirru parser in Nim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*MrnGzK61ss6TCC_p_gaX_A.png" /></figure><p>I got a Cirru parser running in a new environment, but it seems to be lack of use cases. So I tried to make another scripting language of Cirru, under the project <a href="https://github.com/Cirru/interpreter.nim">interpreter.nim</a>. I didn’t finish this project as well. It only has very basic features, and a lot has to be done in the future.</p><h4><a href="https://github.com/Respo/respo">Respo Effects</a></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*8rjZ4nj48cKbn0NsoHwekQ.png" /></figure><p>Respo effects are effects added to Respo components. I have been using Respo for more than 3 years. However unlike React, Respo does not support effects well, which means in Respo there’s barely no manual DOM operations like we do in componentDidUpdate componentDidMount in React. So no animations as well.</p><p>I was not planning to make Respo a library like tiny React. I still want Respo to be pure, and consistency. But some animation and some basic inter-operations with the DOM should be viable. Respo effects solved the problem.</p><p>Most obvious change you may see is the examples on <a href="http://repo.respo-mvc.org/alerts/">http://repo.respo-mvc.org/alerts/</a>. Respo effects enabled component-level animation on those reusable components. Yeah, we had that very in React with react-transition-group. But I’m very glad that now I have that in Respo.</p><h4><a href="https://github.com/Quamolit/phlox">Phlox</a></h4><p>I planed about Phlox long time ago. Phlox is a wrapper on top of PIXI.js, which is supposed to draw shapes(and even animations) based on WebGL with object-oriented APIs. PIXI APIs is a lot like DOM APIs. So I thought I would added a “Virtual DOM” for that. Then I can do hot swapping on the tree, like we do in React. Sounds like very nice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*OnUBV4HHxkKkRZg05Ukn3w.png" /></figure><p>It’s still an unfinished project. You may find very simple example on <a href="http://repo.quamolit.org/phlox/">http://repo.quamolit.org/phlox/</a> demonstrating basic adding/updating/removing of nodes. It’s far from being able to build a useful app. I’m feeling satisfied for now, but not sure what to do next.</p><h4><a href="https://github.com/Cirru/">Renaissance of Cirru projects</a></h4><p>Cirru is now mostly a personal project. I use Calcit Editor many of my tiny tools, and it uses an .edn file for saving snapshots and meanwhile generates Clojure(Script) code. So projects built with Calcit Editor are marked as “Clojure” on GitHub. Sounds normal.</p><p>But later I was triggered by a report <a href="https://github.com/oprogramador/github-languages">https://github.com/oprogramador/github-languages</a> showing Cirru is one of the most falling language on GitHub. It’s not wrong. Motivated by the emotions, I wanted to have more chance to show Cirru.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/0*bnXeBXrxkvJ3A9N2.jpg" /></figure><p>Calcit Editor is still maintained in 2019 and I use it from day to day. Then one day I came out with an idea that I use .cirru file for saving the snapshots, rather than using .edn . Then GitHub will mark my projects built with Calcit Editor in Cirru, rather than just Clojure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*kKM1JcFLeSH8YJqbRWERQw.png" /></figure><p>The idea was simple, however it took much effect to make it really work. Cirru was not developed for large source files, being a tiny scripting language. The <a href="https://github.com/Cirru/parser.clj">parser</a> and <a href="https://github.com/Cirru/writer.clj">writer</a> are quite slow running in ClojureScript and Node.js . It took quite a while to optimize and even refactored parts of the libraries. And finally I was ready to use Cirru for replacing EDN files.</p><p>I searched globally on GitHub and almost 200 projects I created that was possible to be migrated to Cirru EDN storage file. So now you may see on GitHub that the syntax is colored as blue, which means Cirru is the main language, in many of my projects. Cool!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*2ljVPU3jYvuHLrm3FWTTZQ.png" /><figcaption>Cirru is the main language for <a href="https://github.com/Cirru/calcit-editor">Calcit Editor</a> now.</figcaption></figure><p>And it’s not several projects. It’s 200+ projects marked as Cirru here, check that on <a href="https://api.github.com/search/repositories?q=language:Cirru">https://api.github.com/search/repositories?q=language:Cirru</a>. So Cirru is now roughly 300th language on GitHub counting by repos.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/817e3dbccf9358b049fb6a320ef88b39/href">https://medium.com/media/817e3dbccf9358b049fb6a320ef88b39/href</a></iframe><p>Also there is ongoing work around improving the parser, and maintaining old projects. I spent some time and make <a href="http://html.cirru.org/">http://html.cirru.org/</a> work again with latest Webpack configs. Besides Cirru HTML, I would get CirruScript maintained as well. It appears to be quite <a href="https://github.com/Cirru/cirru.org/blob/master/README.md">a large project if you count in the packages I released years ago</a>. God, would be much work to maintain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*o7eR3vvjVaBoBoWR.jpg" /></figure><p>One thing I have to think about is: does Cirru really brought me so much benefits as spent so much time on it? I haven’t bought a house, I still write TypeScript for a living, why Cirru? I have an answer for myself privately, but I can’t answer this question if someone else asking. It’s too large being a hobby project. I can only bet on it I guess. And still a lot of interesting and boring things on plan.</p><h4>Healthy and moods</h4><p>Many another post in Chinese later. It’s quite a tough year for me. I had so much bad memories since my healthy condition turned bad. I had pains on my chest and under my left arm due to some infections on nerves. It was really painful in those weeks. Even woke up many time early in the morning because of the pain. That was in late March.</p><p>In June I had some waist pain and meanwhile my stomach felt unsettled. I went to hospital and found that it was infection in intestine. Took me long time to recover. Unfortunately I got cold in October meanwhile got other dilemmas…</p><p>When I was attending D2 conference in Hangzhou, meeting friends from Alibaba and other companies. I was very worried about my health condition. Then I found some of others are in worse condition than me. It’s so tragic. Air quality is not good around Shanghai and Hangzhou, many people get sicks. I don’t like it. And I feel afraid of it.</p><p>Apart from the burden on health, there were several times I felt I might got chance to find the person with whom I can spent my life. However all turned into illusions. And I just watched them sharing happy times with their lovers on the feeds on internet. It&#39;s still like illusions and nightmares I can’t get rid of.</p><p>Okay, I give up. I have to go back to my comfort zone and just stay there. And writing code.</p><h4>On job</h4><p>Not going to talk much about it. Some public work can be found on <a href="https://github.com/jimengio">https://github.com/jimengio</a>. It’s not easy work in a start-up anyway.</p><h4>On next year</h4><p>I’m feeling unsettled. There are quite some ongoing work related to Cirru, on Respo, and on other toolchains I use. Life in my past year is like being driven by those tasks. Sometimes I struggle, trying to get rid of the pains on me, but it’s so hard. I would better get myself prepared for the potential tough days, even though I’m not sure what they are.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f4125102e62" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Some more impression about React.js in China in 2019]]></title>
            <link>https://jiyinyiyong.medium.com/some-more-impression-about-react-js-in-china-in-2019-374c445cb1d1?source=rss-4d35af79be5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/374c445cb1d1</guid>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[JiyinYiyong]]></dc:creator>
            <pubDate>Sun, 09 Jun 2019 11:48:57 GMT</pubDate>
            <atom:updated>2019-06-09T15:16:14.794Z</atom:updated>
            <content:encoded><![CDATA[<p>There was a post in 2017 talking about React.js community in China,</p><p><a href="https://medium.com/@jiyinyiyong/the-chinese-part-of-react-community-f783c5e2d0f9">The Chinese part of React community</a></p><p>At that time I was working in <a href="https://github.com/ElemeFE/">Ele.me</a>, which chose Vue.js as it’s primary framework. Vue is great. I just has more knowledge in Functional Programming than in Observables.</p><p>It has been 2 years now. Besides, I joined VueConf Shanghai yesterday and talked to many friends there. Vue is even more quite popular in China after two years. Now it’s the 3rd Vue Conf in China after two of them held in Beijing and Hangzhou. And this year we might have 2nd React China Conf here, after the first one held in Guangzhou last year.</p><p>I think think React users are not decreasing in these years. 蚂蚁金服(Ant Finance) is using antd(<a href="http://ant.design/">Ant Design</a>) as the primary UI framework. And I think many projects in Alibaba are using antd too since their relationships. Meanwhile antd is not their only UI framework based on React. I was told that there are 1000+ projects using antd and might be even more.</p><p>Ihe company I’m currently working for in Shanghai is using React to build to-business web apps. As I know, several companies in Shanghai are using React as well, and many small companies. And I listened to a speech from <a href="https://github.com/ctripcorp">Ctrip</a> last month on React Hooks. There might be more small companies using Vue in their projects based on my impression of interviewing younger developers. But we do have many people who used React in projects.</p><p>I don’t see people writing about React Hooks recently. Based on answers from <a href="https://www.zhihu.com/question/327685582">Zhihu</a>, many of us are adopting React Hooks. There’s no doubt a lot of JavaScript developers here know about React Hooks even though there’s a gap between two different languages. And I think many people are understanding it quite well.</p><p>I also met two of the translators of latest React Docs during Vue Conf yesterday. We didn’t talk much about it but we all glad that it has been finished. I didn’t really joined them in translating. But I saw them discussing about the terminologies about React for a while. Quite some people are involved in the process of translating.</p><p>Other than that, we often have several topics around React in various Web conferences, such as <a href="https://www.huodongxing.com/go/fdcon2019">FDCon</a> and <a href="https://gmtc2019.geekbang.org/#speakers">GMTC</a>.</p><p>After listening to people talk in VueConf, I found that React Native is inspiring Chinese web developers a lot. A lot of people know WeChat mini programs, which runs JavaScript apps inside WeChat. Alibaba got its React Native like solution too. Weex is one of them, and they also have something called “mini programs”. If someone join us in a conference, he/she may hear 5 or 10+ mini apps being talked about, that were supported by some apps from various companies.</p><p>Besides that, we also have <a href="https://www.quickapp.cn/">QuickApps</a> drafted and developed by Chinese phone makers, like Vivo, OPPO, XiaoMi and others. QuickApps and Weex are more similar to React Native rather than mini apps. It’s really a surprise how many people are inspired. The platforms may be far less mature compared to React Native, but at least they are already serving plenty of Chinese users.</p><p>I can remember some old stories told by my friends about 2014. One in the Vue community told me that he was thinking about something like MVVM and wanted to create his own library. Later he saw Vue and then decided to join Vue development. Another friend of mine was developing his own framework in Beijing and actually used them in products. Then React came and turned out React provided a better solution. And I have friends customized React to fit their own needs too in Shanghai and Hangzhou. Developers in China are exploring solutions, and are trying better ideas, some of the ideas are really smart even though they are shadowed by React and Vue.</p><p>As it comes to mini programs and QuickApps, I think there will be also smart ideas popping up. Although they are not directly contributing back to React, it shew that React community does spreaded ideas in China.</p><p>Just gathered some random thoughts. Hope it’s helpful.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=374c445cb1d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Random thoughts about Respo Composer and Vue]]></title>
            <link>https://jiyinyiyong.medium.com/random-thoughts-about-respo-composer-and-vue-ce85ebb014fa?source=rss-4d35af79be5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce85ebb014fa</guid>
            <category><![CDATA[vue]]></category>
            <category><![CDATA[design-tools]]></category>
            <dc:creator><![CDATA[JiyinYiyong]]></dc:creator>
            <pubDate>Fri, 07 Jun 2019 17:40:52 GMT</pubDate>
            <atom:updated>2019-06-07T17:43:36.539Z</atom:updated>
            <content:encoded><![CDATA[<h4>Me</h4><p>Vue user,</p><ul><li>used Vue 0.8.3 for weeks.</li><li>wrote Vue in Ele’me for some months.</li></ul><p>ClojureScript user, created Respo,</p><ul><li>used ClojureScript for toolchains for 3ys+</li><li>Respo is a simplified virtual DOM library.</li></ul><h4>What is Respo Composer?</h4><p>Have you ever thought?</p><blockquote>What a front-end MVC framework would be like in the future?</blockquote><p>I don’t know, but I got an idea, <strong>I don’t like repeat someone’s work, like translating Sketch file into JSX/CSS.</strong></p><p>Respo Composer is a experimental tool, <strong>edit and preview template by a designer, handle action by a programmer.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TgNQjGFsOLUR9sRzwtmwxQ.png" /><figcaption>Preview UI with a selected piece of mocking data.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uTtUBMEXFxOy05rU_ZFy4Q.png" /><figcaption>Tree editor, for styles, properties, mocking data, actions.</figcaption></figure><h4>What to do with Vue?</h4><p>Two aspects noticed,</p><ol><li>expressions inside template. It’s no way like React. Vue has its own expression parser. Vue has its own syntax for accessing data.</li><li>component states for templates requires less code when two-way binding is implemented.</li></ol><p>Vue analyzes the templates, simplifies the data logic(although not optimal some exquisite cases).</p><h4>Composer in Vue?</h4><ul><li>tree editor for templates and styles.</li><li>provide utilities to help UI designers(or UI programmers) with GUI.</li></ul><p>…GUI to generate data structure for templates, not to generate code.</p><h3>Ivan Babak on Twitter</h3><p>@jiyinyiyong @jordwalke @ozaed The history repeats itself. It was like that in Visual Studio and Borland IDEs where you&#39;d rarely edit the UI files, only the code logic in the event handlers that are added by clicking around the IDE UI. It even had a name, &quot;on-button-click programming&quot;.</p><p>Trying to solve a same problem from another way again.</p><p>Talk to me(<a href="https://twitter.com/jiyinyiyong">@jiyinyiyong</a>) if you are interested.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce85ebb014fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Year review, my ClojureScript pieces in 2018]]></title>
            <link>https://jiyinyiyong.medium.com/year-review-my-clojurescript-pieces-in-2018-da7233649eab?source=rss-4d35af79be5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/da7233649eab</guid>
            <category><![CDATA[clojurescript]]></category>
            <dc:creator><![CDATA[JiyinYiyong]]></dc:creator>
            <pubDate>Mon, 31 Dec 2018 09:33:55 GMT</pubDate>
            <atom:updated>2018-12-31T09:33:55.970Z</atom:updated>
            <content:encoded><![CDATA[<p>I have too GitHub accounts, the first one is my personal account, which is mainly using ClojureScript in the 2018:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*7ABmALDYqEdA5BWAw4FFBA.png" /><figcaption><a href="https://github.com/jiyinyiyong">https://github.com/jiyinyiyong</a></figcaption></figure><p>The other one was used at work, in TypeScript and React. Sometimes I have chance to code my tools with ClojureScript so I can make my work a little more efficient:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*8rN_j2kIOtZ1Lel3K_C7oA.png" /><figcaption><a href="https://github.com/chenyong">https://github.com/chenyong</a> (Mostly work commits)</figcaption></figure><p>There was a review in September when I listed some of the tools I created in the past months. It’s still useful.</p><p><a href="https://clojureverse.org/t/my-rencent-tiny-tools-built-with-clojurescript-before-september-2018/2721">My rencent tiny tools built with ClojureScript(before September 2018)</a></p><p>For the rest part of the parts I going so sort my mind a list the ideas behind my work.</p><h4>Long term projects</h4><p>There are several important projects I’m maintaining,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*5ZdTAzcQWOe4Y1xhsao4uw.png" /><figcaption><a href="https://github.com/Cirru/calcit-editor">https://github.com/Cirru/calcit-editor</a></figcaption></figure><p>Calcit Editor is my Clojure(Script) editor. Maybe I can call it code generator. It’s a GUI tree editor for S-Expressions, demonstrated at <a href="http://cirru.org/">http://cirru.org</a>. Almost all of the ClojureScript I wrote was using Calcit Editor, except for macros. The editor generates code with meta programming. It’s mainly work of maintaining in the past year.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*jSqtME2W8as2_OYcCWzb9A.png" /><figcaption><a href="https://github.com/mvc-works/calcit-workflow">https://github.com/mvc-works/calcit-workflow</a></figcaption></figure><p>Calcit Workflow is a project template for single page apps. I use it to create tiny tools that runs inside a web page. It’s like building GUI programs that without access to files or database. But in many cases it’s useful enough that I can interact with the power of data processing of computers, like data formatting, content managing, information displaying.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*JMmXyCOp1GVv7VNdBRB9KA.png" /><figcaption><a href="https://github.com/Cumulo/cumulo-workflow">https://github.com/Cumulo/cumulo-workflow</a></figcaption></figure><p>Cumulo Workflow might be the most important piece of my projects. It contains the feature from Calcit Workflow, plus a Node.js backend running WebSocket. In this I can send message to Node.js and let it read files for me and push data changes to clients. It was designed to for small chatroom, but turned out to be a nice tool for myself to create apps with a server, such as Todolist and Diary.</p><p>Another important library I’m maintaining is <a href="https://github.com/Respo/respo">Respo</a>, which is my own virtual DOM library. Not much things changed for Respo itself. But I added/contributed the <a href="http://github.com/Respo">UI components</a> that I need for my projects, like popups, icons, alerts, markdown support, etc. Mostly small changes.</p><p>The projects listed in this section are becoming stable, I was just trying to reduce the complexity in using them. Quite some changes had been made too Cumulo workflow in order that my new projects based on them can be easier to maintain and migrate.</p><h4>Personal Toolings</h4><p>Some of the tools I created with those library did bring me help in real life.</p><ul><li><a href="https://github.com/TopixIM/woodenlist">Woodenlist</a>, a personal Todolist for my own case. It’s very simple by yet useful enough.</li><li><a href="https://github.com/TopixIM/timegrass">Timegrass</a>, a Todolist tracking my tasks related to my job.</li><li><a href="https://github.com/TopixIM/copyboard">Clipboard</a>, an online clipboard for myself to share link across my phone and the laptop.</li><li><a href="https://github.com/TopixIM/copycat">Copycat</a>, a snippets tool.</li><li><a href="https://github.com/Cirru/calcit-snippets">Calcit Snippets</a>, this snippet tools is for Calcit Editor only.</li><li><a href="https://github.com/TopixIM/diary">Diary</a>, a tiny diary app.</li><li><a href="https://github.com/tiye/neu-tab">Neu Tab</a>, this is start page added as a Chrome extension. Deadly simple but quite useful.</li></ul><p>There are some others, which are less frequently used. I still feel good since I spent the time in the toolchains, UI components, building processes, documents, It’s not very touch work to try new ones. I don’t have very much time, but at least I still have the time to build some of the tools I wanted.</p><h4>Community projects</h4><p>I made and was maintaining several pages for the projects that helped a lot to my projects. Not much work required to program them. But hope they can do help for beginners who are considering whether or not trying them.</p><ul><li><a href="https://github.com/shadow-cljs/shadow-cljs.org">shadow-cljs.org</a></li><li><a href="https://github.com/clojure-china/clojure-script.org">clojure-script.org</a></li><li><a href="https://github.com/Lumo/lumo-cljs.org">lumo-cljs.org</a></li></ul><p>Plus I added several Medium posts and Tweets for spreading ClojureScript. However the account <a href="https://twitter.com/scriptclojure">@scriptclojure</a> was poorly maintained since I don’t have enough time. Not sure about what to do in the future.</p><h4>Projects related to the job</h4><p>Besides Timegrass, I made several attempts to make ClojureScript useful in the company. My workmates may never use ClojureScript, but I can at least build tools with it. So there are several tools:</p><ul><li><a href="https://github.com/jimengio/locales-editor">locales-editor</a>, for generating multi-languages locales files with help of a UI of web page,</li><li><a href="https://github.com/jimengio/rebase-hell">rebase-hell</a>, for triggering git rebase after clicking on a web page, since we are asked to rebase code after merging every PR.</li><li><a href="https://github.com/jimengio/fontawesome-finder">fontawesome-finder</a>, for quick search/copy/pasting icon names.</li></ul><p>Besides the time saved, they also helped in reducing the pressure of writing TypeScript everyday.</p><h4>Else…</h4><p>For me ClojureScript is the tool that I can build prototypes of apps really fast. The language itself is extremely flexible. It may have problems in some aspects, but I can hardly find another language/tooling that I can explore the tiny tools running on browsers and Node.js this flexiblely. And big thanks to shadow-cljs.</p><p>The pity part is, I’m using ClojureScript as a tool but I barely have time to dig into knowledges like compilers, OS, types system, micro-services, etc. I’m not sure. Knowledges makes good programmers. But I’m not really learning knowledges in 2018. I did try immer and TypeScript a bit harder to make out workflow and products more robust, however that’s not knowledges.</p><p>My work on ClojureScript is less reusable, Respo, Cumulo, Calcit Editor, they all appear strange and not fit mainstreams developers. I can’t say I care about that issues currently. I will focus on building myself tools in these years. No other plans yet. If ReasonML or Nim becoming mature, I might want to try, but now yet.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da7233649eab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to compile/build a ClojureScript project?]]></title>
            <link>https://jiyinyiyong.medium.com/how-to-compile-build-a-clojurescript-project-a8975cfd9f43?source=rss-4d35af79be5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8975cfd9f43</guid>
            <category><![CDATA[clojurescript]]></category>
            <dc:creator><![CDATA[JiyinYiyong]]></dc:creator>
            <pubDate>Sun, 16 Dec 2018 16:45:45 GMT</pubDate>
            <atom:updated>2024-03-26T05:16:48.713Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>For the impatient: <a href="https://medium.com/@jiyinyiyong/a-beginner-guide-to-compile-clojurescript-with-shadow-cljs-26369190b786">just show the tutorial, how to compile and run</a>(with shadow-cljs)?</blockquote><p>There was a poll on Twitter I tried to ask people why they don’t like ClojureScript,</p><h3>Jon on Twitter</h3><p>@swannodette we may need something like: Why &quot;Heard of ClojureScript, not interested&quot;?</p><p>Many people responded with “Not known how to build it”. By the word “build”, I mean mostly “compiling”. Not sure if someone takes it like “structuring” or something.</p><p>The “compiling” problem is much easier today I would explain later. For the “structuring” part, I don’t think I can really answer it. To create a browser project you will need a UI library like <a href="http://reagent-project.github.io/">Reagent</a>, <a href="https://github.com/tonsky/rum">Rum</a>, <a href="https://github.com/omcljs/om">Om</a>, or even use React(with hooks) directly.(I made a <a href="http://respo-mvc.org/">virtual DOM library</a> too if you want to try. To create a Node.js projects, you would need to call Node.js APIs and import npm modules. Not much I can tell.</p><h3>On compiling</h3><p>I’m going to talk about the “compiling” part, trying to guide you through the first steps with my experiences. Might be a bit inaccurate, but supposed to be helpful.</p><p>The core library of compiling ClojureScript is cljs.main provided by the ClojureScript compiler. You may see it in the official guide, telling you how to compile project, how to turn on optimizations, how to start REPL in Node.js code, etc.</p><p><a href="https://clojurescript.org/guides/quick-start">ClojureScript - Quick Start</a></p><p>However it’s not quite enough if you want to build a larger project. You may known Webpack already, so you think there’s hot module replacement as you save files, you may need to grab packages from npm and put in your projects. cljs.main does not help with such needs. There are a few projects to help which are listed in <a href="http://clojure-script.org/">ClojureScript beginner page</a>:</p><h4><a href="http://shadow-cljs.org/">shadow-cljs</a></h4><p>shadow-cljs shines because it has user experiences very similar to Webpack. It bundles npm modules(JavaScript part, not CSS or images) into your project seamlessly. Most of the packages can be used in your projects and built with shadow-cljs out of box. Even shadow-cljs itself is installed from npm, just like Webpack does.</p><p>Meanwhile shadow-cljs has a configuration file written in EDN format. That means you can turn on hot code swapping and optimizations. It also handles externs for you. If you haven’t used Google Closure Compiler and not familiar with externs, it might be freaky. shadow-cljs can handle that.</p><p>You may find more on <a href="https://shadow-cljs.github.io/docs/UsersGuide.html">shadow-cljs Users Guide</a>, or just take a look at how I <a href="https://medium.com/@jiyinyiyong/a-beginner-guide-to-compile-clojurescript-with-shadow-cljs-26369190b786">use it to compile</a>.</p><h4><a href="https://figwheel.org/"><strong>Figwheel-main</strong></a></h4><p>There was lein-figwheel before figwheel-main. “Lein” refers to “Leiningen”, which is a popular build tool on JVM Clojure side. Lein has problems like starting-up very slow, so fighwheel-main come as result since we have Clojure CLI now.</p><p>Figwheel was created long before shadow-cljs released in 2017. It has many nice features, especially for how code swapping. Many of the features just inspired shadow-cljs.</p><p>I’m not that familiar with figwheel-main after switching to shadow-cljs. But you can take a look at <a href="https://figwheel.org/tutorial">Figwheel’s Tutorial</a> to know how it works.</p><h4><a href="https://github.com/emezeske/lein-cljsbuild">Lein-cljsbuild</a></h4><p>It’s like a very early build tool which wraps APIs from ClojureScript compiler. I was using it when I was first learning ClojureScript. To be honest, I don’t like it. But writing Lein configurations is an easier way in the old days.</p><h4><a href="https://github.com/boot-clj/boot-cljs">Boot-cljs</a> and <a href="https://github.com/adzerk-oss/boot-reload">Boot-reload</a></h4><p>Boot another build tool, like Lein, but composable, which makes it a little more powerful than Lein and people can write code to define how the workflow is like. The features are similar, just more flexible. boot-reload is the part to perform hot code swapping paired with boot-cljs.</p><p>The bad part is boot-cljs, as well as lein-cljsbuild, are simpler wrappers on ClojureScript APIs. When you want to add long term caching like Webpack, you have to implement your own. shadow-cljs actually can generate MD5 hash appending to the filename, so I switched.</p><h4><a href="http://lumo-cljs.org/">Lumo</a> and <a href="http://planck-repl.org/">Planck</a></h4><p>They are REPLs, built with self-hosted ClojureScript. The tools above runs on JVM, which might be unfamiliar to JavaScript developers. And Planck runs on JavaScriptCore, Lumo was created later and runs on V8. By running on V8, Lumo supports running all npm modules, which is a great step towards JavaScript community.</p><p>They also includes APIs for compiling ClojureScript into plain JavaScript. However I hold the opinion that they are really good REPLs, but I would prefer not developing my projects with them, because hot code swapping on file saving are really useful, there are not supported in these REPL, along with some other interesting features.</p><h4>Other things to know</h4><p>ClojureScript has a strange part which is Google Closure Compiler. Webpack people does not prefer using Google Closure Compiler, while it’s commonly used in ClojureScript. It’s good at dead code elimination, which ClojureScript really rely on. However Google Closure Compiler is really unfamiliar to most JavaScript people. It does not work well with Webpack too. Have to accept that. Luckily you don’t need to know much about that. Just keep in mind that it’s something different from Webpack.</p><p>Clojure has macros, which mean in compiling ClojureScript, there’s a change to define macros in .clj files and then use it. Then you have to power of running part of the code at compilation. This is quite interesting, because there are two phases of evaluating your code now. JavaScript only runs code in runtime, which is only one phase.</p><p>Might be more you would need to know to compile ClojureScript, but I have to stop here. Reply if you got ideas.</p><p>If you want a simple suggestion, I would just recommend <a href="http://shadow-cljs.org/">shadow-cljs</a>. It’s much like Webpack, if you are familiar with Webpack, you will feel shadow-cljs has quite some familiar parts. Otherwise figwheel is also cool.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8975cfd9f43" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Some pain points using mobx-state-tree in our team]]></title>
            <link>https://jiyinyiyong.medium.com/some-pain-points-using-mobx-state-tree-in-our-team-f4e38890d66?source=rss-4d35af79be5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4e38890d66</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[mobx]]></category>
            <dc:creator><![CDATA[JiyinYiyong]]></dc:creator>
            <pubDate>Wed, 28 Feb 2018 09:33:07 GMT</pubDate>
            <atom:updated>2018-02-28T09:33:07.886Z</atom:updated>
            <content:encoded><![CDATA[<p>We built several apps in our start-up. mobx-state-tree(MST) was an early choice to replace Redux. As I joined, the codebase has quite some code in TypeScript, MobX, and MST. We are mainly working on 2 of them. The apps are management systems for setting configurations and displaying charts, as well as editing graphs. After we worked on these apps for several months, the codebase grew a lot larger.</p><p>MST might not be the best tool for our case, while it’s still powerful one. I feel there are some pain points.</p><h4>Typecheck errors are obscure</h4><p>As we put more and more data inside a single Store, the error messages become hard to read. It turned into a red message on the whole screen. It’s nearly impossible to figure out the error in a single glance. The useful part of the error message is only the paths and the reason showing where and how the error happened. See if you can read:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/0*ZnFBybCnHzHcG73B.png" /></figure><h4>Unexpected errors in production</h4><p>The errors have been thrown several times in production, by uglified code. Normally no useful information is printed but only an error related to a initiate method. Then I have to reproduce the problem in my local app and see what I can find.</p><p>I talked with my colleague. Turned out we both don’t like MST throwing errors in production in this way. We want the app to run as much as possible even if the data structure is slightly changed. And not every structure change would cause app breakdown.</p><p>It’s usual situations that backend developers update APIs a bit and we hope out app still running. Although we want to be notified there are changes in the structure, we prefer warnings over errors, like console.error with a stack trace, but the code should run as possible. At least, we want to disabled type checking in production to reduce breakdowns.</p><h4>We have component level states</h4><p>Since there are too many types of data in our app, we don’t put all data inside our store, but instead load them duringcomponentDidMount and load more on need. Docs for MST is as simple as a README file, I don’t see a sound solution for such cases. So weused MobX instead to put data inside components, with typecheck function from MST as a schema validator.</p><p>It might be a strange use case but it’s somehow what we need. We need a flexible data validator, however json schema does not solve that. MST brings a type system similar to TypeScript and it became quite handy in our case. Type definitions can be use by compiler and by runtime in checking data structure. I’d like to explore more about that and see how it will improve our app.</p><h4>Conclusion</h4><p>I often doubted if we are using MST correctly. Our app is way complicated compared to the demo presented in the docs. Perhaps I want those features provided in MST but not in the way MST is suggesting: data validator, observable data. Anyways, I can’t see it clearly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4e38890d66" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Clojurians, please share your knowledges with blogs]]></title>
            <link>https://jiyinyiyong.medium.com/clojurians-please-share-your-knowledges-with-blogs-c674503f54a?source=rss-4d35af79be5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/c674503f54a</guid>
            <category><![CDATA[clojure]]></category>
            <dc:creator><![CDATA[JiyinYiyong]]></dc:creator>
            <pubDate>Fri, 23 Feb 2018 03:47:37 GMT</pubDate>
            <atom:updated>2018-02-23T03:47:37.330Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m a Clojure beginner and I want to learn more about using Clojure. To your surprise, I don’t have a Java background, no experience on Database and server programming either. I heard Clojure is a well-designed language with Functional programming stuffs. I like FP, I learnt some Haskell before, but Haskell is too hard for a programmer like me. I only write HTML/CSS/JavaScript after I got a job.</p><p>Learning Clojure is hard. I don’t have many friends in my city, which is Shanghai. So no one is going to teach me Clojure. I bought books about Clojure but still not finished reading it. For the most of the time, I just follow the guides and want to build small programs, like a simple Web server, like I did with Node.js before. Also I want to build command line tools, which helps me using Clojure in my daily works. I could do that in Node.js, but JavaScript is such a clumsy language compared with Clojure. I want to use Clojure for my works. However it’s so hard.</p><p>Clojure tools have docs, but they seem not prepared for me. I want guides, I want step by step logs how people finish they tasks. However I barely see that. Many projects in Clojure community comes with nice docs and READMEs, but they are not guides. I don’t have so many experience on, like Unix programming, Java programming, concurrent programming, most pieces in the docs are just hard to absorb for me being a beginner. I was taught that, “when you don’t know how to do it, Google it first” when I want started learning Linux. People in Linux groups shares a lot. Many times, I run into a problem, I would Google it, then I find someone explaining it on a forum, or in a blog. That’s very helpful. Although I don’t program Linux, I can get me job done somehow. I found far less results when Googling Clojure problems.</p><p>It doesn’t mean only very a few people are programming Clojure. I already found that out, there are a lot of Clojure programmers. So many of them. I see updates in Clojurians Slack channels everyday. And I see people answering all kinds of questions, some of them I can’t even understand. It’s fantastic that we can solve so many problems. But I always feel anxious. What if one day I want to ask the same question, can I get those answers immediately. What if that person is not there? I have no guarantees that I can find them. I always feel anxious.</p><p>So when I ask questions from Thomas Heller about ClojureScript, one important thing is, I want to make sure it’s written down somewhere that I could reach it. On Slack? No, stack logs are hard to read and hard to search. Sometimes things will go to shadow-cljs Wiki, that’s cool. But best way is I write down all things I know about the solution. Then when I need it next time, I open my blog and everything I need it there.</p><p>Somehow I want to urge people from Clojure community to do the same thing: write blogs, write down solutions. It’s not only serving one’s own need, but also others can find the blog and make use of those knowledge. In this way I would feel that the whole Clojure community is backing me up. Whatever problem I run into, someone in the community might have explored the problem and noted down solutions for that. I’m not going to alien areas by my own. I’m in a community and I can get help, even if no one in my timezone has spare time to answer my questions in realtime. But it’s written already that I can read and learn.</p><p>If you don’t have a blog, then <a href="http://clojureverse.org/">ClojureVerse</a> can provide you a markdown editor and a comment system. We can help you to share the blogs on Twitter so that more people will be aware of your work. You can have other platforms for blogging, Medium, HashNode, even GitHub issues. It’s not a problem to pick one. If you can finish that within 280 letters and 4 pictures, then just do it.</p><p>Please, I would need your knowledges on Clojure, please share them. And I would share mine too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c674503f54a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A beginner guide to compile ClojureScript with shadow-cljs]]></title>
            <link>https://jiyinyiyong.medium.com/a-beginner-guide-to-compile-clojurescript-with-shadow-cljs-26369190b786?source=rss-4d35af79be5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/26369190b786</guid>
            <category><![CDATA[shadow-cljs]]></category>
            <category><![CDATA[clojurescript]]></category>
            <dc:creator><![CDATA[JiyinYiyong]]></dc:creator>
            <pubDate>Fri, 21 Jul 2017 10:18:55 GMT</pubDate>
            <atom:updated>2019-09-11T06:17:51.249Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><a href="http://shadow-cljs.org/"><em>shadow-cljs</em></a> provides everything you need to compile your ClojureScript code with a focus on simplicity and ease of use.</blockquote><ul><li><a href="https://github.com/thheller/shadow-cljs">thheller/shadow-cljs</a></li><li><a href="https://shadow-cljs.github.io/docs/UsersGuide.html">Shadow CLJS User&#39;s Guide</a></li></ul><p>To install shadow-cljs, use npm:</p><pre>npm install -g shadow-cljs</pre><p>shadow-cljs requires Java, make sure you <a href="http://www.oracle.com/technetwork/java/javase/downloads/jre10-downloads-4417026.html">have Java installed</a>. Don’t worry, shadow-cljs handles Java for you. If you still want to <a href="http://clojure-script.org/">learn more about ClojureScript, checkout this list</a>.</p><h4>Compile to browser</h4><p>Say you have a project:</p><pre>.<br>├── README.md<br>├── assets<br>│   └── index.html<br>├── package.json<br>├── shadow-cljs.edn<br>├── src<br>│   └── app<br>│       ├── lib.cljs<br>│       └── main.cljs<br>└── yarn.lock</pre><p>assets/index.html(please copy it to target/index.html in order that it can be accessed) looks like:</p><pre>&lt;script src=&quot;main.js&quot;&gt;&lt;/script&gt;</pre><p>src/app/main.cljs may look like:</p><pre>(ns app.main)</pre><pre>(def value-a 1)</pre><pre>(defonce value-b 2)</pre><pre>(defn reload! []<br>  (println &quot;Code updated.&quot;)<br>  (println &quot;Trying values:&quot; value-a value-b))</pre><pre>(defn main! []<br>  (println &quot;App loaded!&quot;))</pre><p>The namespace for this project is just app. To compile this project, first create a shadow-cljs.edn file, with configs:</p><pre>{:source-paths [&quot;src&quot;]<br> :dependencies []<br> :dev-http {8080 &quot;target/&quot;}<br> :builds {:app {:output-dir &quot;target/&quot;<br>                :asset-path &quot;.&quot;<br>                :target :browser<br>                :modules {:main {:init-fn app.main/main!}}<br>                :devtools {:after-load app.main/reload!}}}}</pre><p>Here’s how it’s configured:</p><ul><li>:source-paths is where you put source code</li><li>:dependencies is ClojureScript deps of this projects</li><li>:builds is where you specify build configurations</li><li>:app is a build id named by us, we will need it to run specific compilations from command line tools or from APIs</li><li>:output-dir decides where the generated files are saved</li><li>:asset-path is the base path of files of the hot updated code</li><li>:target is short for “compilation target”, :browser is for browser apps</li><li>:modules specifies the modules we want to generate, :main also means the bundle will be named main.js</li><li>:init-fn specifies the main function of the whole program</li><li>:devtools specifies configurations for development tools</li><li>:dev-http tells shadow-cljs to serve the folder target/ on port 8080.</li></ul><p>During development, we can compile with hot code swapping, watch how we use the build id :app :</p><pre>shadow-cljs watch app</pre><p>After initial compilation finished, shadow-cljs would generate code in target/main.js and serve target/ folder on <a href="http://localhost:8080/">http://localhost:8080</a>. When you open the url, the page will connect to shadow-cljs’ server and listen for updates. As you modify code and save files, the app will be hot reloaded and then app.main/reload! will be called.</p><p>To compile and optimize code:</p><pre>shadow-cljs release app</pre><p>For the complete example, please clone this repo:</p><p><a href="https://github.com/minimal-xyz/minimal-shadow-cljs-browser">minimal-xyz/minimal-shadow-cljs-browser</a></p><h4>Compile to Node.js</h4><p>It’s quite similar steps to compile ClojureScript targeting Node.js , for the project:</p><pre>.<br>├── README.md<br>├── package.json<br>├── shadow-cljs.edn<br>├── src<br>│   └── server<br>│       └── main.cljs<br>└── yarn.lock</pre><p>src/server/main.cljs may look like:</p><pre>(ns server.main)</pre><pre>(def value-a 1)</pre><pre>(defonce value-b 2)</pre><pre>(defn reload! []<br>  (println &quot;Code updated.&quot;)<br>  (println &quot;Trying values:&quot; value-a value-b))</pre><pre>(defn main! []<br>  (println &quot;App loaded!&quot;))</pre><p>We can use shadow-cljs.edn with configurations:</p><pre>{:source-paths [&quot;src&quot;]<br> :dependencies []<br> :builds {:app {:target :node-script<br>                :output-to &quot;target/main.js&quot;<br>                :main server.main/main!<br>                :devtools {:after-load server.main/reload!}}}}</pre><p>Now we use :node-script as the compilation :target . And there are two fields:</p><ul><li>:output-to specifies the output file</li><li>:main specifies the main function</li></ul><p>Like in previous demo, we can start compilation in development mode, and run it with Node.js :</p><pre>shadow-cljs watch app</pre><pre># in another terminal<br>node target/main.js</pre><p>As Node.js runs, it will connect to shadow-cljs’ WebSocket server listening for updates. Some npm modules(wsand source-map-support) are required, please install them. It also does hot code swapping as well as calling reload! function.</p><p>To create a release bundle, use the sub-command:</p><pre>shadow-cljs release app</pre><p>You may also add :compiler-options {:optimizations :simple}} to disable mangling. To try the full example, clone this repo:</p><p><a href="https://github.com/minimal-xyz/minimal-shadow-cljs-nodejs">minimal-xyz/minimal-shadow-cljs-nodejs</a></p><h4>More</h4><p>There are also examples you can browse in shadow-cljs, like using Macros:</p><p><a href="https://github.com/minimal-xyz/minimal-cljs-macro">minimal-xyz/minimal-cljs-macro</a></p><p>Or like compile code with long term caching:</p><p><a href="https://github.com/minimal-xyz/minimal-shadow-cljs-release">minimal-xyz/minimal-shadow-cljs-release</a></p><p>And some examples run in several environments of JavaScript:</p><p><a href="https://github.com/thheller/shadow-cljs-examples">thheller/shadow-cljs-examples</a></p><p><a href="http://shadow-cljs.org/">Explore more</a> on shadow-cljs and <a href="https://github.com/thheller/shadow-cljs/issues">send feedbacks on GitHub</a> :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26369190b786" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Websites that Chinese JavaScript developers often visit]]></title>
            <link>https://jiyinyiyong.medium.com/websites-that-chinese-javascript-developers-often-visit-c30525eb548e?source=rss-4d35af79be5b------2</link>
            <guid isPermaLink="false">https://medium.com/p/c30525eb548e</guid>
            <category><![CDATA[china]]></category>
            <dc:creator><![CDATA[JiyinYiyong]]></dc:creator>
            <pubDate>Sun, 25 Jun 2017 17:52:09 GMT</pubDate>
            <atom:updated>2017-06-26T02:30:18.558Z</atom:updated>
            <content:encoded><![CDATA[<p>Not really sure if people from English world are interested. I’m going to just add some notes here in case someone needs.</p><h4>Social medias</h4><p>知乎 <a href="http://www.zhihu.com/">http://www.zhihu.com/</a> is like Quora, but surprising this year it’s becoming more and more popular since many more companies joined and sending posts. From early 2012 tech began to appear on that small site, now more and more developers, and surely a lot of them are JavaScript developers. My friend started a very famous front-end column there translating English tech articles. My company has a well known column on Zhihu too.</p><p>微博 <a href="http://weibo.com/">http://weibo.com</a> is like Twitter. Tech messages here are not as dense as those on Twitter, but at least there are some messages posting on Weibo. A big part of them are news translated or grabbed from English communities. Sometimes we argue with Weibo too. Like on Twitter but far fewer messages.</p><h4>Developer communities</h4><p>SegmentFault <a href="https://segmentfault.com/">https://segmentfault.com/</a> is like StackOverflow + Quora + EchoJS +?? It’s features kept counting in the past years. People ask, answer, write on this site. Also watching lessons, read news. SegmentFault has a team holding Hackathons(not sure what called). They maintain a Weibo account too to send news. Personally I have been using it’s Markdown editor for years to write my blogs. It’s based in Hangzhou and I was in Hangzhou.</p><p>掘金 <a href="https://juejin.im/">https://juejin.im/</a> A HashNode? A Reddit? I’m not sure. It’s relatively new to me but recent years I saw a lot of attractions of its founder. It’s more about sharing and reading. As a contrast, SegmentFault focuses more on asking&amp;answering.</p><h4>Forums</h4><p>CNode <a href="https://cnodejs.org/">https://cnodejs.org/</a> It’s an old forum, I was posting messages on it when I was on college. It’s built for Node.js , but I see people talking about front-end stuffs too. I think it’s the most active forum on this area in China. It was created by some friends in Taobao, or Alibaba.</p><p>React China <a href="http://react-china.org/">http://react-china.org/</a> A forum for React users in China. It’s now maintained by Strikingly. There are many React users in China as I said before.</p><p>V2EX <a href="http://v2ex.com/">http://v2ex.com</a> aka “way 2 explore”. This is a very interesting site with many topics. From code to shopping, sometimes news, I don’t how to describe, but all kinds of things they are discussing.</p><p>Ruby China <a href="https://ruby-china.org/topics">https://ruby-china.org/topics</a> well, it focuses more on backend, but many of them can write websites, so sometimes they talk about JavaScript too.</p><h4>WeChat</h4><p>Besides, there are countless QQ groups and WeChat groups out there. I joined the groups “React China”, “Vue.js”, “WebAssembly”, “jsconf”, so I can hear news from people around me. But there are definitely a lot more WeChat groups , sometimes I heard some from my friends. It’s just too easy to create WeChat groups.</p><h4>Others</h4><p>Those websites above are the places I hang around quite often. I want to stay on the places there search engines still work. No doubt there are more of them, just less famous. We have many developers in China and the number is still counting. A lot of people chose to make a living with JavaScript, even though I can’t really agree JavaScript is a well-designed tool.</p><p>Luckily a big part of developers use GitHub too. And some of them are using Twitter, which you can infer from the name. I’m on Twitter. I tweet quite often these days. I want to mention ClojureScript since recently I spent a lot of time on it. Some less mainstream languages don’t have many users here. ClojureScript, Elm, BuckleScript, very few users. Sometimes I found the Chinese JavaScript community like a blackhole, which does not emit messages back to the English world, or sometimes like an island only people can swim delivers the messages. However it’s too many people to be an island.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c30525eb548e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>