<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: sambit sahoo</title>
    <description>The latest articles on DEV Community by sambit sahoo (@sambitsahoojs).</description>
    <link>https://dev.to/sambitsahoojs</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F159568%2Fa46302ef-978f-4a2f-9b22-65572ee0745b.jpeg</url>
      <title>DEV Community: sambit sahoo</title>
      <link>https://dev.to/sambitsahoojs</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sambitsahoojs"/>
    <language>en</language>
    <item>
      <title>Opinions on The Vue ecosystem
</title>
      <dc:creator>sambit sahoo</dc:creator>
      <pubDate>Sat, 16 Oct 2021 08:11:13 +0000</pubDate>
      <link>https://dev.to/sambitsahoojs/opinions-on-the-vue-ecosystem-oem</link>
      <guid>https://dev.to/sambitsahoojs/opinions-on-the-vue-ecosystem-oem</guid>
      <description>&lt;p&gt;It's been a year since Vue 3 was released. This release was hailed as a revolutionary change to the classic &lt;code&gt;Vue&lt;/code&gt; approach as it introduced the &lt;code&gt;Composition API&lt;/code&gt; and a complete rewrite of the Vue core in typescript. It brought many new things for developers, which included native &lt;code&gt;TS&lt;/code&gt; support, functional API, faster performance to name a few. At first sight, the new API may seem a bit complex, but believe me, after working with Vue 3 and composition API for over a year now, I bet this is what Vue should be. When it was released last year, many developers were pretty skeptical about migrating to Vue 3 as most of the core libs were in either &lt;code&gt;rc&lt;/code&gt; or &lt;code&gt;beta&lt;/code&gt; . Many famous Vue component libs e.g. Quasar, Vuetify were also working on their port of Vue 3. The state of tooling i.e. Vetur, Vue CLI etc. were not reliable with partial support for Vue 3. But times have changed, the ecosystem has come a long way with most of the core libs in stable status, great upgrades to tooling and amazing contribution from the community. In this article I'll share my opinions on the Vue ecosystem and how Vue will grow to something further our imagination.&lt;/p&gt;

&lt;h3&gt;
  
  
  The framework
&lt;/h3&gt;

&lt;p&gt;Currently, the latest Vue release is &lt;code&gt;3.2.20&lt;/code&gt;. There were 2 minor and multiple patch releases since it came out for the first time. IMO the framework has grown a lot in this previous year. I'll go through some of the notable features and fixes below.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;&amp;lt;script setup&amp;gt;&lt;/code&gt; &lt;code&gt;3.2.x&lt;/code&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Script setup is a new approach to write Vue apps with composition API&lt;/li&gt;
&lt;li&gt;Basically it assumes that you write the script block in pure composition API&lt;/li&gt;
&lt;li&gt;From the Vue docs &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;script setup&amp;gt;&lt;/code&gt; is a compile-time syntactic sugar for using Composition API inside Single File Components (SFCs). It is the recommended syntax if you are using both SFCs and Composition API. It provides a number of advantages over the normal &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; syntax:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;More succinct code with less boilerplate&lt;/li&gt;
&lt;li&gt;Ability to declare props and emitted events using pure TypeScript&lt;/li&gt;
&lt;li&gt;Better runtime performance (the template is compiled into a render function in the same scope, without an intermediate proxy)&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Better IDE type-inference performance (less work for the language server to extract types from code)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;e.g.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So this becomes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vue"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;defineComponent&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="nx"&gt;setup&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;someVar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;someVar&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vue"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt; &lt;span class="na"&gt;setup&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;someVar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;notice the reduction in boilerplate. Also there are &lt;code&gt;macros&lt;/code&gt; for defining props, emits, expose and default props. e.g.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vue"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt; &lt;span class="na"&gt;setup&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"ts"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="nx"&gt;withDefaults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;defineProps&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;someProp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(),{&lt;/span&gt;
  &lt;span class="na"&gt;someProp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;someValue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;defineEmits&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="na"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;some-event&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;val&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;someVar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code snippet is declarative, looks clean, easy to read and understand. It's also easy for extensions to provide near-to-native &lt;code&gt;TS&lt;/code&gt; intellisense. Learn more about this feature &lt;a href="https://v3.vuejs.org/api/sfc-script-setup.html#basic-syntax"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  State driven style binding &lt;code&gt;3.2.x&lt;/code&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Now it's possible to bind your component state to css values inside &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; blocks&lt;/li&gt;
