{"componentChunkName":"component---src-templates-blog-post-js","path":"/install-prism-plugin","result":{"data":{"markdownRemark":{"html":"<h1>Install Prism Plugin</h1>\n<p>Prism is a lightweight, extensible syntax highlighter. Gatsby JS comes with a well integrated <a href=\"https://www.gatsbyjs.org/packages/gatsby-remark-prismjs/?=\">plugin</a>. Follow the instruction then you can render code snippets in a nice looking way. </p>\n<p>Here is an example. The follwing markdown </p>\n<div class=\"gatsby-highlight\" data-language=\"markdown\"><pre class=\"language-markdown\"><code class=\"language-markdown\">```javascript\n// In your gatsby-config.js\nplugins: [\n  {\n    resolve: <span class=\"token code keyword\">`gatsby-transformer-remark`</span>,\n    options: {\n      plugins: [\n        <span class=\"token code keyword\">`gatsby-remark-prismjs`</span>,\n      ]\n    }\n  }\n]</code></pre></div>\n<p>will become</p>\n<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token comment\">// In your gatsby-config.js</span>\nplugins<span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span>\n  <span class=\"token punctuation\">{</span>\n    resolve<span class=\"token operator\">:</span> <span class=\"token template-string\"><span class=\"token template-punctuation string\">`</span><span class=\"token string\">gatsby-transformer-remark</span><span class=\"token template-punctuation string\">`</span></span><span class=\"token punctuation\">,</span>\n    options<span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span>\n      plugins<span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span>\n        <span class=\"token template-string\"><span class=\"token template-punctuation string\">`</span><span class=\"token string\">gatsby-remark-prismjs</span><span class=\"token template-punctuation string\">`</span></span><span class=\"token punctuation\">,</span>\n      <span class=\"token punctuation\">]</span>\n    <span class=\"token punctuation\">}</span>\n  <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">]</span></code></pre></div>\n<p>And we can try some typescript code as well.</p>\n<div class=\"gatsby-highlight\" data-language=\"typescript\"><pre class=\"language-typescript\"><code class=\"language-typescript\"><span class=\"token keyword\">export</span> <span class=\"token keyword\">interface</span> <span class=\"token class-name\">Person</span> <span class=\"token punctuation\">{</span>\n    name<span class=\"token operator\">:</span> <span class=\"token builtin\">string</span><span class=\"token punctuation\">,</span>\n    age<span class=\"token operator\">:</span> <span class=\"token builtin\">number</span>\n<span class=\"token punctuation\">}</span>\n\n<span class=\"token keyword\">let</span> john <span class=\"token operator\">=</span> <span class=\"token punctuation\">{</span>\n    name<span class=\"token operator\">:</span> <span class=\"token string\">\"John\"</span><span class=\"token punctuation\">,</span>\n    age<span class=\"token operator\">:</span> <span class=\"token number\">39</span>\n<span class=\"token punctuation\">}</span> <span class=\"token keyword\">as</span> Person<span class=\"token punctuation\">;</span></code></pre></div>","frontmatter":{"date":"August 23, 2018","path":"/install-prism-plugin","tags":["gatsbyjs","prismjs"],"title":"Install Prism Plugin"}}},"pageContext":{"prev":{"excerpt":"Quarkus And Spring I spent few days learning different Micro-service frameworks. The first framework I choose is actually , but once I start investigating , I realized one thing that seems important to me. It looks like , but it's another . Once you…","html":"<h1>Quarkus And Spring</h1>\n<p>I spent few days learning different Micro-service frameworks. The first framework I choose is actually <code class=\"language-text\">Micronaut</code>, but once I start investigating <code class=\"language-text\">Micronaut</code>, I realized one thing that seems important to me. It looks like <code class=\"language-text\">Spring</code>, but it's another <code class=\"language-text\">Spring</code>. Once you locked in the eco-system. it's hard to get out. So I start looking for something that is more standard so I choose <code class=\"language-text\">Quarkus</code>, backed by RedHat that implements <code class=\"language-text\">Eclipse MicroProfile</code>, that should make it relatively easy to port to other platform that also support <code class=\"language-text\">MicroProfile</code>.</p>\n<p>The more I use, the more I like it, even it is still a new framework.</p>\n<p>Things I like <code class=\"language-text\">Quarkus</code> so far</p>\n<ul>\n<li>Fast. It is faster then Spring. With hot reload, it’s save you lots of waiting time.</li>\n<li>Standard. It support Eclipse MicroProfile, means it uses more standard ways to do things like rest endpoint annotations, dependency injection, openapi …etc.  That also means porting to another platform should be less painful then others.</li>\n<li>Easy to learn. It’s similar to Spring, if you have some Spring background, should be really easy to pick up.</li>\n<li>GraalVM supports. Building native images is build-in, it could significantly reduce the startup time and memory usage.</li>\n</ul>\n<p>Things I thing it can improve</p>\n<ul>\n<li>Building with <code class=\"language-text\">Gradle</code> is still in progress. I just hit some known issue and have to switch to Maven.</li>\n<li>IDE support is not as good as Spring. It’s Ok, but still needs a bit of setup in order to get debugger working.</li>\n</ul>","id":"9ea1209c-d7e8-549b-91b5-311f639340a9","timeToRead":1,"frontmatter":{"date":"2020-03-02T04:18:56.083Z","path":"/quarkus-and-spring","tags":["quarkus","spring","microservice","mircoprofile"],"title":"Quarkus And Spring"}},"next":{"excerpt":"Feature Toggle And Regression It is OK to violate DRY principls to copy the code when working on a new feature that is high couple to old behaviour. As a professional software engineer, I kind of strickly obey the DRY principals, and don't want to…","html":"<h1>Feature Toggle And Regression</h1>\n<p>It is OK to violate DRY principls to copy the code when working on a new feature that is high couple to old behaviour.</p>\n<p>As a professional software engineer, I kind of strickly obey the DRY principals, and don't want to introduce any regression. But this could end up you can not easily to write a clean code and refactor. You need to branch your code in the exisitng code base. </p>\n<p>Copy the exisitng code will ease your regresion nightmare. Once toggle is removed, the old code will disappear, so you are not violating DRY prinsipal any more. But you need to make sure the toggle will be removed and old behaviour will not needed. Otherwise, you could put yourself in a situation that DRY try to address, maintain multiple codes that basically indentical.</p>","id":"542576fb-98c8-5d3b-ae45-751baaf7b524","timeToRead":1,"frontmatter":{"date":"2018-08-09T21:12:26.441Z","path":"/feature-toggle-and-regression","tags":["dry","feature-toogle","regression"],"title":"Feature Toggle And Regression"}}}}}