<?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 Sakol Assawasagool (koobitor) on Medium]]></title>
        <description><![CDATA[Stories by Sakol Assawasagool (koobitor) on Medium]]></description>
        <link>https://medium.com/@koobitor?source=rss-286da1b7ca3a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*oYfDxMMS-VkC5exux86iQg.jpeg</url>
            <title>Stories by Sakol Assawasagool (koobitor) on Medium</title>
            <link>https://medium.com/@koobitor?source=rss-286da1b7ca3a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 22 Jun 2026 17:04:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@koobitor/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[Deploy Svelte Kit บน Netlify]]></title>
            <link>https://koobitor.medium.com/deploy-svelte-kit-%E0%B8%9A%E0%B8%99-netlify-3b958262bc24?source=rss-286da1b7ca3a------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b958262bc24</guid>
            <category><![CDATA[netlify]]></category>
            <category><![CDATA[sveltekit]]></category>
            <category><![CDATA[svelte]]></category>
            <category><![CDATA[sveltejs]]></category>
            <category><![CDATA[hosting]]></category>
            <dc:creator><![CDATA[Sakol Assawasagool (koobitor)]]></dc:creator>
            <pubDate>Wed, 15 Jun 2022 12:47:18 GMT</pubDate>
            <atom:updated>2022-06-15T12:47:18.198Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="SvelteKit + netlify" src="https://cdn-images-1.medium.com/max/1024/1*l-LKmcUprgySdGLOlLAuaw.jpeg" /></figure><p>ในบทความนี้หลังจากเราได้ลองขึ้นโครงโปรเจค Svelte ด้วย Svelte Kit กันแล้ว เราก็จะทดสอบ Deploy ขึ้น Cloud Service บน Netlify กันครับ เพื่อให้เราสามารถนำโปรเจค Publish ขึ้นได้ทันที ที่มีการ Commit หรือ Merge เข้า Branch ที่เรากำหนดไว้ทันที</p><h3>Keyword</h3><ul><li><a href="https://www.netlify.com/">Netlify</a> คือ บริการคลาวด์สำหรับนักพัฒนาเว็บ</li><li><a href="https://kit.svelte.dev/">SvelteKit</a> คือ Framework สำหรับสร้างเว็บแอปพลิเคชัน</li></ul><h3>TL;DR</h3><p>ผมทำ Repo เริ่มต้นสำหรับ Svelte Kit และ Tailwind CSS ไว้แล้วสามารถ Clone ลงมาเพื่อใช้งานต่อได้เลย รวมถึงสามารถ Deploy บน Netlify ได้ทันทีครับ</p><blockquote><a href="https://github.com/koobitor/svelte-kit-tailwind-starter"><em>https://github.com/koobitor/svelte-kit-tailwind-starter</em></a></blockquote><h3>Let Get Start!</h3><ol><li>เริ่มต้นติดตั้ง <a href="http://twitter.com/sveltejs/adapter-netlify">@sveltejs/adapter-netlify</a>@next ในโปรเจคของเราได้เลย</li></ol><p>ทำการติดตั้ง adapter netlify ด้วยคำสั่งดังนี้</p><figure><img alt="npm install" src="https://cdn-images-1.medium.com/max/1024/1*Kbi8Z-0_V4cHin6loCCijA.png" /><figcaption>ติดตั้ง adapter netlify</figcaption></figure><p>2. เรียกใช้ adapter สำหรับ netlify แทนการใช้งาน adapter-auto ที่ติดตั้งไว้แต่แรก</p><p>พร้อมปิดการใช้งาน edge function และ เปิด function การ split files javascirpt แยกแต่ละหน้า เพื่อให้ขนาดไฟล์นั้นไม่มัดรวมเป็นไฟล์เดียวกันและใหญ่เกินไป</p><figure><img alt="sveltejs adapter for netlify" src="https://cdn-images-1.medium.com/max/1024/1*iIHffRlzu2CKTGOTUIbZdA.png" /><figcaption>ตั้งค่าไฟล์ svelte.config.js เพื่อเรียกใช้งาน adapter netlify</figcaption></figure><p>3. สร้างไฟล์ Config สำหรับ netlify.toml</p><p>โดยเมื่อมีการ Push จะ Trigger Build Command ที่เรากำหนดค่าไว้ใน package.json ครับ</p><figure><img alt="netlify config file" src="https://cdn-images-1.medium.com/max/756/1*FvqS_69G83Ky5kwBB6ffIA.png" /><figcaption>ตั้งค่า Netlify Command</figcaption></figure><p>4. สร้าง Site บน Netlify</p><p>ในขั้นตอนนี้ผมเลือกที่จะนำเข้าจาก Repo ที่ได้สร้างไว้แล้วให้เลือก Import an existing project ครับ</p><figure><img alt="first step add new site for netlify" src="https://cdn-images-1.medium.com/max/516/1*WUfa2oLA8gZF4YX62cKSRw.png" /></figure><p>5. นำเข้าโปรเจคที่ต้องการ Deploy Site</p><p>ในขั้นตอนนี้เราสามารถเลือกนำเข้า Source Code ได้จากที่ต่างๆที่เราเก็บไว้ ในที่นี้ผมฝากไว้ที่ Github เมื่อเรากด ระบบจะทำการ Authtication เพื่อขอสิทธิในการเข้าถึง Repo ของเรา</p><figure><img alt="second step connect exist repo to netlify" src="https://cdn-images-1.medium.com/max/1024/1*qJWdKNNQoN3U92Cxf4OVFg.png" /></figure><p>6. Select Repository</p><p>ค้นหา Repo ที่เราต้องการและคลิ้กเลยได้เลย</p><figure><img alt="Third step select repo" src="https://cdn-images-1.medium.com/max/1024/1*hj9h3qOtiRLz4E8IHoj1_w.png" /></figure><p>7. Deploy Configuration</p><p>ในขั้นตอนนี้เราได้ทำการกำหนดคำสั่ง Build และ Publish ไว้ในไฟล์ netlify.toml เป็นที่เรียบร้อยแล้ว เลือก Branch ที่ต้องการ Deploy ในที่นี้ผมตั้งให้เป็น master แล้วสามารถกด deploy ได้ทันทีครับ</p><figure><img alt="Deploy Config" src="https://cdn-images-1.medium.com/max/1024/1*2J-Mka4f3uz5Nl3yauCNsQ.png" /></figure><p>8. Deploy Success</p><p>เมื่อระบบทำการ deploy เสร็จแล้ว เราจะได้ random url มา 1 อัน สามารถเปลี่ยน sitename ได้ในกรณีที่ยังวางอยู่ครับ และสามารถ mapping domain ที่เราซื้อไว้ได้ด้วยครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e43J5cQICAlJMPZMMsYitg.png" /></figure><p>9. Preview Site</p><p>ทดสอบเปิดลิงค์ที่ Netlify กำหนดให้ เป็นอันเสร็จเรียบร้อยสำหรับการ Deploy Svelte Kit บน Netlify ครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_NCDQ1Tikxoh7wgkpzWLnQ.png" /></figure><h3>Command and Source Code</h3><p>สามารถ copy code ได้จาก gist โดยคลิ้กที่ view raw เพื่อดูไฟล์ต้นฉบับ</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/de40e17da7be82e8c35c2df1686d295f/href">https://medium.com/media/de40e17da7be82e8c35c2df1686d295f/href</a></iframe><h3>Reference</h3><ul><li><a href="https://docs.netlify.com/integrations/frameworks/sveltekit/">https://docs.netlify.com/integrations/frameworks/sveltekit/</a></li><li><a href="https://www.blognone.com/node/128128">https://www.blognone.com/node/128128</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b958262bc24" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ติดตั้ง Tailwind CSS กับ Svelte Kit Framework]]></title>
            <link>https://koobitor.medium.com/%E0%B8%95%E0%B8%B4%E0%B8%94%E0%B8%95%E0%B8%B1%E0%B9%89%E0%B8%87-tailwind-css-%E0%B8%81%E0%B8%B1%E0%B8%9A-svelte-kit-framework-82c4221f0ef1?source=rss-286da1b7ca3a------2</link>
            <guid isPermaLink="false">https://medium.com/p/82c4221f0ef1</guid>
            <category><![CDATA[starter-kit]]></category>
            <category><![CDATA[preprocessors]]></category>
            <category><![CDATA[sveltekit]]></category>
            <category><![CDATA[tailwind-css]]></category>
            <category><![CDATA[svelte]]></category>
            <dc:creator><![CDATA[Sakol Assawasagool (koobitor)]]></dc:creator>
            <pubDate>Tue, 14 Jun 2022 11:29:01 GMT</pubDate>
            <atom:updated>2022-06-15T23:31:53.007Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KH20Md6aTKphGRuKzu9rsg.jpeg" /></figure><h3>Keyword</h3><ul><li><a href="https://svelte.dev/">Svelte</a> คือ UI Compiler ที่แปลง Code ของเราให้เป็น JavaScript ที่สามารถใช้งานบน Browser ได้ทันที</li><li><a href="https://kit.svelte.dev/">SvelteKit</a> คือ Framework สำหรับสร้างเว็บแอปพลิเคชัน</li><li><a href="https://tailwindcss.com/">Tailwind CSS</a> คือ CSS Framework ที่นิยมในปัจจุบัน</li><li><a href="https://github.com/sveltejs/svelte-preprocess">Svelte Preprocessor</a> คือ พรีโปรเซสเซอร์ ช่วยให้ svelte สามารถแปลง syntax ภาษาอื่นได้เช่น PostCSS, SCSS, Less เป็นต้น</li><li><a href="https://kit.svelte.dev/docs/layouts">Layouts</a> คือ Top Level ของแอปพลิเคชัน</li></ul><h3>TL;DR</h3><p>ผมทำ Repo เริ่มต้นสำหรับ Svelte Kit และ Tailwind CSS ไว้แล้วสามารถ Clone ลงมาเพื่อใช้งานต่อได้เลยครับ ในอนาคตก็จะมีเพิ่ม Libs ต่างๆที่จำเป็นและอัพเดทให้เป็นปัจจุบันไว้เสมอครับ</p><blockquote><a href="https://github.com/koobitor/svelte-kit-tailwind-starter">https://github.com/koobitor/svelte-kit-tailwind-starter</a></blockquote><h3>Let Get Start!</h3><p>ในการติดตั้ง Tailwind CSS เพื่อใช้กับ Svelte Kit โปรเจคมีขั้นตอนดังนี้ลุยกันเลย</p><blockquote>Code ในแต่ละขั้นตอนสามารถ Copy ได้ด้านล่างสุดจ้า</blockquote><ol><li>ก่อนอื่นเราต้องสร้างโปรเจค Svelte Kit โดยใช้คำสั่ง npm init svelte@next เพื่อติดตั้งโปรเจคเริ่มต้นของเรา</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*b7ekRSBO3XrQ06XuYVKcaQ.png" /><figcaption>ติดตั้ง svelte-kit project</figcaption></figure><p>โดยจะสามารถตั้งค่าจาก Template ที่ Svelte Kit เตรียมไว้ได้ โดยจะมีคำถามดังนี้</p><ul><li><strong>Which Svelte app template?</strong> ให้เราเลือก Template เริ่มต้นของแอปพลิเคชัน</li><li>&gt; SvelteKit demo app (จะมีตัวอย่าง)</li><li>&gt; Skeleton project (โครงสร้างอย่างเดียวไม่มีตัวอย่าง App)</li><li><strong>Add type checking?</strong> ตรวจสอบ Type ของตัวแปรในโปรเจคไหม</li><li>&gt; Type-checked JavaScript ตรวจสอบ Type ด้วย typeof</li><li>&gt; TypeScript ตรวจสอบ Type ด้วย TypeScript</li><li>&gt; None ไม่ตรวจสอบ Type</li><li><strong>Add ESLint for code linting?</strong> ให้ ESList ตรวจสอบ Syntax ของเราไหม</li><li><strong>Add Prettier for code formatting?</strong> ให้ Prettier ช่วยจัด Format Code ของเรา</li><li><strong>Add Playwright for browser testing?</strong> ติดตั้ง Playwright ให้เป็น Testing Library ในโปรเจคของเราไหม</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q0BXzS238vuKeh-ju0aKNw.png" /><figcaption>การตั้งค่าเริ่มต้นโปรเจคของเรา</figcaption></figure><p>2. ติดตั้ง Tailwind CSS และ Svelte Preprocess</p><p>เราจะติดตั้ง tailwindcss postcss autoprefixer svelte-preprocess ใน Dev Dependency ของโปรเจคเรา และทำการสร้างไฟล์ config ของ tailwind และ postcss โดย .cjs ย่อมาจาก CommonJS module ไฟล์นะครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ApRsnshpR-0vqGlLEnF4uQ.png" /><figcaption>ติดตั้ง tailwind และ postcss</figcaption></figure><p>3. เปิดให้ &lt;style&gt; สามารถอ่าน Syntax ของ PostCSS ได้</p><p>เพิ่ม preprocess ในไฟล์ svelte.config.js หลังจากเพิ่มแล้วจะได้ code ดังภาพนี้ครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LOEpoNA42MmWmKR0mKEzQw.png" /><figcaption>svelte.config.js ที่เพิ่ม preprocess แล้ว</figcaption></figure><p>4. ตั้งค่าให้ Content Source ของโปรเจคของเรา ให้ Tailwind กัน</p><p>เพิ่ม content source path ในไฟล์ tailwind.config.cjs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2FpVVOH9nx2Hjvy3VctmJg.png" /><figcaption>content source ในโปรเจคเรา</figcaption></figure><p>5. เพิ่มคำสั่ง Tailwind ในไฟล์ app.css</p><p>โดยจะสร้างไฟล์ไว้ที่ ./src/app.css ดังนี้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*SC8rrAYHhohPzk79YLAKUA.png" /><figcaption>Tailwind directives</figcaption></figure><p>6. Import ไฟล์ app.css เข้ามาในโปรเจคของเราผ่าน File Layout</p><p>โดย Svelte Kit จะมี Layout บนสุดของ Application คือไฟล์ ./src/routes/__layout.svelte เราจะทำการ Import app.css ไว้ที่ไฟล์นี้ครับ</p><p>*&lt;Slot /&gt; คือ child content เหมือน props.children ใน React</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*ENmVRxTDumYmozJdkjTgKw.png" /><figcaption>นำเข้าไฟล์ app.css</figcaption></figure><p>7. รัน svelte kit server ด้วยคำสั่ง npm run dev</p><p>เพื่อ Start Server Dev ของเราบน Port 3000</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*JB_OMWZZRJcMIz8YYi_zyw.png" /><figcaption>start svelte-kit server</figcaption></figure><p>8. ทดสอบใช้ CSS Class ของ Tailwind</p><p>โดยเพิ่ม class ต่างๆในไฟล์ index.svelte</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*r4jn7lBQ-6LdJLOktDUQtw.png" /><figcaption>ทดสอบ tailwind css class</figcaption></figure><p>เท่านี้ก็สามารถใช้งาน Tailwind และตั้งต่า ผ่าน tailwind.config.cjs เพื่อเพิ่มตัวแปรต่างๆได้แล้วครับ</p><h3><strong>Command and Source Code</strong></h3><p>สามารถ copy code ได้จาก gist โดยคลิ้กที่ view raw เพื่อดูไฟล์ต้นฉบับ</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c74e41f714056164baf5b550ef49e55a/href">https://medium.com/media/c74e41f714056164baf5b550ef49e55a/href</a></iframe><h3>Reference</h3><ul><li><a href="https://tailwindcss.com/docs/guides/sveltekit">https://tailwindcss.com/docs/guides/sveltekit</a></li><li><a href="https://kit.svelte.dev/docs/layouts">https://kit.svelte.dev/docs/layouts</a></li><li><a href="https://www.designil.com/svelte-framework">https://www.designil.com/svelte-framework</a></li><li><a href="https://www.freecodecamp.org/news/javascript-typeof-how-to-check-the-type-of-a-variable-or-object-in-js">https://www.freecodecamp.org/news/javascript-typeof-how-to-check-the-type-of-a-variable-or-object-in-js</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82c4221f0ef1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ลองเล่น WebAssembly 1.0]]></title>
            <link>https://koobitor.medium.com/%E0%B8%A5%E0%B8%AD%E0%B8%87%E0%B9%80%E0%B8%A5%E0%B9%88%E0%B8%99-webassembly-1-0-f7aaadb27cd0?source=rss-286da1b7ca3a------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7aaadb27cd0</guid>
            <category><![CDATA[webassembly]]></category>
            <category><![CDATA[getting-started]]></category>
            <category><![CDATA[awesome]]></category>
            <category><![CDATA[wasm]]></category>
            <dc:creator><![CDATA[Sakol Assawasagool (koobitor)]]></dc:creator>
            <pubDate>Sat, 07 Dec 2019 01:03:17 GMT</pubDate>
            <atom:updated>2019-12-07T01:03:17.205Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qB1af8tjQltzWKluZumtLw.png" /><figcaption><a href="https://github.com/WebAssembly/web-assembly-logo">https://github.com/WebAssembly/web-assembly-logo</a></figcaption></figure><p>WebAssembly ตัวย่อคือ wasm ออกแบบมาให้มีประสิทธิภาพและเร็ว โดยใช้ประโยชน์จากความสามารถของฮาร์ดแวร์ทั่วไปที่มีอยู่ในแพลตฟอร์มต่างๆ เช่น เว็บและ แอปพลิเคชันเซิร์ฟเวอร์</p><h3><strong>เริ่มกันเลย</strong></h3><p>เราต้องติดตั้ง Pre Compiler ที่ชื่อว่า toolchain สำหรับ Compile ภาษา C/C++ ไปยัง WebAssembly สำหรับ Mac &amp; Linux ติดตั้งตามนี้ได้เลยครับ</p><pre>$ cd ~/<br>$ git clone https://github.com/emscripten-core/emsdk.git<br>$ cd emsdk<br>$ ./emsdk install latest<br>$ ./emsdk activate latest</pre><h3>ตั้งค่า Environment Path และ Variables</h3><p>ตั้งค่า Environment Variables ด้วยคำสั่งนี้ ทำให้เรียกใช้คำสั่งต่างๆได้</p><pre>$ source ./emsdk_env.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*W5ZiWXy0CY9L6xD--MSJYw.png" /><figcaption>ตั้งค่า Environment Variables ได้ Output แบบนี้จ้า</figcaption></figure><p>ปล. ถ้าต้องการให้เรียกใช้งานได้ทุกครั้งต้อง Export Path ด้วยนาจา ตัวอย่างด้านล่างเลย ปรับตั้งค่า Path ให้ตรงกับที่ติดตั้งไว้ด้วยนะครับผม</p><pre>$ export PATH=&quot;/Users/koobitor/emsdk:$PATH&quot;<br>$ export PATH=&quot;/Users/koobitor/emsdk/upstream/emscripten:$PATH&quot;<br>$ export PATH=&quot;/Users/koobitor/emsdk/node/12.9.1_64bit/bin:$PATH&quot;</pre><p>เช็คดูว่า Command ของเราอยู่ใน Folder ไหนน้า</p><pre>$ which emcc</pre><h3>ทดลอง Compile และ Run</h3><p>เราจะทดลอง Compile และ Run โปรแกรมแรกกันดูเลย พิมพ์ตามนี้ได้เลย</p><pre>$ mkdir hello<br>$ cd hello<br>$ cat &lt;&lt; EOF &gt; hello.c<br>#include &lt;stdio.h&gt;<br>int main(int argc, char ** argv) {<br>  printf(&quot;Hello, world!\n&quot;);<br>}<br>EOF<br>$ <strong>emcc hello.c -o hello.html</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K7XUMCbM0w94rJc5L97zlQ.png" /><figcaption>การ Compile ไฟล์ C ไปยัง html, js, wasm</figcaption></figure><p>ใช้คำสั่ง emrun ในการ Start Server ที่ port 8080</p><pre>emrun --no_browser --port 8080 .</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*aYJ_ApVSahPpkIUkxMM84A.png" /><figcaption>เปิด Server Port 8080</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*IUa_3tNXMYUzUziiu-xqpw.png" /><figcaption>ทดสอบเปิด <a href="http://localhost:8080">http://localhost:8080</a></figcaption></figure><p>ไฟล์ Web HTML ที่เรา Compile ได้จะอยู่ที่ hello.html</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7_dVkKBSXKwFDNI1nFhoIA.png" /><figcaption>ทดสอบเปิด <a href="http://localhost:8080">http://localhost:8080</a>/hello.html</figcaption></figure><p>ข้อมูลเพิ่มเติมเจ๋งๆหาได้จาก ลิ้งด้านล่างได้เลยครับ<br>- <a href="https://github.com/mbasso/awesome-wasm">https://github.com/mbasso/awesome-wasm</a><br>- <a href="https://webassembly.org/">https://webassembly.org/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7aaadb27cd0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Native ฉบับเริ่มต้น]]></title>
            <link>https://medium.com/medvine/react-native-%E0%B8%89%E0%B8%9A%E0%B8%B1%E0%B8%9A%E0%B9%80%E0%B8%A3%E0%B8%B4%E0%B9%88%E0%B8%A1%E0%B8%95%E0%B9%89%E0%B8%99-d028f583413d?source=rss-286da1b7ca3a------2</link>
            <guid isPermaLink="false">https://medium.com/p/d028f583413d</guid>
            <category><![CDATA[expo]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[mobile]]></category>
            <dc:creator><![CDATA[Sakol Assawasagool (koobitor)]]></dc:creator>
            <pubDate>Tue, 24 Jul 2018 14:34:11 GMT</pubDate>
            <atom:updated>2018-07-24T14:49:31.655Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5pVADMYS0_WAA0EcIsLWHA.png" /></figure><p><a href="https://github.com/facebook/react-native">React Native</a> ช่วยให้คุณสามารถสร้าง Mobile Application ใช้เพียงภาษา Javascript โดยลักษณะโครงสร้างการเขียนเหมือน React เลย สามารถเรียกใช้ Mobile User Interface จาก Components ต่างๆที่มีให้ใช้มากมาย</p><p><a href="https://github.com/expo/expo">Expo client app</a> เป็น Application ที่ช่วยให้เราเทสการแสดงผลได้บน <a href="https://itunes.apple.com/th/app/expo-client/id982107779?mt=8">iOS</a> และ <a href="https://play.google.com/store/apps/details?id=host.exp.exponent&amp;hl=en">Android</a> โดยตัว Expo ก็เป็น React Native Apps เช่นเดียวกัน ภายในก็จะมี <a href="https://docs.expo.io/versions/latest/sdk/index.html#expo-sdk">Expo SDK</a> ซึ่งทำหน้าที่ช่วยให้เราสามารถเรียกใช้งาน ฟังก์ชั่นต่างๆเช่น camera, contacts, local storage และ อื่นๆที่เกียวกับ Hardware</p><p><a href="https://github.com/react-community/create-react-native-app">create-react-native-app</a> คือ Command Line Tools ที่จะช่วยคุณเริ่มต้นสร้างโปรเจค React Native ได้อย่างง่ายได้ โดย คุณสามารถพัฒนา Mobile Application ได้โดยไม่จำเป็นต้องติดตั้ง Xcode หรือ Android Studio เลย</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ae0c01de4f3e393fad8d0abe8d6fadd5/href">https://medium.com/media/ae0c01de4f3e393fad8d0abe8d6fadd5/href</a></iframe><p>คำสั่งที่เราจะใช้มีดังนี้ครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*81mlMbMKDSnY5s9dh68Z-w.gif" /><figcaption>Install create-react-native-app</figcaption></figure><p>เริ่มต้นให้เราทำการติดตั้ง create-react-native-app ก่อนดังตัวอย่างครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kH2NvpJi1Z93HhGxuvAoEQ.gif" /><figcaption>Create React Native Application</figcaption></figure><p>หลังจากติดตั้ง create-react-native-app เสร็จเรียบร้อยเราก็จะสร้างโปรเจคของเราด้วยคำสั่ง create-react-native-app ตามด้วยชื่อโปรเจคของเราครับ</p><p>เมื่อสร้างโปรเจคเสร็จแล้ว เราจะลองรันด้วยคำสั่ง yarn start</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*IcQDh8FAVsX4Q663vWBfaw.gif" /><figcaption>Test Application on Expo Client iOS</figcaption></figure><p>ในภาพนี้เราจะทดสอบ Application ของเราผ่าน Expo Client บน iOS กัน</p><p>โดย ผมรับลิงค์ที่จะใช้เทสบน iOS ผ่านอีเมล</p><p>เมื่อคลิ้กที่ลิงค์ก็จะ ไปเปิดโปรแกรม Expo และ เปิดโปรเจคของเราขึ้นมาแสดงผล</p><p>จะเห็นว่าตัว Expo Client นั้นมี Inspector ช่วยให้เราสามารถ Debug Element ต่างๆได้ง่ายยิ่งขึ้นครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gTi-cFQIoPQyoazclylOZA.gif" /><figcaption>Preview in iOS Simulator</figcaption></figure><p>ตัวอย่างนี้ เพียงกดตัวอักษร i ใน Command Line ก็จะเรียก iOS Simulator ขึ้นมาแสดงผลครับ</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8e9c4627d7f2ab1eecbfe2b48d047cdb/href">https://medium.com/media/8e9c4627d7f2ab1eecbfe2b48d047cdb/href</a></iframe><p>ตัวอย่าง source code เริ่มต้นที่ได้มาจะมีการใช้ View และ Text ซึ่งเป็น Component ที่มากับ react-native เราจะได้นำไปใช้งานกันเป็นประจำเลยครับ</p><p>ในบทนี้เราได้เรียนรู้อะไรบ้าง<br>- ติดตั้ง create-react-native-app บนเครื่องของเราได้<br>- สร้างโปรเจค react-native ได้<br>- เทสบน Expo Client และ iOS Simulator</p><p>ในบทถัดไป เราจะมา Overview Basic Components ต่างๆกันครับ</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d028f583413d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/medvine/react-native-%E0%B8%89%E0%B8%9A%E0%B8%B1%E0%B8%9A%E0%B9%80%E0%B8%A3%E0%B8%B4%E0%B9%88%E0%B8%A1%E0%B8%95%E0%B9%89%E0%B8%99-d028f583413d">React Native ฉบับเริ่มต้น</a> was originally published in <a href="https://medium.com/medvine">Medvine Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Tips] หมดปัญหา Upgrade Node Package Dependencies ด้วย yarn-upgrade-all]]></title>
            <link>https://medium.com/medvine/tips-%E0%B8%AB%E0%B8%A1%E0%B8%94%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2-upgrade-node-package-dependencies-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-yarn-upgrade-all-caf20f653d8d?source=rss-286da1b7ca3a------2</link>
            <guid isPermaLink="false">https://medium.com/p/caf20f653d8d</guid>
            <category><![CDATA[tips]]></category>
            <category><![CDATA[package-management]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[dependencies]]></category>
            <category><![CDATA[yarn]]></category>
            <dc:creator><![CDATA[Sakol Assawasagool (koobitor)]]></dc:creator>
            <pubDate>Wed, 25 Apr 2018 06:52:16 GMT</pubDate>
            <atom:updated>2018-04-25T06:52:16.037Z</atom:updated>
            <content:encoded><![CDATA[<p>โปรแกรมเมอร์ Node.JS หลายคนเจอปัญหาในการอัพเกรดตัว Modules Dependency ใช่ไหมครับ เพราะโปรเจคหนึ่งมี หลัก 10 จนถึงหลัก 100 Modules</p><h4><strong>วิธีที่ 1 ไล่เช็คไปทีละตัว</strong></h4><p>ผมใช้ Yarn เป็นตัวจัดการ Package ต่างๆในโปรเจคของผม เมื่อถึงเวลาต้อง Upgrade ตัว package ผมก็ต้องไล่เช็คที่ละ Package ว่ามี Version ใหม่ๆออกมาบ้างไหม หน้าตาก็จะเป็นแบบนี้ครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*oijpUbwQHCJX-Nlgrsqq2Q.png" /><figcaption>yarn upgrade package@&lt;version&gt;</figcaption></figure><p>วิธีนี้เราต้องนั่งเลือก Version ของแต่ละ Packge เองทั้งหมดทีละตัว ดูเป็นงานถึก ดูไม่ Engineer เลย</p><h4>วิธีที่ 2 ใช้คำสั่ง yarn upgrade — latest</h4><p>การใช้ yarn upgrade — latest จะอัพเดทเพียงบ้าง Package เท่านั้น</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZikF2BhrszMkhCvyta8-eA.png" /><figcaption>yarn upgrade — latest</figcaption></figure><p>จะเห็นว่าอัพเดทเฉพาะ Module ใหญ่ๆที่เปลี่ยน Version เท่านั้น เช่น Next.js จาก 4.0.1 เป็น 5.1.0 แต่เราอยากให้ทุกๆ Modules อัพเดทหนะสิ</p><h4><strong>ผมขอนำเสนอ </strong><strong>yarn-upgrade-all</strong></h4><p>ทำให้เราสามารถอัพเดททุกๆ Package ในโปรเจคได้ใน Command เดียว ลดเวลามานั่งหา Version ของแต่ละ Package ไปได้เยอะเลย</p><ol><li>วิธีติดตั้งก็ง่ายเหมือนปลอกกล้วยเข้าปาก</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*VC3_Zw-UB_yRR8DpL9PQ9A.png" /><figcaption>yarn global add yarn-upgrade-all</figcaption></figure><p>2. วิธีใช้งานก็ พิมพ์ yarn-upgrade-all</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*88B2s1vnbhV1yAfz_MKGIQ.png" /><figcaption>yarn-upgrade-all</figcaption></figure><p>เพียงเท่านี้เราก็จะได้ Package Stable ที่ล่าสุดใช้งานในโปรเจคของเราแล้วครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4XHxEzXl9rgxdV_Pn9XwZQ.png" /><figcaption>diff package.json</figcaption></figure><h4>หลักการทำงานของ yarn-upgrade-all</h4><p>ก็คือใช้ Script ที่ไล่เช็ค Dependencies ในโปรเจคของเรา และทำการ Remove ออก และ Add กลับเข้าไปใหม่ทำให้ได้ package ที่ update แล้วครับ</p><p>yarn remove &lt;package-name&gt; &amp;&amp; yarn add &lt;package-name&gt;</p><h4>ทำไมถึงไม่ใช้ yarn upgrade --latest</h4><p>บ้างครั้งเราเจอ Bug ในการ upgrade ด้วยวิธีนี้ การ Remove และ Add เข้าไปใหม่อาจจะเป็นวิธีที่ทำให้ Dependencies ที่เชื่อมโยงกันอยู่ได้รับการ Upgrade กลับเข้าไปด้วยครับ</p><p>ปล. อย่าลืมเทสโปรเจคหลัง Upgrade Modules ด้วยนะครับ เผื่อมีบางคำสั่งที่ Deprecated เดี๋ยวจะรันไม่ผ่านครับ</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=caf20f653d8d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/medvine/tips-%E0%B8%AB%E0%B8%A1%E0%B8%94%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2-upgrade-node-package-dependencies-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-yarn-upgrade-all-caf20f653d8d">[Tips] หมดปัญหา Upgrade Node Package Dependencies ด้วย yarn-upgrade-all</a> was originally published in <a href="https://medium.com/medvine">Medvine Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Magento 2 Don’t require First Name & Last Name on Registration]]></title>
            <link>https://medium.com/medvine/magento-2-dont-require-first-name-last-name-on-registration-4ec5d4d21059?source=rss-286da1b7ca3a------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ec5d4d21059</guid>
            <category><![CDATA[magento-2]]></category>
            <category><![CDATA[magento]]></category>
            <dc:creator><![CDATA[Sakol Assawasagool (koobitor)]]></dc:creator>
            <pubDate>Mon, 03 Jul 2017 09:51:36 GMT</pubDate>
            <atom:updated>2017-07-03T09:51:52.654Z</atom:updated>
            <content:encoded><![CDATA[<p>First of all you should remove the is_required option from the lastname attributes in the customer entity and address entity:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gi4xmXgff6gGUKqFdbyFdw.png" /></figure><p>UPDATE `eav_attribute` SET `is_required` = ‘0’ WHERE `eav_attribute`.`attribute_id` = 5;</p><p>UPDATE `eav_attribute` SET `is_required` = ‘0’ WHERE `eav_attribute`.`attribute_id` = 7;</p><p>Ref : <a href="https://magento.stackexchange.com/questions/176823/magento-2-how-to-make-lastname-optional-in-customer-registration-form">https://magento.stackexchange.com/questions/176823/magento-2-how-to-make-lastname-optional-in-customer-registration-form</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ec5d4d21059" width="1" height="1" alt=""><hr><p><a href="https://medium.com/medvine/magento-2-dont-require-first-name-last-name-on-registration-4ec5d4d21059">Magento 2 Don’t require First Name &amp; Last Name on Registration</a> was originally published in <a href="https://medium.com/medvine">Medvine Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Magento 2 fix can’t add product to cart in localhost]]></title>
            <link>https://medium.com/medvine/magento-2-fix-cant-add-product-to-cart-in-localhost-9048147f2544?source=rss-286da1b7ca3a------2</link>
            <guid isPermaLink="false">https://medium.com/p/9048147f2544</guid>
            <category><![CDATA[magento]]></category>
            <category><![CDATA[magento-2]]></category>
            <dc:creator><![CDATA[Sakol Assawasagool (koobitor)]]></dc:creator>
            <pubDate>Mon, 03 Jul 2017 05:51:00 GMT</pubDate>
            <atom:updated>2017-07-03T05:51:00.074Z</atom:updated>
            <content:encoded><![CDATA[<p>Change your base URL from localhost to 127.0.0.1.</p><p>Using localhost as the domain in your base URL causes problems in Magento 2.</p><p>Magento’s base URL configuration is located in the core_config_data table. The following values may need to be changed:</p><ul><li>web/unsecure/base_url</li><li>web/secure/base_url</li></ul><p>For example, if you previously had http://localhost/magento2community/, you should change it to <a href="http://127.0.0.1/magento2community/">http://127.0.0.1/magento2community/</a></p><p>After changing the url, flush the cache (bin/magento cache:flush). You might also need to <a href="http://devdocs.magento.com/guides/v2.1/howdoi/php/php_clear-dirs.html">clear out your var directories</a>.</p><p>Ref : <a href="https://magento.stackexchange.com/questions/105042/add-to-cart-not-working-localhost-only-in-chrome-magento-2-fresh-install">https://magento.stackexchange.com/questions/105042/add-to-cart-not-working-localhost-only-in-chrome-magento-2-fresh-install</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9048147f2544" width="1" height="1" alt=""><hr><p><a href="https://medium.com/medvine/magento-2-fix-cant-add-product-to-cart-in-localhost-9048147f2544">Magento 2 fix can’t add product to cart in localhost</a> was originally published in <a href="https://medium.com/medvine">Medvine Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Beginner] ติดตั้ง Jenkins ด้วย Docker กันไหม]]></title>
            <link>https://medium.com/medvine/beginner-%E0%B8%95%E0%B8%B4%E0%B8%94%E0%B8%95%E0%B8%B1%E0%B9%89%E0%B8%87-jenkins-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-docker-%E0%B8%81%E0%B8%B1%E0%B8%99%E0%B9%84%E0%B8%AB%E0%B8%A1-5fbd0c90cac6?source=rss-286da1b7ca3a------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fbd0c90cac6</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Sakol Assawasagool (koobitor)]]></dc:creator>
            <pubDate>Tue, 06 Dec 2016 08:13:17 GMT</pubDate>
            <atom:updated>2016-12-06T08:14:06.452Z</atom:updated>
            <content:encoded><![CDATA[<p>ทำการ Pull Image จาก Docker ด้วยคำสั่ง</p><pre>$ docker pull jenkins</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*-WS4xQmIFaLuezEpxOVJkA.png" /><figcaption>docker pull jenkins</figcaption></figure><p>รัน Docker Container ด้วยคำสั่ง</p><pre>$ docker run -d -p 49001:8080 -p 50000:50000 -v $PWD/jenkins:/var/jenkins_home -t --name jenkins jenkins</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*xwiY1Y6Nrxa-JkGjdVaoZQ.png" /><figcaption>docker run</figcaption></figure><p>ตรวจสอบสถานะของ Docker Container</p><pre>$ docker ps -a</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*trZUSheOag4lRGsNuEHPcQ.png" /><figcaption>docker ps -a</figcaption></figure><p>ในการรันคำสั่ง docker run ด้านบนนั้น อธิบายได้ดังนี้</p><ul><li>-d ให้รันเป็น Run container in background and print container ID</li><li>-p กำหนดให้ 49001 ชี้ไปยัง 8080 ใน container</li><li>-p กำหนดให้ 50000 ชี้ไปยัง 50000 ใน container</li><li>-v กำหนดให้ directory ~/jenkins เชื่อมต่อกับ /var/jenkins_home ที่อยู่ภายใน Container</li><li>-t คือ Allocate a pseudo-TTY</li><li>— name ตั้งชื่อให้แก่ Container ที่เรากำลังจะรัน</li></ul><p>ต่อไปเรามาทดสอบว่า Jenkins ทำงานหรือยังครับ</p><ul><li>ตรวจสอบ Version ของ Jenkins โดยการเข้าผ่าน URL <a href="http://localhost:50000/">http://localhost:50000/</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*0zGD2AEplwvKJdtwgCf6SQ.png" /><figcaption><a href="http://localhost:50000/">http://localhost:50000/</a></figcaption></figure><ul><li>ตรวจสอบว่า Jenkins เข้าสู่หน้า Setup ได้หรือไม่ผ่าน URL <a href="http://localhost:49001/">http://localhost:49001/</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*WrsBSliJ4N_2VFYYUCFGCQ.png" /><figcaption><a href="http://localhost:49001/">http://localhost:49001/</a></figcaption></figure><p><strong>ขั้นต่อไปเรามาติดตั้ง Jenkins กันครับ</strong></p><ol><li>เริ่มด้วยการเอารหัสผ่านเริ่มต้นที่ระบบสร้างไว้มากรอกในหน้านี้ครับ</li></ol><pre>$ docker exec -it jenkins bash<br>$ cd /var/jenkins_home/secrets/<br>$ cat initialAdminPassword</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*81VxXJ9GTcGQCpVnag-o8A.png" /><figcaption>วิธีการเข้าเครื่องไปเอารหัสผ่านเริ่มต้น</figcaption></figure><p>2. เลือก Plugin ในขั้นตอนนี้แนะนำให้เลือก Install suggested plugins เนื่องจากเรายังเป็นมือใหม่ ขอลองใช้งานสิ่งที่มีมาให้ก่อนครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*AxoV00iQkvCjfT_hkkiniw.png" /><figcaption>Customize Jenkins</figcaption></figure><p>3. ระบบจะทำการติดตั้ง Jenkins และ Plugins พื้นฐานให้เราครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*nnbWnhZLyufu-nGv3rMHIw.png" /><figcaption>Jenkins Install Screen</figcaption></figure><p>4. สร้าง Admin User เพื่อเข้าสู่ระบบ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*vZSP8txNfb191oYpwo-s6Q.png" /><figcaption>Create First Admin User</figcaption></figure><p>5. เป็นอันว่าติดตั้ง Jenkins เรียบร้อยแล้วจ้า</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*6K8_fgEjpWrxVZcu4z8maQ.png" /><figcaption>Jenkins is ready!</figcaption></figure><p>มาดูหน้าตาของ Jenkins ให้ชื่นใจกันครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zg1lzlwDxTvBoq-SVc9pUw.png" /><figcaption>Jenkins Dashboard</figcaption></figure><p>Blog ต่อๆไปผมจะไล่เขียนเกี่ยวกับการใช้งาน Jenkins สำหรับ Web Development นะครับ รอติดตามกันครับ</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fbd0c90cac6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/medvine/beginner-%E0%B8%95%E0%B8%B4%E0%B8%94%E0%B8%95%E0%B8%B1%E0%B9%89%E0%B8%87-jenkins-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-docker-%E0%B8%81%E0%B8%B1%E0%B8%99%E0%B9%84%E0%B8%AB%E0%B8%A1-5fbd0c90cac6">[Beginner] ติดตั้ง Jenkins ด้วย Docker กันไหม</a> was originally published in <a href="https://medium.com/medvine">Medvine Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s stop worrying about the complicated structure and use Riot.js]]></title>
            <link>https://medium.com/santora-nakama/lets-stop-worrying-about-the-complicated-structure-and-use-riot-js-e5d68a0fef71?source=rss-286da1b7ca3a------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5d68a0fef71</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angularjs]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[riots]]></category>
            <dc:creator><![CDATA[Sakol Assawasagool (koobitor)]]></dc:creator>
            <pubDate>Fri, 09 Sep 2016 04:01:24 GMT</pubDate>
            <atom:updated>2017-03-06T04:18:34.074Z</atom:updated>
            <content:encoded><![CDATA[<p>Nowadays, the main factor that’s considered by users when we want to develop Web Application is the flow of application. Web Application Developers need to pay attention to the speed in loading and Responsive Design in order to impress users and make them choose the application.</p><p>To create an interaction between Web Applications, developers need to use Javascript as their tool. It points out where users click and helps developers to create programs.</p><p>As the commands are created to satisfy users’ needs, more than 100 lines of Javascript are written in the system. jQuery from Javascript Library are used to make the script shorter and easier. However, there is also the Event Management problem in regarding response in some parts of the site, for instance, Redundant Response, Event ordering and Event continuity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/0*8n7fA3zptpZJsEH5." /></figure><p>Due to the differences between thinking method and basic programming, it is hard and complicated to deal with Event in Javascript. The original programming is <strong>Synchronous</strong> which is done step-by-step. One must be completed first before starting the next step. <strong>Asynchronous</strong> is another basic programming where steps in process may occur at the same time and there is no need to wait for the prior step to complete. This is why programmers who are used to the original one might be a little confused.</p><p>From the problems above, developers have been finding ways to improve and control the response to make each part more efficient. This started the ‘Javascript Framework’ used by big companies and users, for example, AngularJS by Google, React by Facebook and Riot.js. Each of them has an ability to respond to the creation of Web Application. The framework is hard and users need to learn more about it.</p><p><strong>Sample: Basic Function Todo-List in each Framework</strong></p><ol><li>AngularJS — a toolset created in 2010</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*34sGp9tJvrYARJDg66iDqw.png" /><figcaption>Angular Todo</figcaption></figure><p>2. React JS — created in March 2013 and typically written in JSX and ES6</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*vvGQjo29o2AA_iDi." /></figure><p>3. Riot.js — created in September 2013</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*AcXSFTqJ8oLo2jZj." /></figure><p>Riot is easier to understand comparing to AngularJS and ReactJs which are really quite difficult. There is no need for the Users to search or study new programs, language or script etc. because HTML, CSS and Javascript knowledge are what they already have.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/0*XFHHn4zy3yPqufGl." /></figure><p>Riot.js has been specifically created to manage User Interface and this is the reason why Riot.js is smaller than other frameworks. It represents itself as ‘Micro-Library’ that can be used to manage all parts of the website. Also, it can be used with complicated Web Application depending on how you plan to develop the structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*EQweMMmy4jZvEYUI." /></figure><p>Table above is the Framework Size Comparison wherein you can see that Riot is smaller than others. So, this Micro-Library can be a good choice for you!</p><p>HTML, CSS and JavaScript are three basic factors of a website. Each of these will work separately. Riot will combine all three in one file.</p><p>Here is how <strong>Custom Tags</strong> look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/0*85dDkFSXPrpAKFsQ." /></figure><ol><li>&lt;like&gt;&lt;/like&gt;: A tag that we created and basically use HTML. Also can be used in the Pre-Compiler HTML, for example, Jade.</li><li>&lt;script&gt;&lt;/script&gt; or Javascript: Script Tag can be inserted based on your preference. Syntax of Pre-Compiler (ex. CoffeeScript, Babel, TypeScript) can be used.</li><li>&lt;style&gt;&lt;/style&gt;: A CSS. We can put it in the same file.</li></ol><p><strong>Example</strong>: How to use tag by riot.mount</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/0*nx4f-ZgYBquKBLFs." /></figure><p><strong>2 types of Tag format:</strong></p><ol><li>Custom tags can be placed by using the particular Name tag</li><li>HTML Elements as tags must add ‘Attribute’ into the HTML</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/0*F_uQtHHar1QmSCyg." /></figure><p><strong>3 types of Mount:</strong></p><ol><li>Mount all displayed tags</li><li>Mount only tags in id=my-element</li><li>Mount only specified Custom tags</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*VxvnR91CLFJ85wCq." /></figure><p>See! It is very simple and you are now able to use Riot!</p><p>And if you want to stop all actions with the DOM, following the below instructions to do so.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/0*iPiqR1TMW9fjL3w8." /></figure><p>You need to create a function in ‘Script’ and place it in each Event type of the ‘Attribute’, for example, onclick, onmouseover, onmouseout, onchange. If you do this, you will be able to deal with the event from DOM.</p><p>The article above is my first blog with intended to create and write blogs like other GEEKS do! Please let me know if you have any comments or suggestions towards my blog.</p><p><strong>Stay tuned for more interesting topics:</strong></p><p>- Focus on how to use Riot Features<br>- Create your own components<br>- Setup Workflow Front-end Theme Riot + Gulp<br>- Create Web Application by Riot, RiotControl, PostCSS, Webpack<br>- Use ‘Riot, Mocha and Chai’ in creating TDD</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5d68a0fef71" width="1" height="1" alt=""><hr><p><a href="https://medium.com/santora-nakama/lets-stop-worrying-about-the-complicated-structure-and-use-riot-js-e5d68a0fef71">Let’s stop worrying about the complicated structure and use Riot.js</a> was originally published in <a href="https://medium.com/santora-nakama">Santora Nakama</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Beginner] เลิกเหนื่อยกับโครงสร้างยากๆหันมาใช้ Riot.js]]></title>
            <link>https://medium.com/begincodes/%E0%B9%80%E0%B8%A5%E0%B8%B4%E0%B8%81%E0%B9%80%E0%B8%AB%E0%B8%99%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%A2%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B9%82%E0%B8%84%E0%B8%A3%E0%B8%87%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87%E0%B8%A2%E0%B8%B2%E0%B8%81%E0%B9%86%E0%B8%AB%E0%B8%B1%E0%B8%99%E0%B8%A1%E0%B8%B2%E0%B9%83%E0%B8%8A%E0%B9%89-riot-js-d265c30e8dae?source=rss-286da1b7ca3a------2</link>
            <guid isPermaLink="false">https://medium.com/p/d265c30e8dae</guid>
            <category><![CDATA[framework]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[riots]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Sakol Assawasagool (koobitor)]]></dc:creator>
            <pubDate>Thu, 01 Sep 2016 20:37:10 GMT</pubDate>
            <atom:updated>2016-12-06T07:46:14.200Z</atom:updated>
            <content:encoded><![CDATA[<p>ทุกวันนี้หากเราต้องพัฒนาเว็บแอพพลิเคชั่น ขึ้นมาปัจจัยที่ต้องคำนึงถึงในมุมมองของผู้ใช้งานคือความไหลลื่นของตัวแอพพลิเคชั่น การทำให้แอพพลิเคชั่นทำงานได้อย่างสมบูรณ์อย่างเดียวคงไม่เพียงพออีกต่อไป แต่การสร้างความประทับใจ ทั้งความเร็วในการโหลด และการแสดงผลในทุกๆอุปกรณ์ได้อย่างสมบูรณ์ เป็นเรื่องที่นักพัฒนาจำเป็นต้องให้ความสำคัญเป็นอย่างมาก</p><p>การพัฒนาเว็บแอพพลิเคชั่นให้สามารถโต้ตอบกับผู้ใช้งานได้จำเป็นต้องใช้ Javascript เข้ามาช่วยทำให้ทราบว่าผู้ใช้งาน คลิ๊กบริเวณไหน เพื่อที่จะเขียนโปรแกรมตอบสนองในส่วนนั้นๆต่อไป</p><p>เมื่อมีการเขียนคำสั่งต่างๆขึ้นมาเพื่อตอบสนองผู้ใช้งาน ทำให้จำเป็นต้องเขียน Javascript มากมายหลายร้อยหลายพันบรรทัด มีการนำ Javascript Library เช่น jQuery เข้ามาช่วยให้การเขียนนั้นสั่นลงและดูง่ายมากยิ่งขึ้น แต่ก็พบปัญหาในการจัดการ Event ที่ตอบสนองต่อส่วนต่างๆของเว็บ เช่นการตอบสนองซ้ำซ้อน หรือการจัดลำดับการเกิดและความต่อเนื่องของ Event ก็เป็นปัญหาอย่างมาก</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*PPkQYfwB0rI8nPWt8Gzc6g.png" /><figcaption><a href="https://jquery.com/">https://jquery.com/</a></figcaption></figure><p>การจัดการกับ Event ใน Javascript เป็นเรื่องลำบาก เนื่องจากวิธีคิดแตกต่างกับพื้นฐานการเขียนโปรแกรมแบบดังเดิมที่เป็นแบบ Synchronous ทำงานที่ละงานต่อไปเรื่อยๆ แต่แบบ Asynchronous ทำงานพร้อมกันหลายๆงานโดยไม่จำเป็นต้องรอให้งานก่อนหน้าเสร็จก่อน ทำให้โปรแกรมเมอร์ที่ชินกับการประมวลผลแบบเดิมสับสนกันไปตามๆกัน</p><p>จากปัญหาที่พบทำให้นักพัฒนาหาทางปรับปรุงและควบคุมการตอบสนอง ในแต่ละส่วนให้มีประสิทธิภาพมากขึ้น ทำให้เกิด Javascript Framework ที่ถูกผลิตใช้ภายในบริษัทใหญ่ๆและนำมาให้คนทั่วไปสามารถนำไปใช้งานได้ เช่น AngularJS โดย Google , React โดย Facebook และ น้องเล็กอย่าง Riot.js ซึ่งแต่ละตัวมีความสามารถที่ตอบสนองต่อการสร้างเว็บแอพพลิเคชั่นได้ดีเยี่ยม แต่! ติดอยู่อย่างเดียวทำไมการเรียนรู้แต่ละตัวมันชั่งยากเย็นจริงๆ</p><p><strong>ตัวอย่างการเขียน Basic Function Todo-List ในแต่ละ Framework</strong></p><ol><li>เริ่มต้นกันด้วย Angular JS ผู้ที่เกิดก่อนใครเพื่อนเลยปี 2010</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*34sGp9tJvrYARJDg66iDqw.png" /><figcaption>Angular Todo</figcaption></figure><p>2. React JS พัฒนากันอย่างต่อเนื่องไม่หยุดยัง เริ่มทำมาตั้งแต่ มีนาคม 2013 <br>อยากใช้ React ต้องทำใจเรียนรู้ภาษาใหม่เพิ่มอีกสัก 2 ภาษา jsx และ es6</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qFXscl4RzBwiAfD7ZrjP-g.png" /><figcaption>React Todo</figcaption></figure><p>3. น้องใหม่ใสๆ Riot.js สวยใส ไฉไล กว่าใคร ตามมาติดๆ กันยายน 2013</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*WDwSL5FBL7UiMBZaY_2BvQ.png" /><figcaption>Todo Riot.js</figcaption></figure><p>มีมากมายหลายรูปแบบการเขียน ทั้ง Angular JS ในรูปแบบของ Module และ ใหม่มากๆแบบ React มาจบลงกับความพอดีที่ Riot ไม่ต้องเรียนรู้อะไรใหม่เพราะมันใช้ความรู้เดิมได้ทันที! HTML, CSS, Javascript</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*rmaX_iixU8Lw-S_gTFJEPQ.png" /><figcaption><a href="http://riotjs.com/">http://riotjs.com/</a></figcaption></figure><p>Riot.js เกิดมาเพื่อจัดการ User Interface โดยเฉพาะมันจึงเล็กกว่า Framework ตัวอื่นๆ โดยวางจุดขายว่าตนเองเป็น micro-library นะ ถ้าต้องการใช้งานเพียงเพื่อจัดการกับส่วนต่างๆของหน้าเว็บหนะมันเหมาะมากเลย แต่ก็ใช่ว่าจะใช้งานกับเว็บแอพพลิเคชั่นที่ซับซ้อนไม่ได้นะครับ มันทำได้อยู่ที่คุณจะวางโครงสร้างยังไงให้พัฒนาต่อยอดได้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DhDGyLAVlupew9vWTk15yw.png" /><figcaption><a href="https://github.com/riot/riot">https://github.com/riot/riot</a></figcaption></figure><p>จากตารางเปรียบเทียบแล้ว Riot เล็กกว่าชาวบ้านมากจ้า พกพาสดวกแทบไม่ต้องคิดเลยที่จะเปลี่ยนมาใช้ micro library ตัวนี้ ในเมื่อเราเจอของดีแล้วอย่ารอช้าลองเลย</p><p>โดยปกติส่วนประกอบของเว็บพื้นฐานประกอบด้วย HTML, CSS และ Javascript แต่ละส่วนแยกกันเพื่อทำงานของตนเอง แต่ Riot ร่วม 3 อย่างนี้ไว้ใน 1 ไฟล์ จบปิ้ง <br>มาทำความรู้จักหน้าตาของ Custom Tags กันเลย</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*xYcjXWPqlckz86x0ztTOHQ.png" /><figcaption>sample tag style</figcaption></figure><ol><li>&lt;like&gt; &lt;/like&gt; คือ Tag ที่เราสร้างขึ้นมาเพื่อใช้งานครับ ภายในประกอบไปด้วย html ปกติ พิมพ์ลงไปได้เลย หรือใครที่ใช้ Pre-Compiler HTML เช่น <a href="http://jade-lang.com/">Jade</a> ก็สามารถนำมาใช้งานได้ครับ</li><li>&lt;script&gt;&lt;/script&gt; หรือ Javascript นั้นเอง จะใส่ Tag script หรือไม่ก็ได้ตามแต่ความชอบครับ โดยเราสามารถเขียนด้วย Syntax ของ Pre-Compiler ได้ด้วย เช่น <a href="http://coffeescript.org/">CoffeeScript</a>, <a href="https://babeljs.io">Babel</a>, <a href="https://www.typescriptlang.org/">TypeScript</a></li><li>&lt;style&gt;&lt;/style&gt; คือ CSS ใช่ครับ เราสามารถใส่ css ลงไปในไฟล์เดียวกันได้เลย</li></ol><p>ตัวอย่างวิธีเรียกใช้งาน Tag ด้วย riot.mount</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*3Q6BrEHNNhy1NcOHwvHrmw.png" /><figcaption>riot + compiler</figcaption></figure><p>รูปแบบของการวาง tag เพื่อใช้งาน จะมี 2 แบบ</p><ol><li>Custom tags ใส่เป็นชื่อ tag นั้นๆได้เลย</li><li>HTML elements as tags ใส่ attribute ลงไปใน HTML</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*f5umA4Fa7HwMnhKrX5AAtw.png" /><figcaption>insert tag style</figcaption></figure><p>รูปแบบของการ mount จะมี 3 แบบ</p><ol><li>mount ทุกๆ tag ที่ปรากฏอยู่</li><li>mount เฉพาะ tag ที่อยู่ใน id=my-element</li><li>mount เฉพาะ custom tags ที่ระบุ</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*Y7O2WaVfk4_OW4N2KL7UdQ.png" /><figcaption>riot.mount style</figcaption></figure><p>เท่านี้คุณก็สามารถใช้งาน Riot ได้ในโปรเจคของคุณแล้วครับ ปรบมือ เฮ้ๆๆๆ</p><p>หากคุณต้องการ ดักการกระทำต่างๆ กับ DOM ของเราทำได้ดังนี้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*n4ULQF9SJYb0yrKKM4rM7A.png" /><figcaption>Event handlers</figcaption></figure><p>เพียงสร้าง Function ไว้ในส่วนของ Script และ วางไว้ส่วนของ Attribute ประเภท Event ทั้งหลาย เช่น onclick, onmouseover, onmouseout, onchange ก็สามารถจัดการกับ Event ที่เกิดขึ้นกับ DOM ตัวนั้นๆได้แล้วครับ</p><p>บทความนี้ก็เป็นบทความแรกของผม ด้วยความตั้งใจมานานมากว่าอยากเขียน Blog ให้ได้แบบ Geek ท่านอื่นๆบ้าง &gt; &lt; หากมีข้อแนะนำติชมขอได้อย่าเกรงใจ จัดเต็มเพื่อให้ผมได้พัฒนาตัวเองด้วยครับ :)</p><p>หัวข้อบทความที่จะเขียนต่อไป</p><ul><li>เจาะวิธีการใช้งานคุณสมบัติต่างๆของ Riot ให้เต็มประสิทธิภาพ</li><li>สร้าง Components ของคุณเองแบบครบเครื่อง</li><li>Setup Workflow Front-end Theme Riot + Gulp</li><li>การสร้างเว็บแอพพลิเคชั่นโดยใช้ Riot, RiotControl, PostCSS, Webpack</li><li>ทำ TDD ด้วย Riot, Mocha, Chai</li></ul><p>รอติดตามกันนะครับ :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d265c30e8dae" width="1" height="1" alt=""><hr><p><a href="https://medium.com/begincodes/%E0%B9%80%E0%B8%A5%E0%B8%B4%E0%B8%81%E0%B9%80%E0%B8%AB%E0%B8%99%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%A2%E0%B8%81%E0%B8%B1%E0%B8%9A%E0%B9%82%E0%B8%84%E0%B8%A3%E0%B8%87%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87%E0%B8%A2%E0%B8%B2%E0%B8%81%E0%B9%86%E0%B8%AB%E0%B8%B1%E0%B8%99%E0%B8%A1%E0%B8%B2%E0%B9%83%E0%B8%8A%E0%B9%89-riot-js-d265c30e8dae">[Beginner] เลิกเหนื่อยกับโครงสร้างยากๆหันมาใช้ Riot.js</a> was originally published in <a href="https://medium.com/begincodes">BeginCodes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>