&lt;li&gt;e.g.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vue"&gt;&lt;code&gt;// from vue docs
&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;hello&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;template&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt; &lt;span class="na"&gt;setup&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;red&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;style&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nc"&gt;.text&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;v-bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;style&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This brings a lot of new possibilities to design components by making it easier and cleaner to manipulate CSS based on state. Learn more &lt;a href="https://v3.vuejs.org/api/sfc-style.html#state-driven-dynamic-css"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Performance imorovements
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;The reactivity internals is improved&lt;/li&gt;
&lt;li&gt;Now effects consume less memory and give better performace&lt;/li&gt;
&lt;li&gt;There are also some improvements in &lt;code&gt;ref&lt;/code&gt; track/trigger&lt;/li&gt;
&lt;li&gt;see this &lt;a href="https://github.com/vuejs/vue-next/pull/2345"&gt;PR&lt;/a&gt; for more info
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These were some of the major changes/improvements that had an impact on my development experience. There are many other changes which improved the framework as a whole. Please see vue &lt;a href="https://github.com/vuejs/vue-next/blob/master/CHANGELOG.md"&gt;changelogs&lt;/a&gt; for more info. In my opinion the new API and coding approach make Vue more &lt;code&gt;intuitive&lt;/code&gt; and &lt;code&gt;approachable&lt;/code&gt; for beginners and I hope more and more developers will choose Vue for their projects. During my time with Vue I found it really enjoyable to write code and more specifically in Typescript as the support is near to the standards of React. I also write react a lot and believe me, the experience is &lt;code&gt;indifferent&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Core libraries
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://next.router.vuejs.org/"&gt;Vue-router&lt;/a&gt; &lt;code&gt;4.x&lt;/code&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;API is stable and similar to previous version&lt;/li&gt;
&lt;li&gt;New API follows the same &lt;code&gt;functional&lt;/code&gt; approach as Vue 3&lt;/li&gt;
&lt;li&gt;Also has composition API helpers or composables&lt;/li&gt;
&lt;li&gt;Introduces small breaking changes&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://next.vuex.vuejs.org/"&gt;Vuex&lt;/a&gt; &lt;code&gt;4.x&lt;/code&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;API is stable and similar to previous version&lt;/li&gt;
&lt;li&gt;New API follows the same &lt;code&gt;functional&lt;/code&gt; approach as Vue 3&lt;/li&gt;
&lt;li&gt;Also has composition API helpers or composables&lt;/li&gt;
&lt;li&gt;Introduces small breaking changes&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://next.vue-test-utils.vuejs.org/"&gt;Vue test utils&lt;/a&gt; &lt;code&gt;2.x&lt;/code&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Currently in &lt;code&gt;rc&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Small breaking changes&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Third party frameworks and libraries
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://v3.nuxtjs.org/"&gt;Nuxt&lt;/a&gt; &lt;code&gt;3.x&lt;/code&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Public beta&lt;/li&gt;
&lt;li&gt;Complete re-write in TS&lt;/li&gt;
&lt;li&gt;New server engine&lt;/li&gt;
&lt;li&gt;New CLI&lt;/li&gt;
&lt;li&gt;First class vite support&lt;/li&gt;
&lt;li&gt;Upto 75x smaller server deployments&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://quasar.dev/"&gt;Quasar&lt;/a&gt; &lt;code&gt;2.x&lt;/code&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Stable API&lt;/li&gt;
&lt;li&gt;Webpack 5&lt;/li&gt;
&lt;li&gt;Regular minor and patch releases&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://vuetifyjs.com/en/"&gt;Vuetify&lt;/a&gt; &lt;code&gt;3.x&lt;/code&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Currently in alpha&lt;/li&gt;
&lt;li&gt;target release Feb 2022&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://vueuse.org/"&gt;VueUse&lt;/a&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Collection of essential Vue Composition Utilities&lt;/li&gt;
&lt;li&gt;Supports Vue 2 and 3&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://vee-validate.logaretm.com/v4/"&gt;VeeValidate&lt;/a&gt; &lt;code&gt;4.x&lt;/code&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Stable API&lt;/li&gt;
&lt;li&gt;Vue 2 support via &lt;code&gt;v3.x&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Other famous existing libs are currently supporting &lt;code&gt;Vue3&lt;/code&gt; while some of them are still in progress. TBH the vue community was really fast in adapting the new API and most of them almost did a complete rewrite with the new API. It's a really good sign and motivates developers like me to adopt the new API and write clean, declarative and functional code. Many new component libs have also come out with exclusive support for Vue 3. It makes me really happy that if someone decides to use Vue 3 in their application, there is a vast number of stable, maintained libs available to use.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tooling
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://next.cli.vuejs.org/"&gt;Vue CLI&lt;/a&gt; &lt;code&gt;5.x&lt;/code&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Currently in &lt;code&gt;beta&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Webpack 5&lt;/li&gt;
&lt;li&gt;New cli plugins&lt;/li&gt;
&lt;li&gt;many other breaking changes&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://devtools.vuejs.org/"&gt;Vue Devtools&lt;/a&gt; &lt;code&gt;6.x&lt;/code&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Currently in &lt;code&gt;beta&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;New Timeline API for inspection&lt;/li&gt;
&lt;li&gt;Supports &lt;code&gt;vue-router&lt;/code&gt;, &lt;code&gt;vuex&lt;/code&gt; via plugins with new plugin API&lt;/li&gt;
&lt;li&gt;regular minor and patch releases&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://vitejs.dev/"&gt;Vite&lt;/a&gt; &lt;code&gt;2.x&lt;/code&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Vite is a fast frontend tooling which works on native ESM for dev server with &lt;code&gt;esbuild&lt;/code&gt; as its bundler&lt;/li&gt;
&lt;li&gt;It has a pre-optimized and opinionated preset for production builds based on &lt;code&gt;Rollup&lt;/code&gt; which is an amazing lib in itself&lt;/li&gt;
&lt;li&gt;Supports Vue out of the box with &lt;code&gt;@vitejs/plugin-vue&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;It's created by &lt;code&gt;Evan You&lt;/code&gt;, the creator of &lt;code&gt;Vue&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;With a great Plugin API, vite has many useful plugins for alomost every use case&lt;/li&gt;
&lt;li&gt;It's framework agnostic and also supports SSR&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://github.com/johnsoncodehk/volar"&gt;Volar&lt;/a&gt; &lt;code&gt;0.x&lt;/code&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Currently &lt;strong&gt;&lt;code&gt;the Best&lt;/code&gt;&lt;/strong&gt; language support implementation for &lt;code&gt;Vue 3&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Near to native TypeScript and Javascript intellisense&lt;/li&gt;
&lt;li&gt;Supports &lt;code&gt;&amp;lt;script setup&amp;gt;&lt;/code&gt; out of the box&lt;/li&gt;
&lt;li&gt;Many other useful features which improves DX&lt;/li&gt;
&lt;li&gt;Type checking of &lt;code&gt;.vue&lt;/code&gt; files in terminal via &lt;code&gt;vue-tsc&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Improves really fast, as an early user I can confirm that&lt;/li&gt;
&lt;li&gt;Maintained really well, most of the issues get resolved within 2-3 days&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Vetur is also in the works to support Vue 3 but it's not that good. IMO, tooling has improved the most. These improvements and regular updates have made it possible to get started quickly while having excellent DX. Give it a try, you'll be amazed by the DX that &lt;code&gt;Vue&lt;/code&gt; provides these days.&lt;/p&gt;

&lt;h3&gt;
  
  
  Community
&lt;/h3&gt;

&lt;p&gt;Again this year &lt;code&gt;Vue&lt;/code&gt; community has grown a lot. Many new useful libs were released and are also maintained properly. The &lt;code&gt;vue-next&lt;/code&gt; repo or the Vue core releases patches frequently and same goes with other core libs. In my observation, many developers are contributing to the framework now and the participation only grows day by day. This change assures that &lt;code&gt;Vue&lt;/code&gt; is and will continue to improve itself. &lt;/p&gt;

&lt;h3&gt;
  
  
  Final words
&lt;/h3&gt;

&lt;p&gt;Vue has come a long way since it's first release. If you consider Vue 3, it's in a great shape. Many apps are being built, I can say that confidently as many issues are being opened every day, vast participation from developers in github discussions etc.IMO, &lt;strong&gt;&lt;code&gt;The Vue ecosystem&lt;/code&gt;&lt;/strong&gt; is fairly complete. I claim it because I'm a regular consumer of the ecosystem. Many React developers argue that vue files look bloated in comparision to react, I request them to use Vue 3 and re-consider their opinion. They also argue that it's comparatively slow and the DX is really bad, again I request them to try the new tooling. IMO the word &lt;strong&gt;&lt;code&gt;community&lt;/code&gt;&lt;/strong&gt; is very broad, it doesn't only mean maintainers, contributors and developers. &lt;strong&gt;Companies&lt;/strong&gt; who use these frameworks and the &lt;strong&gt;authroties&lt;/strong&gt; who decide what to use are also a part of the same community. A piece of software will only grow and become robust when more companies use them and decide to train their developers to use the same. By doing this they can help the framework grow while producing great trained engineers. So I request new startups, companies to consider &lt;strong&gt;&lt;code&gt;Vue&lt;/code&gt;&lt;/strong&gt; as your next frontend framework to build your product, and by doing so you'll be helping a framework grow and community too. &lt;/p&gt;

