<?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 chengyucai on Medium]]></title>
        <description><![CDATA[Stories by chengyucai on Medium]]></description>
        <link>https://medium.com/@app030242?source=rss-67af28e03088------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*eG39ZTMiW9QpQ1rma_zcsw.png</url>
            <title>Stories by chengyucai on Medium</title>
            <link>https://medium.com/@app030242?source=rss-67af28e03088------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 00:34:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@app030242/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[Vercel 介紹與概念]]></title>
            <link>https://medium.com/@app030242/vercel-%E4%BB%8B%E7%B4%B9%E8%88%87%E6%A6%82%E5%BF%B5-b8fd0dc0e43d?source=rss-67af28e03088------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8fd0dc0e43d</guid>
            <category><![CDATA[headless-cms]]></category>
            <category><![CDATA[experience]]></category>
            <category><![CDATA[vercel]]></category>
            <dc:creator><![CDATA[chengyucai]]></dc:creator>
            <pubDate>Mon, 11 Oct 2021 13:36:19 GMT</pubDate>
            <atom:updated>2021-10-11T13:36:19.354Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EBHxMzmPlbvWlenxD8f8Mg.jpeg" /><figcaption>Vercel.png</figcaption></figure><blockquote><strong>基礎介紹</strong></blockquote><p>是用於<strong> static sites and frontend frameworks ,</strong>主要是建立<strong> headless content management system.</strong></p><p>提供即時部署、自動彈性擴展，並且預設導入GIT Project，讓前端團隊可以輕鬆地開發、預覽和部署.</p><p>簡單來說大致上跟AWS 做的事情差不多只不過多了一些限制</p><blockquote><strong>優點</strong></blockquote><p>以下是 Vercel 的公開使用<a href="https://vercel.com/docs/concepts/limits/fair-use-policy">說明</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*VR1mPY-4x-TSAlUVuAgpbg.png" /></figure><p>基本上以 Bandwidth(免費仔) 一個月就有 100GB ，以現階段來說是目前最高的配額，且主機反應速度 基本上 小於 30ms ，一天的可建置次數額度也有100次，不是特殊的應用基本都用不到這麼高，所以如果是初期發展或需要測試，都可以使用此服務來建立，以便評估為了所需的設備種類與規格</p><blockquote><strong>用途</strong></blockquote><p>官方也有給出適合應用的網站類型:</p><ul><li>Frontends</li><li>Functions that query DBs or APIs</li><li>Blogs, e-commerce, marketing</li></ul><h4><strong>Frontends</strong></h4><p>不用說了官方是標配功能，基本上只要你跑得起服務就可以成功建立</p><h4><strong>Query DBs or APIs</strong></h4><p>典型的應用像是Strapi 、graphql …，都可使用 Vercel 部屬建立，只要能夠成功連線大概路上就成功，之後就可以不管，可謂是性價比很高的方案</p><h4><strong>Blogs, e-commerce, marketing</strong></h4><p>如果是Frontend 跟 API Server 都可以建立 ，但是如果需要其他(像是金流或即時反應類型的還是要先找到第三方的服務管理</p><blockquote><strong>Content management system</strong></blockquote><p>縮寫(CMS)，CMS可分成兩種結構，分別是coupled CMS 與 decoupled CMS先來說說兩者的差別:</p><h4>Coupled CMS</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*fcQmegYpzPRqLw4_.png" /></figure><ul><li>早期發展的結構</li><li>創建內容的內容管理後端（後端）</li><li>後端需負責處理畫面上的應用</li></ul><p><em>例: WordPress</em></p><h4><strong>Decoupled CMS</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*DaPcI5an8SuyhVCw.png" /></figure><ul><li>存儲內容和數字資產的數據庫（後端）</li><li>串接數據管理後端和前端的 API</li><li>定義前端內容的發布</li></ul><p><em>可將兩邊分成建立與儲存</em></p><h4><strong>Headless </strong>CMS</h4><p>是以Decoupled CMS 為出發點在往下延伸的結果，包含HTTP的狀態回復，前端無須配合後端，只需配合API便可單獨運行，縱使後端服務發生問題，也可以與API 搭配來持續運作，也是目前較為主流的做法</p><p>但是如果是組織面臨到要升級產品的時候,每種架構的優缺點以及選擇是非常重要的課題。為組織提供選擇最佳結構，能確保不僅獲得想要的成效，而且還為您的整個團隊提供強而有力的後盾。</p><blockquote><strong><em>使用心得</em></strong></blockquote><p>如果也許你想擁有一套自己的網站或是需要一個代理伺服器;也許你有一些自己的Project想部署到伺服器,但是怕自己實力不足浪費錢，或是一直沒有找到合適的平臺；那麼 Vercel 平臺可能是你不錯的選擇，連線速度快，提供的域名也有可辨識性，重點是基本上不用到花錢</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8fd0dc0e43d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[心得] 程式Online(一)]]></title>
            <link>https://medium.com/lion-f2e/%E5%BF%83%E5%BE%97-%E7%A8%8B%E5%BC%8Fonline-%E4%B8%80-d7837cd7ab48?source=rss-67af28e03088------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7837cd7ab48</guid>
            <category><![CDATA[experience]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[engineer]]></category>
            <dc:creator><![CDATA[chengyucai]]></dc:creator>
            <pubDate>Sun, 22 Sep 2019 06:42:49 GMT</pubDate>
            <atom:updated>2019-09-22T06:50:01.398Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2PkkqFD3WyMIwiYwzkdBJg.png" /></figure><blockquote><strong>前言</strong></blockquote><p>從高中開始學習程式到現在，從還是學生時期一路銜接至工作，已經有七年了，主要會想來撰寫這一篇，是想給剛剛進路這領域的「萌新」們及想踏入到的人，分享一些建議與方向，在這條道路上可能會發生的事。</p><h3>天賦</h3><p>首先，請你先問自己你適合成為軟體工程師嗎…，對~不要懷疑對這很重要，有人可能會想問你在開玩笑，我根本都還不曉得才來你這篇，現在要我問我自己合不合適，我哪知道啊～。老實說分辨法很簡單，你不一定要是一位程式天才或是什麼此領域的相關特長，你只需要具備以下特點就已經是一名合格的工程師:</p><p><strong>熱忱：</strong>寫程式就跟蓋房子一樣是由小小的物體推砌而成，彼此互相連接，互相輔助來達成一個目標，但是藍圖永遠只是一個目標，如何實現是靠你自己，途中絕對會遭遇挫折，你會從亂無章法的程式邏輯、工作時被電爆，這都是必經之路，熱忱是給了你能持續站起來的關鍵，像是遊戲中的續命道具一樣讓你不斷的浴火重生。</p><p><strong>學習：</strong>科技的進步與改變非常的快速。沒幾個月就會有新的語言、框架及工具與技術。因此相較於其他職業，網路開發者或軟體工程師是需要一直不斷的學習，並且與時並進，才能確保自己的能力，這種環境會帶來巨大的壓力，但也帶來刺激與挑戰。</p><p><strong>追求：</strong>會想來當工程師的人大多數可能是因為：工作機會、薪水、充滿未知與挑戰、發揮自身的價值…，這些動機都很好，寫程式其實也是一種對「欲」的追求，對於一樣事物的執著，希望以完美的方式呈現，無形間增加你自身的價值，並對於未知的事物充滿探索與求知，投身於「知識」的大海。</p><blockquote><strong>總結</strong></blockquote><p>事實部分的軟體工程師都可能會有這樣的疑惑，『我到底是不是一位軟體工程師』還是就只是會寫一點code而已，其實有一大部分的工程師並不是擁有相關學位的，可能曾經是位水電工、廚師或是一位醫師，對於自身能力並沒有有效的基準來衡量，往往在挫折與失敗中迷失了自我，或是同業的鄙視，對於『沒有對應的學位就不是一位軟體工程師?』這詞顯得更加憂愁。其實你可以試著放下心中芥蒂，問問自己，自己所認定的工程師是什麼，是有頂令人稱羨的學歷 ? 還是有一張漂亮的經歷 ? 我認為都不是；工程師就是一位能解決問題才能叫工程師，不能解決問題甚至逃避那與打嘴砲無異，只要你現在是在處理著問題，那麼不管別人怎麼說你就是一位工程師。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7837cd7ab48" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lion-f2e/%E5%BF%83%E5%BE%97-%E7%A8%8B%E5%BC%8Fonline-%E4%B8%80-d7837cd7ab48">[心得] 程式Online(一)</a> was originally published in <a href="https://medium.com/lion-f2e">LT Lab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[分享] TypeScript’s Basic]]></title>
            <link>https://medium.com/lion-f2e/%E5%88%86%E4%BA%AB-typescripts-basic-46f4a4f69e9b?source=rss-67af28e03088------2</link>
            <guid isPermaLink="false">https://medium.com/p/46f4a4f69e9b</guid>
            <category><![CDATA[js]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[concept]]></category>
            <dc:creator><![CDATA[chengyucai]]></dc:creator>
            <pubDate>Sun, 18 Aug 2019 03:54:28 GMT</pubDate>
            <atom:updated>2019-10-18T03:00:09.022Z</atom:updated>
            <content:encoded><![CDATA[<h3>[分享] TypeScript&#39;s Basic &lt;I&gt;</h3><p><em>本篇分享關於TypeScript 基礎邏輯</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kXv_4vznnyItbvt3vWpT-A.jpeg" /></figure><p>以下是TypeScript中所使用的類型</p><blockquote><strong>Boolean</strong></blockquote><p><strong>Boolean</strong>是最基本也是的數據類型，就是只有( true / false )的值</p><pre><strong>const</strong> value：<strong>Boolean</strong>     // only =&gt; true | fales</pre><blockquote><strong>number</strong></blockquote><p>TypeScript中的所有數字都是浮點值，可支援的進制有以下幾種:</p><ul><li>十進制(dec)</li><li>十六進制(hex)</li><li>八進制(oct)</li><li>二進制(bin)</li></ul><pre><strong>let</strong> decimal: number = 6       // 十進制<br><strong>let</strong> hex: number = 0xf00d      // 十六進制<br><strong>let</strong> octal: number = 0o744     // 八進制<br><strong>let</strong> binary: number = 0b1010   // 二進制</pre><blockquote>string</blockquote><p>是基本的文本數據， TypeScript也使用雙引號（&quot;）或單引號（&#39;）來包圍字符串數據。</p><pre><strong>const </strong>name：s​​tring =`Lion travel` <br><strong>const</strong> exp：number = 7 <br><strong>const</strong> text：string =` I have ${num} year coding experience `.</pre><p>可以使用反引號(` backtick)， 嵌入表達式 ${ }</p><blockquote><strong>Array</strong></blockquote><p><strong>首先 Array 的 Interface 基本定義方法:</strong></p><pre><strong>const </strong>value: Array&lt;<strong>string</strong>&gt;     // rule: Array&lt;type&gt;</pre><p>可先定義型態為Array並在 &lt;&gt; 內定義此陣列的結構內部為何種型態</p><p><strong>或者是用另一種方式:</strong></p><pre><strong>const </strong>value: <strong>string</strong>[]    // rule: type[]</pre><p>直接定義此變數由string所組成的陣列</p><p><strong>如果需求有同時存在兩種以上的型態存在時，可利用以下方式:</strong></p><pre><strong>const </strong>value: (<strong>number </strong>| <strong>string</strong>)[]    // rule: (type | type)[]</pre><p>使用特殊符號 | 的方式，將兩種不同型態做共存的形式</p><blockquote><strong>Object</strong></blockquote><p><strong>首先 Object 的 Interface 基本定義方法:</strong></p><pre><strong>const </strong>value: Object      // Object: {}</pre><p>Object的型態不像Array需強制定出內部結構，所以只要這樣做就可以了。基本上把Object type 當作是 json 的資料處理方式比較容易理解(需注意幾的重點)</p><pre>JSON values <strong>cannot </strong>be one of the following data types:<br>. a function <br>. a date<br>. <em>undefined</em></pre><p><strong>如果是要定義 Object 的 Value 型態 ，可利用以下方式:</strong></p><pre><strong>Object</strong>: { [<strong>key</strong>: string]: number }       //key only (string | number)</pre><p>Key 即使定義也是無法改變 Object 的 Key 自身的屬性，所以無論是定義成字串或是數字結果都不會改變</p><blockquote><strong>Function</strong></blockquote><p>函數是JavaScript中任何應用程序的基本構建區塊。它可以作為一個模組使用。在TypeScript中，函數具有類別( classes)、命名( namespaces)和模組( modules)，函數在程序上有著關鍵的作用。TypeScript還為標準JavaScript函數添加了一些新功能，使其更易於使用</p><pre><strong>function</strong> <strong>add</strong>(x: number, y: number): <strong>number</strong> { <br>    <strong>return</strong> x + y; <br>}</pre><p>函數的型別(Type)具有兩個部分：參數的類型和返回類型，</p><p>這兩個部分的參數類型是必須都寫出來，且參數的部分必須每個都賦予名稱和類型。(名稱是為了提高可讀性)</p><pre><strong>function mergeString</strong>(firstName: string, lastName: string) {<br>     <strong>return</strong> firstName + &quot; &quot; + lastName; <br>}  <br><strong>const </strong>rs1 = <strong>mergeString</strong>(&quot;Hello&quot;);                 // error<br><strong>const </strong>rs2 = <strong>mergeString</strong>(&quot;Hello&quot;, &quot;world&quot;, &quot;T_T&quot;); // error <br><strong>const </strong>rs3 = <strong>mergeString</strong>(&quot;Hello&quot;, &quot;world&quot;);        // Hello world</pre><p>在TypeScript中，函數在未設定默認參數的狀況下每個參數都需要，因為不給參數的狀況下，會被默認成 null<strong> </strong>所以類型不合</p><pre><strong>function mergeString</strong>(firstName?: string, lastName = &quot;React&quot;) {<br>     <strong>return</strong> firstName + &quot; &quot; + lastName; <br>}  <br><strong>const </strong>rs1 = <strong>mergeString</strong>(&quot;Hello&quot;);           // Hello React<br><strong>const </strong>rs2 = <strong>mergeString</strong>(&quot;Hello&quot;, &quot;world&quot; ); // Hello world<br><strong>const </strong>rs3 = <strong>mergeString</strong>( );                 // &quot; React&quot;</pre><p>函數在設定默認參數或是可省略的狀況下</p><blockquote><strong>enum</strong></blockquote><p>是一種標準資料狀態型別，資料的內容在未設定的狀況下，是依據上一個的狀態做決定，舉例如下:</p><pre><strong>enum</strong> Color {Red = 1, Green, Blue}</pre><pre><strong>const </strong>colorName: string = Color[2];   // Displays &#39;Green&#39;</pre><p>如果把<strong>enum</strong>轉換成Object大致如下:</p><pre><strong>enum</strong> Color {Red = 1, Green = 4, Blue}</pre><pre>Color = { <br>   &#39;<strong>red</strong>&#39; = 1，<br>   &#39;<strong>Green</strong>&#39; = 4，<br>   &#39;<strong>Blue</strong>&#39;= 5，<br>   &#39;<strong>1</strong>&#39; = &#39;Red&#39;，<br>   &#39;<strong>4</strong>&#39; = &#39;Green&#39;，<br>   &#39;<strong>5</strong>&#39; = &#39;Blue&#39;<br>}</pre><blockquote><strong>any</strong></blockquote><p>在編寫程序時我們不知道的變量類型。這些值可以用any來表達內容類型</p><blockquote><strong>void</strong></blockquote><p>void有點像是相反的any 是沒有任何類型</p><blockquote><strong>結語</strong></blockquote><p>類型在未定義時基本就是自動以any來表達內容類型，但是盡量別用，為了 使代碼更具可讀性和可測試性，即使是資料型態再複雜也因該避免使用any</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46f4a4f69e9b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lion-f2e/%E5%88%86%E4%BA%AB-typescripts-basic-46f4a4f69e9b">[分享] TypeScript’s Basic</a> was originally published in <a href="https://medium.com/lion-f2e">LT Lab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[討論] SASS、SCSS其中@extend 與 @mixin的差異性]]></title>
            <link>https://medium.com/lion-f2e/%E8%A8%8E%E8%AB%96-sass-scss%E5%85%B6%E4%B8%AD-extend-%E8%88%87-mixin%E7%9A%84%E5%B7%AE%E7%95%B0%E6%80%A7-764d3a38dfbd?source=rss-67af28e03088------2</link>
            <guid isPermaLink="false">https://medium.com/p/764d3a38dfbd</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[scss]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[sass]]></category>
            <category><![CDATA[web-design]]></category>
            <dc:creator><![CDATA[chengyucai]]></dc:creator>
            <pubDate>Sat, 03 Aug 2019 16:04:00 GMT</pubDate>
            <atom:updated>2019-09-22T06:46:04.692Z</atom:updated>
            <content:encoded><![CDATA[<h3>[討論] SASS，SCSS其中@extend與@mixin的差異性</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ejtgpm2NznAMLogxowX3kg.jpeg" /></figure><blockquote>前言</blockquote><p><em>在使用SASS，SCSS的時候為了減少重複撰寫的部分，大經常使用@include將已定義好的@Mixin區塊引入進所需的部分，鮮少有人會去使用到@extend，也有不少人認為@extend跟@Mixin一樣的東西，接下來本篇會解析兩者ㄉ的差異與使用時機</em></p><blockquote>@Mixin和@Include</blockquote><p>首先@ Mixin可以讓你定義一個樣式表並且可重複使用，可以選擇帶入參數來進行一些判斷處理，除了減少了撰寫重複代碼的工作外，將代碼統一使維護與修改時可避免同樣的樣式卻出現不一樣的結果，快速建立出屬於自己的樣式庫。</p><p><strong>在參數上這裡介紹三大重點：</strong></p><p>（一）使用上一般會先定義出@Mixin要接收的參數，接者在自訂義區塊下可任意地使用（注意：一般使用下@Includen所傳遞的參數必須與@Mixin所定義的接收數量需相同）</p><p><a href="https://sass-lang.com/documentation/at-rules/mixin#optional-arguments"><strong><em>範例</em></strong></a></p><p>（二）在Mixin所定義的參數是可以設定預設值，這樣的方式Includen可以少於Mixin定義接收的數量（注意：傳遞時是按照順序依序放入）</p><p><a href="https://sass-lang.com/documentation/at-rules/mixin#keyword-arguments"><strong><em>範例</em></strong></a></p><p>（三）在Mixin最後一個參數後面加上&#39;...&#39;，這樣可以使Includen所傳遞的參數數量多於Mixin定義接收的數量，多出的參數以list []的方式呈現。</p><p><a href="https://sass-lang.com/documentation/at-rules/mixin#taking-arbitrary-keyword-arguments"><strong><em>範例</em></strong></a></p><blockquote>@extend</blockquote><p>它的使用比較單純就如同字面上的意思，它的功能就是選擇想要的樣式拓展到使用的位置，簡單來說就是如果你有一個區塊叫（.list），它底下有（：hover）的樣式，你可以選擇@extend到（.list），這樣也會繼承到（.list）所有的樣式包含（：hover）;但也可指定至（.list：hover）這樣就只會得到（：hover）的樣式。</p><pre>注意:在 @media範圍內@extend無法繼承外部資料</pre><p><a href="https://sass-lang.com/documentation/at-rules/extend"><strong><em>範例</em></strong></a></p><blockquote>兩者差異</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*VZ8KTkST3RLwMMAAeI0csw.png" /><figcaption><strong>extend VS mixin</strong></figcaption></figure><ul><li><strong>參數：</strong>需要傳遞參數的場合， Mixin是最佳的選擇，可便於建立一個自訂義的樣式庫</li><li><strong>封裝：</strong>兩者在編譯成CSS時有所差異， Mixin時分開拓展，@extend是合併拓展</li><li><strong>命名：</strong> Mixin是非語義類的可混入特殊符號，@ extend則必須避免特殊符號上的使用。但是extend可無須重新命名，在使用上可避免重複命名的事情發生。</li></ul><blockquote>結論</blockquote><p>事實上大多數Web Server在加載時會將文本相同的重複塊進行壓縮處理，這意味著，儘管mixin可能產生的CSS多於擴展，但它們可能不會大幅增加用戶下載量。因此，選擇對您的用例最有意義的功能，而不是產生最少CSS的功能。</p><blockquote>參考資料</blockquote><p><a href="https://sass-lang.com/">Sass: Syntactically Awesome Style Sheets</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=764d3a38dfbd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lion-f2e/%E8%A8%8E%E8%AB%96-sass-scss%E5%85%B6%E4%B8%AD-extend-%E8%88%87-mixin%E7%9A%84%E5%B7%AE%E7%95%B0%E6%80%A7-764d3a38dfbd">[討論] SASS、SCSS其中@extend 與 @mixin的差異性</a> was originally published in <a href="https://medium.com/lion-f2e">LT Lab</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>