&lt;p&gt;I know that many points were missed, but this was just my opinion and I tried to convey this with least no. of points, please comment your siggestions. Thanks for reading ✌️. Peace ☮️&lt;/p&gt;

&lt;p&gt;published in my &lt;a href="https://sambitsahoo.com/blog/opinions-on-the-vue-ecosystem.html"&gt;blog&lt;/a&gt; &lt;/p&gt;

</description>
      <category>vue</category>
      <category>ecosystem</category>
      <category>vite</category>
      <category>opinions</category>
    </item>
    <item>
      <title>State of State management in Vue</title>
      <dc:creator>sambit sahoo</dc:creator>
      <pubDate>Wed, 14 Jul 2021 03:07:23 +0000</pubDate>
      <link>https://dev.to/sambitsahoojs/state-of-state-management-in-vue-2h8i</link>
      <guid>https://dev.to/sambitsahoojs/state-of-state-management-in-vue-2h8i</guid>
      <description>&lt;p&gt;While developing a middle to large scale project, you'll need some kind of global state down the road and to organise and manage the state you may go for some state management library. If we compare the current state management libraries across various front-end frameworks, there are multiple options to choose from. Every library is built upon a specific philosophy to solve a specific problem. TBH I think it should be pattern instead of philosophy. Among these patterns the &lt;strong&gt;Flux&lt;/strong&gt; pattern/architecture is quite common and has been implemented in &lt;code&gt;Vuex&lt;/code&gt; and &lt;code&gt;Redux&lt;/code&gt;, and both of them are quite popular in their framework scope. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;Vuex&lt;/code&gt; is the preferred and go to state management setup while working with Vue applications. It's actively maintained by the Vue core team and the major &lt;code&gt;v4&lt;/code&gt; of the library just went stable a few months ago. If we look from the &lt;code&gt;Flux&lt;/code&gt; point of view I think vuex implements the pattern as effectively as possible and they also did a great job with the API. I mentioned &lt;strong&gt;as effectively as possible&lt;/strong&gt; because &lt;code&gt;Flux&lt;/code&gt; by design brings some limitations and same goes for &lt;strong&gt;vuex&lt;/strong&gt; too. Let's have a look at the current limitations with &lt;strong&gt;Vuex&lt;/strong&gt; that I faced frequently&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Typescript&lt;/strong&gt; support&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a quite common issue which many developers face. Some might say it's a trivial issue but I feel that DX should be good regardless of the language and it should be definitely good when there is scope for improvements. Let's have a brief look at the issue.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// in store.ts&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;store&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;createStore&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
    &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;mutations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// types will be inferred&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;getters&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;doubled&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;state&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// types will be inferred&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vue"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- in component.vue --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;computed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;mapGetters&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;doubled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;doubled&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// types will not be inferred&lt;/span&gt;
    &lt;span class="p"&gt;}),&lt;/span&gt;
    &lt;span class="nx"&gt;getDoubled&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getters&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;doubled&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// specifying return type&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without specifying the return type, we won't be able to get intellisense from the IDE. This is quite cumbersome while working with &lt;strong&gt;ts&lt;/strong&gt;. There is really no way in vuex to get type inference without complex setup.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mutations and Actions as &lt;strong&gt;string&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While dispatching an action or committing a mutation, there are two approaches as mentioned below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vue"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;mapMutations&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;increament&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;increament&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}),&lt;/span&gt;
    &lt;span class="nx"&gt;inc&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;commit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;increment&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="k"&gt;script&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same goes here too, there is a plenty of room to make mistakes while committing a mutation. We can misspell the mutation/action and boom, there is an error. By design Vuex doesn't allow us to restrict/type the mutation/action and thus making the app more prone to errors and bugs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nested and namespaced modules&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I never liked the concept of namespaced modules. It's really difficult after a certain scale to manage many files i.e. state, mutation, getters, actions etc. for different modules. It's also quite verbose while consuming namespaced modules, I don't like it and most people don't I think. &lt;/p&gt;

&lt;p&gt;There are some of the issues I faced frequently while workng with vuex. Before Vue 3 was released, there wasn't any concrete solution to these above mentioned issues. Vue 3 brought &lt;strong&gt;composition API&lt;/strong&gt; and oh boy, that alone solved most of the issues. &lt;a href="https://pinia.esm.dev/"&gt;Pinia&lt;/a&gt; is an appropriate implementation of the new API for state management and it addresses the issues with vuex quite effectively and offers great DX.&lt;/p&gt;

&lt;p&gt;Pinia takes a very functional approach to write and consume global state in Vue. It's really simple and intuitive to write and read. e.g.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// from pinia docs&lt;/span&gt;
&lt;span class="c1"&gt;// in ts types will be inferred automatically&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;defineStore&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pinia&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;useTodoStore&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;defineStore&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;todos&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="cm"&gt;/** @type {{ text: string, id: number, isFinished: boolean }[]} */&lt;/span&gt; &lt;span class="c1"&gt;// for js files&lt;/span&gt;
    &lt;span class="na"&gt;todos&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
  &lt;span class="p"&gt;}),&lt;/span&gt;
  &lt;span class="na"&gt;getters&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;finishedTodos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// autocompletion! ✨&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;todos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;todo&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;todo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;isFinished&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="nx"&gt;unfinishedTodos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;todos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;todo&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;todo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;isFinished&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;actions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// any amount of arguments, return a promise or not&lt;/span&gt;
    &lt;span class="nx"&gt;addTodo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// you can directly mutate the state&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;todos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;nextId&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;isFinished&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to consume just call the function, this can be also called inside normal ts/js files&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;  &lt;span class="nx"&gt;setup&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;finishedTodos&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useTodoStore&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// full type support&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The functional approach allows IDEs to provide rich intellisense and it's also easier to work with. There is also official devtools support and from my experience that works great. The API is very similar to &lt;strong&gt;Vuex 5&lt;/strong&gt; as it was designed to test a proposal for the same. Learn more about pinia &lt;a href="https://pinia.esm.dev/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now we come to the question do we really need a state management library ? With the new composition API it's pretty easy to achieve the same results with just a few lines of code. Let's see how. Just a disclaimer, this won't provide the DX and reliability of libraries like &lt;strong&gt;pinia&lt;/strong&gt; as a lot goes into writing a library. This is one of the many approaches that can possibly fulfill the needs.&lt;/p&gt;

&lt;p&gt;We'll be using Vue 3's &lt;strong&gt;provide/inject&lt;/strong&gt; API and due to composition API, a global provider can be reactive and can be watched for changes as well. Let's see how&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// from furikaeru&lt;/span&gt;
&lt;span class="c1"&gt;//types&lt;/span&gt;
&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;AlertAPI&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="na"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Alert&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;alerts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ComputedRef&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Alert&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;AlertKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;InjectionKey&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;AlertAPI&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Symbol&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;alerts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Alert&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;([]);&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getAlerts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;computed&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;alerts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Alert&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;icon&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;id&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;success&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;danger&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;warning&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;setAlerts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Alert&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;alerts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;find&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;alerts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="nx"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;alerts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;alerts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shift&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;removeAlert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;alertIndex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;alerts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;findIndex&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;alertIndex&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;alerts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;splice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;alertIndex&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;useAlert&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;inject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;AlertKey&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;AlertAPI&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As we can see above, the &lt;strong&gt;useAlert&lt;/strong&gt; composable returns the &lt;strong&gt;reactive&lt;/strong&gt; alert state and some methods to mutate it. The methods can also be promises too. The reactive instance is being provided to the app instance and can be injected with the composable. This is being used in production in &lt;a href="https://furikaeru.sambitsahoo.com"&gt;Furikaeru&lt;/a&gt; and works like a charm. This can be extended to provide many functionalities and sky is the limit for improvements.&lt;/p&gt;

&lt;p&gt;I like the way &lt;strong&gt;Vue&lt;/strong&gt; is moving towards a functional style of writing apps and it's really great. Thanks for reading. Peace 💚  &lt;/p&gt;

</description>
      <category>vue</category>
      <category>vuex</category>
      <category>redux</category>
      <category>compositionapi</category>
    </item>
    <item>
      <title>Paytm payments for serverless websites.</title>
      <dc:creator>sambit sahoo</dc:creator>
      <pubDate>Mon, 17 Aug 2020 07:51:30 +0000</pubDate>
      <link>https://dev.to/sambitsahoojs/paytm-payments-for-serverless-websites-2n6m</link>
      <guid>https://dev.to/sambitsahoojs/paytm-payments-for-serverless-websites-2n6m</guid>
      <description>&lt;h2&gt;
  
  
  Paytm-Netlify-Lambda 🚀
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://paytm.com"&gt;Paytm&lt;/a&gt; payments integration for serverless JAMstack websites using &lt;a href="https://www.netlify.com/products/functions/"&gt;Netlify lambda&lt;/a&gt; functions. This repo will save you from the nightmare of setting up a serverless payment integration from scratch.&lt;/p&gt;

&lt;p&gt;🚀 It's live &lt;a href="https://tiaamo.com"&gt;here&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;💥 GitHub repo is &lt;a href="https://github.com/soulsam480/paytm-netlify-lambda"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  📑 Table of Contents
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🔰 Getting Started
&lt;/li&gt;
&lt;li&gt;📐 Setup

&lt;ul&gt;
&lt;li&gt;🌱 Basic Setup
&lt;/li&gt;
&lt;li&gt;🔥 Usage with Firebase
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;🗜 Integration
&lt;/li&gt;
&lt;li&gt;📓 Notes

&lt;ul&gt;
&lt;li&gt;🤓 How it Works ?
&lt;/li&gt;
&lt;li&gt;🌋 Errors
&lt;/li&gt;
&lt;li&gt;📔 References
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Getting Started
&lt;/h3&gt;

&lt;p&gt;To get started clone this repo.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone git@github.com:soulsam480/paytm-netlify-lambda.git

cd paytm-netlify-lambda

npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To serve the lambda functions locally we can run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But before that we have to setup the functions otherwise there will be errors!!&lt;/p&gt;

&lt;h3&gt;
  
  
  Setup
&lt;/h3&gt;

&lt;p&gt;Open the repo in your favorite text-editor and the file structure will be like this&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;config&lt;/li&gt;
&lt;li&gt;dist&lt;/li&gt;
&lt;li&gt;src

&lt;ul&gt;
&lt;li&gt;cred&lt;/li&gt;
&lt;li&gt;paytm

&lt;ul&gt;
&lt;li&gt;checksum.js&lt;/li&gt;
&lt;li&gt;crypt.js&lt;/li&gt;
&lt;li&gt;paytm_config.js&lt;/li&gt;
&lt;li&gt;paytmChecksum.js&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;payConf.js&lt;/li&gt;
&lt;li&gt;payment.js&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Webpack cofig sits inside the config folder. All our functions will be build into the dist folder. So it's good if we don't touch that folder.&lt;/p&gt;

&lt;h4&gt;
  
  
  Basic Setup
&lt;/h4&gt;

&lt;p&gt;Open paytm_config.js inside the paytm folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = {
  paytm_config: {
    PAYTM_ENVIRONMENT: "TEST", //possible values:  TEST | PROD
    MID: " Your MID", // Get it From https://dashboard.paytm.com/next/apikeys use Test id for test purpose and Production id for Production Purpose
    WEBSITE: "WEBSTAGING", // USE WEBSTAGING for testing, You Will get it for Production here https://dashboard.paytm.com/next/apikeys
    CHANNEL_ID: "WEB", // Use WEB for Desktop Website and WAP for Mobile Website
    INDUSTRY_TYPE_ID: "Retail", // Use Retail for Testing, For Production You Can Get it from here https://dashboard.paytm.com/next/apikeys
    MERCHANT_KEY: " Your MERCHANT_KEY", // Get it From https://dashboard.paytm.com/next/apikeys use Test key for test purpose and Production key for Production Purpose
    CALLBACK_URL:
      "https://your_unique_site_id.netlify.app/.netlify/functions/payConf", // Modify and Use this url for verifying payment
  },
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change the MID and Merchant Key to your paytm merchant account. The callback url will be updated after you have deployed these functions to netlify. So we will leave it as it is. Again if you wish to change the parameters for production build, the respective fields will be changed with the production credentials.&lt;/p&gt;

&lt;p&gt;If you don't wish to use firebase for order validation and confirmation, you can stop here and remove firebase completely from the project. If you wish to use, let's move in to the next step.&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage with Firebase
&lt;/h4&gt;

&lt;p&gt;We will use &lt;a href="//npmjs.com/package/firebase-admin"&gt;firebase-admin&lt;/a&gt; sdk for nodejs to access admin privilages. With firebase admin running on server we can perform CRUD operations on realtime database easily.&lt;/p&gt;

&lt;p&gt;To setup admin sdk you need a firebase service account. To get yourself one open you firebase admin dashboard and then project settings &amp;gt; service accounts. Create one for your project and download the credentials in json. Then open src/cred/authKey.js . Add the credentials in their respective places.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = {
  authKey: {
    type: "service_account",
    project_id: "Your Project id",
    private_key_id: " Your PRIVATE_KEY_ID",
    private_key: "Your PRIVATE_KEY",
    client_email: "Your client email",
    client_id: "Your client id",
    auth_uri: "your auth uri",
    token_uri: "auth token uri",
    auth_provider_x509_cert_url: "cert url provider",
    client_x509_cert_url: " your CERT_URL",
  },
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then open src/payConf.js and add your database URL. With this the setup is complete.&lt;/p&gt;

&lt;p&gt;After each successful payment firebase-admin will create an order inside&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Orders/dd_mm_yy(current date)/orderId
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this could be further used to verify an proceed with the payment. This is the only advantage of using firebase inside this project. If you don't wish to verify your orders, you can drop firebase completely and move on with the basic approach.&lt;/p&gt;

&lt;p&gt;As the setup is complete you can deploy this project to netlify by pushing the code into an it repo. The instruction on how to deploy from a git repo is &lt;a href="https://docs.netlify.com/configure-builds/get-started/#basic-build-settings"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are two methods to integrate these functions to your project.&lt;/p&gt;

&lt;h3&gt;
  
  
  Integration
&lt;/h3&gt;

&lt;p&gt;This method makes a POST request to the api and creates and submits the form clent-side in browser. &lt;br&gt;
Let's move further for a good explanation.&lt;/p&gt;

&lt;p&gt;To make API calls you have to pass these parameters inside the body of your post request. Here is an example using axios.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;axios({
        method: "post",
        url:
          "https://your_unique_netliy_appname.netlify.app/.netlify/functions/payment",
        data: {
          amount: payment amount, //must be an integer Mandatory
          name: "customer_name", // _ is allowed.no space allowed inbetween. ex. Sambit_sahoo
          email: "customer_email", //valid customer email
          orderid: "Order_id", //mandatory.no space allowed inbetween ex. OD123231 or OD_12324
          mobile: "customer_mobileno",
        },
        headers: {
          "Content-Type": "application/json",
        },
      })
        .then(async (res) =&amp;gt; {
          console.log(res);
          const params = res.data.params;
          params["CHECKSUMHASH"] = res.data.checksum;

          //Here the helper function post.js creates the from api response and submits.

          post({
            action: res.data.action,
            target: "_self",
            params: params,
          });
        })
        .catch((err) =&amp;gt; {
          window.alert(err);
        });

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is the helper function which creates and submits the form client side inside browser.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//This plugin is used to perform form action request from jsvascript.
//This is derived from https://github.com/jisaacks/react-post/blob/master/src/post.js
function isDate(val) {
  // Cross realm comptatible
  return Object.prototype.toString.call(val) === "[object Date]";
}

function isObj(val) {
  return typeof val === "object";
}

export function stringifyValue(val) {
  if (isObj(val) &amp;amp;&amp;amp; !isDate(val)) {
    return JSON.stringify(val);
  } else {
    return val;
  }
}

function buildForm({ action, target, params }) {
  const form = document.createElement("form");
  form.setAttribute("method", "post");
  form.setAttribute("action", action);
  form.setAttribute("target", target);

  Object.keys(params).forEach((key) =&amp;gt; {
    const input = document.createElement("input");
    input.setAttribute("type", "hidden");
    input.setAttribute("name", key);
    input.setAttribute("value", stringifyValue(params[key]));
    form.appendChild(input);
  });

  return form;
}

export default function post(details) {
  const form = buildForm(details);
  console.log(form);
  document.body.appendChild(form);
  form.submit();
  form.remove();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Again after a successful payment you will be redirected to the page sent from the payment confirmation function i.e. payConf.js. &lt;/p&gt;

&lt;p&gt;To change your response URLs &lt;br&gt;
go to line 89 for payment success URL, line 93 and 96 for Failure URL.&lt;/p&gt;

&lt;h3&gt;
  
  
  Notes
&lt;/h3&gt;

&lt;p&gt;This project is an wrapper and improvement over the project created by &lt;a href="https://github.com/imlolman"&gt;Satyam&lt;/a&gt;. You can find the github repo  &lt;a href="https://github.com/imlolman/Paytm-Payment-Gateway-Integration-using-Google-Cloud-Function"&gt;here&lt;/a&gt;. He implemented this approach using firebase cloud functions.&lt;/p&gt;

&lt;h4&gt;
  
  
  How it Works
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://docs.netlify.com/functions/overview/"&gt;Netlify functions&lt;/a&gt; are AWS lambda functions which return a callback for an API request. I originally intended to implement this approach without &lt;a href="https://expressjs.com/"&gt;experess.js&lt;/a&gt;. But I ran into many errors and couldn't figure a way out. So i went with the Express way 😂. &lt;/p&gt;

&lt;p&gt;When you hit the payment endpoint with the data inside a POST request, it generates a checksum for the provided orderid using paytm's generate checksum logic. After successful generation it responds with the credentials for the payment page. The response from the promise by axios is used to create the HTML form by the elper function post.js and submitted immediately.&lt;/p&gt;

&lt;p&gt;After Successful payment, your callback function which is src/payConf.js verifies the status of the transaction from paytm transaction status api through an unique signature. after successful verification, the callback function creates an order on your firebase database and responds with your payment succes page url.&lt;/p&gt;

&lt;h4&gt;
  
  
  Errors
&lt;/h4&gt;

&lt;p&gt;I have handled most of the errors 😌. Still there is always a bug 🐛. If you ran into any issues try using console.log() to find and fix the error by using google. If you don't find any way reach me &lt;a href="//mailto:soulsam480@hotmail.com"&gt;here&lt;/a&gt;. I'll be happy to help 👏🏼👏🏼 !!&lt;/p&gt;

&lt;h4&gt;
  
  
  References
&lt;/h4&gt;

&lt;p&gt;Links to some of the resources that helped me create this project.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/imlolman/Paytm-Payment-Gateway-Integration-using-Google-Cloud-Function"&gt;Satyam's Repo&lt;/a&gt; 👏🏼&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://medium.com/imlolman/integrate-paytm-payment-gateway-for-static-hosted-website-using-google-cloud-function-4c78385cda9f"&gt;His post on his approach&lt;/a&gt; 👌🏼&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/netlify/netlify-lambda"&gt;Netlify Lambda Repo&lt;/a&gt; For improvements and bugs. 🐛&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/dougmoscrop/serverless-http"&gt;Serverless HTTP&lt;/a&gt; For more bugs 🐛🐛&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.netlify.com/functions/overview/"&gt;Netlify Functions&lt;/a&gt; For reference 🎇&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://developer.paytm.com/docs/v1/payment-gateway/"&gt;Paytm Documentation&lt;/a&gt; For more reference 🎇🎇&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm not good at writing documentations. So if i missed something and you ran into an unknown issue please reach me on&lt;/p&gt;

&lt;p&gt;&lt;a href="//mailto:soulsam480@hotmail.com"&gt;mail&lt;/a&gt; 📧 / &lt;a href="https://twitter.com/sambitsahoojs"&gt;twitter&lt;/a&gt; 🕊 / &lt;a href="https://instagram.com/sambitsahoo.js"&gt;instagram&lt;/a&gt; 🖼&lt;/p&gt;

&lt;p&gt;Thank You! ✌🏼&lt;/p&gt;

</description>
      <category>jamstack</category>
      <category>firebase</category>
      <category>netlify</category>
      <category>serveless</category>
    </item>
    <item>
      <title>The best news PWA just got better !!</title>
      <dc:creator>sambit sahoo</dc:creator>
      <pubDate>Mon, 06 Apr 2020 16:32:27 +0000</pubDate>
      <link>https://dev.to/sambitsahoojs/the-best-news-pwa-just-got-better-3egp</link>
      <guid>https://dev.to/sambitsahoojs/the-best-news-pwa-just-got-better-3egp</guid>
      <description>&lt;h4&gt;
  
  
  What is Headliner ?
&lt;/h4&gt;

&lt;p&gt;It's a progressive web app(PWA) which collects news articles from API and RSS Feeds. &lt;a href="https://headliner.cf"&gt;visit Headliner&lt;/a&gt;. The category pages are RSS news aggregators that collect and show news articles from various news providers.&lt;/p&gt;

&lt;h4&gt;
  
  
  How it does what it does?
&lt;/h4&gt;

&lt;h5&gt;
  
  
  Headliner&amp;gt;
&lt;/h5&gt;

&lt;p&gt;It uses the javascript &lt;strong&gt;fetch()&lt;/strong&gt; API to get information from an API endpoint. It makes async requests instead of using the traditional XMLHttp request. The information from the API gets transformed into a &lt;strong&gt;JSON&lt;/strong&gt; object. As the news articles come as a js array it's easy to map them to HTML elements using js array method &lt;strong&gt;map()&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetch(url)
      .then(resp =&amp;gt; resp.json()) // Transform the data into json
      .then(function (data) {
        let news = data.articles;
        return news.map(item =&amp;gt; {
          let li = createNode("li"),
              h4 = createNode("h3");
              p2 = createNode("p");
              img = createNode("img");
              link = createNode("a");
              line = createNode("span");
              link2 = createNode("a")
              link3 = createNode("a")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The mapped elements with the information get injected into the browser DOM using the javascript DOM API &lt;strong&gt;CreateElement()&lt;/strong&gt; to create the elements and &lt;strong&gt;appendChild()&lt;/strong&gt; to append them to Browser DOM. It's done by two js functions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function createNode(element) {
          return document.createElement(element); // Create the type of element you pass in the parameters
        }

 function append(parent, el) {
          return parent.appendChild(el); // Append the second parameter(element) to the first one
        }

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Category Pages&amp;gt;
&lt;/h4&gt;

&lt;p&gt;Category pages use &lt;a href="https://github.com/sekando/feednami-client"&gt;Feddnami&lt;/a&gt; A lightweight Javascript client for downloading RSS/Atom feeds. After downloading the RSS feeds it uses the same method as headliner to create and append elements to browser DOM. 😎.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;feednami.load(url, function(result) {
          if (result.error) {
            console.log(result.error);
          } else {
            var entries = result.feed.entries;
            for (var i = 0; i &amp;lt; entries.length; i++) {
              var entry = entries[i];
              console.dir(entry);
              return entries.map(entry =&amp;gt; {
                console.log(entry.link)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Features:
&lt;/h3&gt;

&lt;h4&gt;
  
  
  News Categories 📰
&lt;/h4&gt;

&lt;p&gt;Headliner has news articles categorized in 3 main streams. Which are General News, Technology, and Lifestyle. This solution makes the user experience smooth by eliminating the dilemma of choosing from a plethora of categories. In each of the main category pages, there is an explore option in the feature menu to read articles from other news providers.&lt;/p&gt;

&lt;h4&gt;
  
  
  Blazing fast load time 🚀
&lt;/h4&gt;

&lt;p&gt;With 2s 😎 of loading time as evaluated on Lighthouse, headliner loads blazing fast. In very slow networks or when the device is offline, it shows an offline page using the PWA service worker. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--34CNl1r_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gfcakyzxpd5a93ks0g7g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--34CNl1r_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gfcakyzxpd5a93ks0g7g.png" alt="Lighthouse Test"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  PWA 🔥 🚀
&lt;/h4&gt;

&lt;p&gt;According to the PWA standards, this uses the &lt;strong&gt;manifest.json&lt;/strong&gt; and &lt;strong&gt;serviceworker&lt;/strong&gt;. The service worker gets installed on load and the custom add to home screen prompt is shown&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; //the code for custom add to home screen prompt
  var deferredPrompt;

  window.addEventListener("beforeinstallprompt", function (e) {
    // Prevent Chrome 67 and earlier from automatically showing the prompt
    e.preventDefault();
    // Stash the event so it can be triggered later.
    deferredPrompt = e;

    showAddToHomeScreen();
  });

  function showAddToHomeScreen() {
    var a2hsBtn = document.querySelector(".ad2hs-prompt");

    a2hsBtn.style.display = "block";

    document.getElementById("add").addEventListener("click", addToHomeScreen);
  }
  function addToHomeScreen() {
    var a2hsBtn = document.querySelector(".ad2hs-prompt"); // hide our user interface that shows our A2HS button
    a2hsBtn.style.display = "none"; // Show the prompt
    deferredPrompt.prompt(); // Wait for the user to respond to the prompt
    deferredPrompt.userChoice.then(function (choiceResult) {
      if (choiceResult.outcome === "accepted") {
        console.log("User accepted the A2HS prompt");
      } else {
        a2hsBtn.style.display = "none"; // Show the prompt

        console.log("User dismissed the A2HS prompt");
      }

      deferredPrompt = null;
    });
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Accepting which will let users install it as a PWA. Headiner also runs offline. It shows an &lt;strong&gt;offline.html&lt;/strong&gt; page when the internet is shut off.&lt;/p&gt;

&lt;h4&gt;
  
  
  Dark Mode 🔥
&lt;/h4&gt;

&lt;p&gt;Yes, Headliner has it's own dedicated dark mode. By one toggle at the top it switches to dark mode for better reading comfort.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; const body = document.body;
  function dToggle() {
    body.classList.toggle("darkmode");
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Social Sharing 💬
&lt;/h4&gt;

&lt;p&gt;Headliner also lets users to share articles on various social networking platforms like whatsapp, facebook etc. It uses the web API &lt;strong&gt;navigator.share()&lt;/strong&gt; which invokes the native sharing dialouge.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (navigator.share) {
navigator.share(
{title:'" + entry.title + "',
text:'shared from Headliner',
url: '" + entry.url + "',
}).then(() =&amp;gt;
console.log('Successful share')).catch((error) =&amp;gt; 
console.log('Error sharing', error));}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Thank You.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://headliner.cf"&gt;Headliner&lt;/a&gt; is developed as a hobby project of mine. This is not monetized or commercialized as all the news articles are the sole property of their providers. This as an Open Source project and I'm inviting all to suggest and contribute to the app.  Feel free to fork the &lt;a href="https://github.com/soulsam480/headliner"&gt;Github Repo&lt;/a&gt; 😄 ✌️. for any help or suggestions drop a &lt;a href="//mailto:soulsam480@gmail.com"&gt;mail&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>javascript</category>
      <category>pwa</category>
      <category>webdev</category>
    </item>
    <item>
      <title>A learning timeline for python beginners.</title>
      <dc:creator>sambit sahoo</dc:creator>
      <pubDate>Fri, 27 Dec 2019 15:37:27 +0000</pubDate>
      <link>https://dev.to/sambitsahoojs/a-learning-timeline-for-python-beginners-22b9</link>
      <guid>https://dev.to/sambitsahoojs/a-learning-timeline-for-python-beginners-22b9</guid>
      <description>&lt;p&gt;Python has been making headlines since it's advent. It's everywhere nowadays. The simplicity to write complex code and the parallel learning curve has made it the most sought after programming language. Its application can be extended to various domains such as Web development, Machine learning, Artificial intelligence and much more.&lt;/p&gt;

&lt;p&gt;Python is extremely easy to learn and for people new to programming it's a piece of cake. The demand for good python programmers is getting skyrocketed. This is the high time to learn python and achieve expertise.&lt;/p&gt;

&lt;p&gt;After mastering the basic concepts you can choose any of the domains of python programming which are Machine Learning, Artificial Intelligence, and Data Science. These are the most popular domains but the application of python is extended to many fields.&lt;/p&gt;

&lt;p&gt;I'm also a beginner of python. I have started learning python just a while ago. Javascript is my favorite language and I have been using it since the beginning. The simplicity and functionality of python forced me to try this out. Here is my timeline for getting started with programming in python. I will divide this into two categories of readers who are&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;with a legit setup (Laptop etc.)&lt;/li&gt;
&lt;li&gt;Learning with Smartphones.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Guys with Smartphones (we are on the same boat ☺️☺️).&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Programming on a smartphone is troublesome but it's still intuitive. There are many android apps that offer very functional features to practice coding. If we can tailor a timeline for learning and practicing code on smartphones, the whole learning process will be a piece of cake. For every beginner the only factor which plays a big role is CONSISTENCY. If you are not consistent, you won't go anywhere with programming. There will be times when using a smartphone for coding will demotivate you but if you march on ahead with interest, you could gain a lot of knowledge.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;The Timeline&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;When we try to learn a new language, it's always better to learn the basics and practice thoroughly to get a good command over the basics. Basics will become the foundation for more complex and advanced programming in the future.&lt;/li&gt;
&lt;li&gt;Android users download &lt;strong&gt;&lt;a href="https://play.google.com/store/apps/details?id=com.sololearn"&gt;Sololearn &lt;/a&gt;.&lt;/strong&gt; Open the app and register using your email id. Move forward to the learn section and from programming languages select Python.&lt;/li&gt;
&lt;li&gt;I prefer sololearn for basics because it focuses on simplicity rather than complex teaching methods. After each lesson, there is a little assignment/question for quick practice for the lesson.&lt;/li&gt;
&lt;li&gt;After completing all the basic concepts from Sololearn, head over to &lt;strong&gt;&lt;a href="https://www.practicepython.org/"&gt;Practice Python&lt;/a&gt;&lt;/strong&gt;  and start doing the beginner assignments. The platform also provides solutions for every assignment so it's easy to perform all the assignments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How to practice:&lt;/strong&gt; Open Sololearn and move to the code section. Click on the plus icon and select python. For doing basic programming this is the best portable platform. After putting all of your code, hit run.&lt;/li&gt;
&lt;li&gt;Get over all the assignments and return back to sololearn. Then continue with the course. As you have a strong command on basics, moving will not be that much hard.&lt;/li&gt;
&lt;li&gt;After you pass through functions, try to build something using all the knowledge you have gathered so far. eg. a calculator, a guessing game, etc.&lt;/li&gt;
&lt;li&gt;Link to an awesome video on youtube by &lt;strong&gt;freecodecamp&lt;/strong&gt; : &lt;strong&gt;&lt;a href="https://www.youtube.com/watch?v=XGf2GcyHPhc"&gt;Learn Python by Building Five Games - Full Course freeCodeCamp.org&lt;/a&gt;&lt;/strong&gt;. Here is a recommendation to some ideas to build something using the knowledge you have gained so far.&lt;/li&gt;
&lt;li&gt;Another video form &lt;strong&gt;freecodecamp&lt;/strong&gt; on youtube : &lt;strong&gt;&lt;a href="https://www.youtube.com/watch?v=rfscVS0vtbw"&gt;Learn python in 4hrs&lt;/a&gt;.&lt;/strong&gt;  for speed learners. Not exactly in 4hrs. but you can complete it in a week if you are determined.&lt;/li&gt;
&lt;li&gt;After completing all the basics and assignments you can move forward to focus on a specific domain on programming with python. You can take on machine learning, AI, Automation, Data Science, Deep Learning Algorithms and etc.&lt;/li&gt;
&lt;li&gt;Best of LUCK!!&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Guys with legit Setups (Fortunate folks!!)
&lt;/h3&gt;

&lt;p&gt;having a laptop or any like device may speed up the process after you pass through the basics. During learning the basics, the experience with smartphones is the same as of setups. I have started programming from a smartphone. Having a setup can also boost the motivation needed to get going with the learning process. The mantra for success is the same as that of the smartphone users which is CONSISTENCY. So, gather up some confidence and let's start.&lt;/p&gt;

&lt;h4&gt;
  
  
  The Timeline
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;As laptop/desktop users have the convenience of running their code in an IDE, it's better to know how to set up the environment for doing the same.&lt;/li&gt;
&lt;li&gt;Head over to &lt;a href="https://www.python.org/downloads/"&gt;&lt;/a&gt;&lt;strong&gt;&lt;a href="https://www.python.org/downloads/"&gt;this link&lt;/a&gt;&lt;/strong&gt; and download python. If you are on windows download the windows release and for mac download the appropriate one.&lt;/li&gt;
&lt;li&gt;After the download is finished hit install. Once the installation gets completed go to python IDLE ( Integrated Development and Learning Environment). This is the place where we will be running our code.
&lt;/li&gt;
&lt;li&gt;For speed learning video lectures have always been the best option. As we are on the setup we can learn and run our code side by side. &lt;/li&gt;
&lt;li&gt;The same video from Freecodecamp : &lt;strong&gt;&lt;a href="https://www.youtube.com/watch?v=rfscVS0vtbw"&gt;Learn python in 4hrs&lt;/a&gt;&lt;/strong&gt; is amazing. The instructor has a very good way of teaching concepts. Download this video to your local machine and start.&lt;/li&gt;
&lt;li&gt;The instructor is using PyCharm as his IDE. He also has a guide for setting up the same environment as his in that video too. Follow that one if you want the same IDE as of him.&lt;/li&gt;
&lt;li&gt;During learning the concepts try manipulating the code on the video and experiment.  You have the setup and you gotta do it !!&lt;/li&gt;
&lt;li&gt;Also start doing assignments from &lt;strong&gt;&lt;a href="https://www.practicepython.org/"&gt;Practice Python&lt;/a&gt;&lt;/strong&gt; and try to find more assignments on google after completing the basic ones. &lt;/li&gt;
&lt;li&gt;Link to an awesome video on youtube by &lt;strong&gt;freecodecamp&lt;/strong&gt; : &lt;strong&gt;&lt;a href="https://www.youtube.com/watch?v=XGf2GcyHPhc"&gt;Learn Python by Building Five Games - Full Course freeCodeCamp.org&lt;/a&gt;&lt;/strong&gt;. Here is a recommendation to some ideas to build something using the knowledge you have gained so far.&lt;/li&gt;
&lt;li&gt;After completing all the basics and assignments you can move forward to focus on a specific domain on programming with python. You can take on machine learning, AI, Automation, Data Science, Deep Learning Algorithms and etc.&lt;/li&gt;
&lt;li&gt;Best of LUCK !!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ending this post by a great Quote &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you are not doing mistakes, you are not learning enough.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Always build something with the knowledge because as long as you will use it, it will only get polished more and more. Thanks for reading. Peace !! 🤘🤘&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
    </item>
    <item>
      <title>My portfolio website.</title>
      <dc:creator>sambit sahoo</dc:creator>
      <pubDate>Fri, 29 Nov 2019 18:26:29 +0000</pubDate>
      <link>https://dev.to/sambitsahoojs/my-portfolio-website-3lmf</link>
      <guid>https://dev.to/sambitsahoojs/my-portfolio-website-3lmf</guid>
      <description>&lt;p&gt;I had came to know of static site generators long ago. There are a lot of very good static site generators for running a blog or a simple portfolio site. But every other generator has it's own set of problems. Jekyll is too complex to start because it needs a base knowledge of ruby. Hugo is very good for speed and performance but it's based on Golang which is not comfortable for beginners.&lt;/p&gt;

&lt;p&gt;After all these research and analysis, i had made up my mind not to go for a static site generator. I'm a beginner developer and i mainly specialize in Javascript. I have started learning Vuejs last year and right now i have a good knowledge and understanding of it. I love to code using Vue because of the simplicity of using components and JSX syntax. It's similar with HTML and learning Vue is too easy as compared to other front end frameworks.&lt;/p&gt;

&lt;p&gt;Recently when i was scrolling through Dev.to articles, i read about Nuxtjs. It's based on Vue and it's so feature rich that it takes vue to another level. I got interested and started googling for static ste generators built on top of Nuxtjs. I found a repository by &lt;a href="https://github.com/code-tribe/nuxt-netlify-cms-starter"&gt;Code-tribe&lt;/a&gt; which was a blog based on Nuxtjs and Netlify cms. Articles are stored as a markdown file inside the blog and because it is based on Nuxtjs, it's rendered server-side which makes it crazy fast and lodes in about 1 second.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s----LWydiS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/npeehd10pcokonac6cec.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s----LWydiS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/npeehd10pcokonac6cec.png" alt="My Portfolio"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I forked the repository and as it's open source i started to work on it. I tweaked some problems and added some features like a more robust navbar and darkmode. My portfolio is based on it and it's currently live on &lt;a href="https://sambitsahoo2.cf"&gt;sambitsahoo2.cf&lt;/a&gt; which is hosted on Netlify.&lt;/p&gt;

&lt;p&gt;In thee process of understanding the code of the original project i learned a lot about Nuxtjs and Netlify cms as the site's back-end is based on it. I have also gone a step forward and converted the site to a Progressive Web App (PWA). The website is a SPA which makes it awesome to work as a PWA. The site offers an average load time of around 2 seconds which is also awesome for good reader experience.&lt;/p&gt;

&lt;p&gt;I'm going to merge my &lt;a href="https://soulsam480.github.io/headliner"&gt;Headliner&lt;/a&gt; project with my portfolio so that the site can offer more value.&lt;/p&gt;

&lt;p&gt;Thank You for reading. Peace!!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>showdev</category>
      <category>webdev</category>
      <category>nuxt</category>
    </item>
    <item>
      <title>A PWA to fetch news headlines from news APIs. </title>
      <dc:creator>sambit sahoo</dc:creator>
      <pubDate>Sun, 10 Nov 2019 05:17:25 +0000</pubDate>
      <link>https://dev.to/sambitsahoojs/a-pwa-to-fetch-news-headlines-from-news-apis-38ed</link>
      <guid>https://dev.to/sambitsahoojs/a-pwa-to-fetch-news-headlines-from-news-apis-38ed</guid>
      <description>&lt;p&gt;I have created a progressive Web app for fetching news headlines from two APIs which are NewsApi.org and Newyork times API. &lt;/p&gt;

&lt;p&gt;I have used javascript fetch(url) method to hit the Api endpoint. &lt;br&gt;
The response comes as a json object. The news articles from the json object are then converted to an javascript object. The javascript object then gets mapped to an html unordered list to show the news articles as distinct posts. &lt;/p&gt;

&lt;p&gt;In the second update I have added the feature to show images received from the APIs. &lt;/p&gt;

&lt;p&gt;I have created a javascript function createNode() to create html elements &lt;br&gt;
and the data gets mapped using javascript map function. &lt;/p&gt;

&lt;p&gt;Today in the third update i have aaded a button to the actual news article from the news provider.&lt;/p&gt;

&lt;p&gt;Tge link to the website is &lt;/p&gt;

&lt;p&gt;&lt;a href="https://soulsam480.github.io/headliner/index.html"&gt;https://soulsam480.github.io/headliner/index.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Visit the site and the github repo is available on&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/soulsam480/headliner"&gt;https://github.com/soulsam480/headliner&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>career</category>
    </item>
  </channel>
</rss>
