<?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: Christopher Daniel</title>
    <description>The latest articles on DEV Community by Christopher Daniel (@chris_daniel).</description>
    <link>https://dev.to/chris_daniel</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%2F132102%2F3d39af8a-0b69-460a-95e7-bb17356d7718.png</url>
      <title>DEV Community: Christopher Daniel</title>
      <link>https://dev.to/chris_daniel</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chris_daniel"/>
    <language>en</language>
    <item>
      <title>Improve GraphQl productivity with Altair GraphQl  client</title>
      <dc:creator>Christopher Daniel</dc:creator>
      <pubDate>Mon, 29 Mar 2021 14:28:52 +0000</pubDate>
      <link>https://dev.to/chris_daniel/improve-graphql-productivity-with-altair-graphql-client-192l</link>
      <guid>https://dev.to/chris_daniel/improve-graphql-productivity-with-altair-graphql-client-192l</guid>
      <description>&lt;p&gt;There are several graphql clients available right now for querying and debugging graphql endpoints like graphiql, graphql playground and even postman with beta support.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://altair.sirmuel.design/" rel="noopener noreferrer"&gt;Altair graphql client&lt;/a&gt; is a feature rich graphql client with simple and user friendly UI like postman. In this post I will share some cool altair tricks. For more you can visit &lt;a href="https://altair.sirmuel.design/" rel="noopener noreferrer"&gt;https://altair.sirmuel.design/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Generate query from schema Doc&lt;/strong&gt;&lt;br&gt;
When testing the queries after development, we often have to enter all the fields the query returns to test all. Using generate queries feature, you can create all fields and subfields to a certain depth. The depth can be set to minimum 3 for showing root fields of the query, Increase that to display more values. For example I have set to 6 to show query depth of 4&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0upqmigr9ws7irzi44hn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0upqmigr9ws7irzi44hn.png" alt="Settings"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To auto fill the query open the doc window and click add query button for any query. &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzug2qxlj7sgiu43y9stp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzug2qxlj7sgiu43y9stp.png" alt="Add query option"&gt;&lt;/a&gt;. That's it you will have pre generated query where you can fill the arguments and send.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Collections&lt;/strong&gt;&lt;br&gt;
Collections, is a great feature when you want to share your queries or backup and restore your work. Whenever you have completed your API, press the save button on url bar to save to existing collection or a new collection &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg280uhn0fzj8nlo4og99.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg280uhn0fzj8nlo4og99.png" alt="Save query"&gt;&lt;/a&gt; &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkukh20i2j9xaj9f4d44v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkukh20i2j9xaj9f4d44v.png" alt="Collection form"&gt;&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;You can use collection window to switch between collections, load query/mutation from collection, export and import collections.&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgfyj5dv33mdfkv5i9viw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgfyj5dv33mdfkv5i9viw.png" alt="Collection window"&gt;&lt;/a&gt;. Collections store your variables and headers also&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Environments&lt;/strong&gt;&lt;br&gt;
This is my favorite feature. You can create any number of environments and easily switch between them. When you have to test the queries in multiple env like your local, dev, staging, production etc.,you can create multiple env and just by using env switcher you can update the variable factors like headers, variables, arguments and  url in environments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Creating a environment&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
Click on the environment switcher and click on the last option environments to create a new environment. You have options to create env vars in global scope as well as environment scope. create new environment and declare all your env vars and save the form. &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F38q1vuiw6kc0kum8vu3q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F38q1vuiw6kc0kum8vu3q.png" alt="Env Switcher"&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Every env var is represented by &lt;code&gt;{{env_var_code}}&lt;/code&gt; format. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;env var in url&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
Enter your url as &lt;code&gt;{{url}}/graphql&lt;/code&gt; in url bar and create a environment variable as url and provide environment url.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;env var in headers&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
The common usage would be Bearer token or other auth token,&lt;br&gt;
&lt;code&gt;Authorization -&amp;gt; Bearer {{token}}&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;env var in varibales&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
You cannot use env vars directly in query so you can replace with graphql variables and you can enter the env var expression there. for example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"cartId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"{{cartId}}"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>graphql</category>
      <category>productivity</category>
      <category>tooling</category>
    </item>
    <item>
      <title>Portfolio - Digital Ocean Hackathon Submission</title>
      <dc:creator>Christopher Daniel</dc:creator>
      <pubDate>Mon, 11 Jan 2021 05:45:56 +0000</pubDate>
      <link>https://dev.to/chris_daniel/portfolio-digital-ocean-hackathon-submission-4h6f</link>
      <guid>https://dev.to/chris_daniel/portfolio-digital-ocean-hackathon-submission-4h6f</guid>
      <description>&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;I have built my portfolio with Yew framework. Yew Framework❗ heard of it?🤔 It is a frontend framework written in Rust that is similar to React. It has a virtual dom and uses a diffing algorithm to do essential renders like React. It is compiled to wasm and bundled by webpack. &lt;/p&gt;

&lt;h3&gt;
  
  
  Category Submission:
&lt;/h3&gt;

&lt;p&gt;Personal Site/Portfolio&lt;/p&gt;

&lt;h3&gt;
  
  
  App Link
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://chrisdaniel.dev/"&gt;Portolio Website&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Screenshots
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KPCa7hF6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/d6h0ljv48l69h4gsk34v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KPCa7hF6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/d6h0ljv48l69h4gsk34v.png" alt="Home Page"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--98QcY-LG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gq4bc3a9di87vtzh1jh2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--98QcY-LG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gq4bc3a9di87vtzh1jh2.png" alt="Skills Page"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1BCyUw0---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vxs3yaduofg4o6mo49mf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1BCyUw0---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vxs3yaduofg4o6mo49mf.png" alt="Mobile Works Page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Description
&lt;/h3&gt;

&lt;p&gt;Portfolio website built in digital ocean app platform using docker and yew framework&lt;/p&gt;

&lt;h3&gt;
  
  
  Link to Source Code
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/dani97/yew-portfolio"&gt;Yew Portolio&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Permissive License
&lt;/h3&gt;

&lt;p&gt;MIT&lt;/p&gt;

&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;I wanted to try web assembly and rust for a long time. I was lacking motivation to learn and rust had a insane learning curve 😁.Also I wanted to build a portfolio for a long time. For portfolio, my first choice is next js SSG but it is not very challenging, I started building it and eventually got bored and dropped the idea. I want to challenge myself to learn WASM, rust🦀 and I believe portfolio could be the first step to try it out💪.&lt;/p&gt;

&lt;h3&gt;
  
  
  How I built it
&lt;/h3&gt;

&lt;p&gt;My portfolio is a static site, but to generate static files, I need both rust and node js. Pretty complex to deploy  😅, but digital ocean app platform had a special option. You can deploy app with a docker container😲. It's been very long since I last wrote a Dockerfile and now it is a ideal situation for me to refresh😉 .I started building it and the only problem is only one week left to complete my submission. Let us see how I finished the app from the first link in the series, if you have not done yet.&lt;/p&gt;

&lt;h3&gt;
  
  
  Additional Resources/Info
&lt;/h3&gt;

&lt;p&gt;Cover image from &lt;a href="https://unsplash.com/photos/JJD1i9YO7w8?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditShareLink"&gt;unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dohackathon</category>
      <category>webassembly</category>
      <category>rust</category>
      <category>yew</category>
    </item>
    <item>
      <title>Portfolio - Key Takes</title>
      <dc:creator>Christopher Daniel</dc:creator>
      <pubDate>Mon, 11 Jan 2021 05:45:26 +0000</pubDate>
      <link>https://dev.to/chris_daniel/portfolio-key-takes-1lkk</link>
      <guid>https://dev.to/chris_daniel/portfolio-key-takes-1lkk</guid>
      <description>&lt;h2&gt;
  
  
  Key Takes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The learning curve is really steep for rust, but yew doesn't need complex syntax.&lt;/li&gt;
&lt;li&gt;Building a whole website on web assembly in production is the worst idea. Long development time, bundle size, lack of build tooling, debugging tooling.&lt;/li&gt;
&lt;li&gt;Apart from all these negatives still my site loads faster but yet not like a static site.&lt;/li&gt;
&lt;li&gt;App build time is very large takes upto 15 mins in digital ocean. &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Future work
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Add service worker to cache wasm file and images&lt;/li&gt;
&lt;li&gt;Add more PWA features &lt;/li&gt;
&lt;li&gt;Add webgl to unlock multi threading capabilities of wasm.&lt;/li&gt;
&lt;li&gt;Add Post list and post page from dev.to&lt;/li&gt;
&lt;li&gt;Remove bulma and write css from scratch&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  More Info
&lt;/h3&gt;

&lt;p&gt;Cover Image from &lt;a href="https://unsplash.com/photos/KQ0C6WtEGlo?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditShareLink"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dohackathon</category>
      <category>rust</category>
      <category>webassembly</category>
      <category>yew</category>
    </item>
    <item>
      <title>Portfolio - Deploying in App platform</title>
      <dc:creator>Christopher Daniel</dc:creator>
      <pubDate>Mon, 11 Jan 2021 05:43:53 +0000</pubDate>
      <link>https://dev.to/chris_daniel/portfolio-deploying-in-app-platform-3m0m</link>
      <guid>https://dev.to/chris_daniel/portfolio-deploying-in-app-platform-3m0m</guid>
      <description>&lt;h2&gt;
  
  
  Deploying
&lt;/h2&gt;

&lt;p&gt;Many cloud providers stick to few runtimes like node js, ruby, php, java etc, but digital ocean provides docker container along with others to deploy our sites. We can see how I deployed it using docker container for static sites.&lt;/p&gt;

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

&lt;p&gt;Create a Dockerfile in your root directory. pull rust container&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM rust:1.48-slim-buster
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install node and yarn in docker&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RUN apt-get update -y &amp;amp;&amp;amp; apt-get install curl -y

RUN curl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh

RUN sh nodesource_setup.sh

RUN apt install nodejs -y
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update &amp;amp;&amp;amp;  apt-get install --no-install-recommends yarn -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy source files and build your app&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;COPY . .
RUN yarn install &amp;amp;&amp;amp; yarn build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Test your container locally by building and running the image&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker build -t yew-portfolio .
docker run -it -p 8000 yew-portfolio
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now test your build static files in a static file server of your choice and verify.&lt;/p&gt;

&lt;p&gt;Now deploy it to Digital ocean using app platform.&lt;/p&gt;

&lt;h3&gt;
  
  
  More Info
&lt;/h3&gt;

&lt;p&gt;Cover Image from &lt;a href="https://unsplash.com/photos/6Vg8N8u61aI?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditShareLink"&gt;Unplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dohackathon</category>
      <category>docker</category>
      <category>rust</category>
      <category>webassembly</category>
    </item>
    <item>
      <title>Portfolio - Building the website</title>
      <dc:creator>Christopher Daniel</dc:creator>
      <pubDate>Mon, 11 Jan 2021 05:43:30 +0000</pubDate>
      <link>https://dev.to/chris_daniel/portfolio-building-the-website-ml0</link>
      <guid>https://dev.to/chris_daniel/portfolio-building-the-website-ml0</guid>
      <description>&lt;h2&gt;
  
  
  Website
&lt;/h2&gt;

&lt;p&gt;I started building the website from the template &lt;a href="https://github.com/yewstack/yew-wasm-pack-template"&gt;Yew webpack template&lt;/a&gt;. Using this template reduced my development effort thanks to hot reloading. To speed up I have used bulma css framework&lt;/p&gt;

&lt;h3&gt;
  
  
  Key takes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;I need to ensure the app is responsive&lt;/li&gt;
&lt;li&gt;It should have a good light house score&lt;/li&gt;
&lt;li&gt;SPA should have multiple routes&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Routing
&lt;/h3&gt;

&lt;p&gt;Yew has a router library named &lt;code&gt;yew-router&lt;/code&gt; which we are using to setup routing. When SPA is deployed as static site it, routers need extra configuration. We have to configure &lt;code&gt;index.html&lt;/code&gt; as fallback url so any site would first reach &lt;code&gt;index.html&lt;/code&gt;. Now the routes simply append the &lt;code&gt;href&lt;/code&gt; in url bar because of relative url. To avoid this I have used added base tag in head.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; &amp;lt;base href="https://yew-portfolio-iwfte.ondigitalocean.app/"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Layout
&lt;/h3&gt;

&lt;p&gt;Even though I used bulma css to speed up, there are some complex layouts, where we need to use &lt;code&gt;css grid&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bundle size
&lt;/h3&gt;

&lt;p&gt;Unlike mature frontend frameworks like Next js, Gatsby, Yew didn't have code splitting. This costs the website performance. The wasm file size is around 450kb. This is one of the main downsides of writing a whole website in yew.&lt;/p&gt;

&lt;h3&gt;
  
  
  Light house scores
&lt;/h3&gt;

&lt;h3&gt;
  
  
  More Info
&lt;/h3&gt;

&lt;p&gt;Cover Image from &lt;a href="https://unsplash.com/photos/Z9AU36chmQI?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditShareLink"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dohackathon</category>
      <category>yew</category>
      <category>rust</category>
      <category>webassembly</category>
    </item>
    <item>
      <title>Portfolio - Tech stack and motivation</title>
      <dc:creator>Christopher Daniel</dc:creator>
      <pubDate>Mon, 11 Jan 2021 05:43:01 +0000</pubDate>
      <link>https://dev.to/chris_daniel/portfolio-tech-stack-and-motivation-44j9</link>
      <guid>https://dev.to/chris_daniel/portfolio-tech-stack-and-motivation-44j9</guid>
      <description>&lt;h2&gt;
  
  
  Portfolio
&lt;/h2&gt;

&lt;p&gt;It's been so long since I last posted in Dev. I was looking for new ideas for hacking and posts and Digital Ocean hackathon started. I decided to finally create my personal website 😸. It is going to be a static site but with a twist. It will be SPA written in web assembly. Wait What😳 Web Assembly for a portfolio. For justice, I will add webgl components but in future😜&lt;/p&gt;

&lt;h3&gt;
  
  
  Tech Stack
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://yew.rs/"&gt;Yew Framework&lt;/a&gt; for writing wasm components. Yew is a frontend framework written in rust and is compiled to wasm target using wasm-bindgen&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/thedodd/ybc"&gt;YBC&lt;/a&gt; yew component library based on bulma&lt;/li&gt;
&lt;li&gt;Webpack for compiling and bundling rust, wasm, js, sass,css etc&lt;/li&gt;
&lt;li&gt;Docker for deploying the static app in digital ocean app platform&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Code Editor - Jetbrains Clion. To accelerate development I have used &lt;a href="https://github.com/yewstack/yew-wasm-pack-template"&gt;yew webpack starter template&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Why I chose this Tech Stack
&lt;/h3&gt;

&lt;p&gt;I wanted to learn rust and wasm and yew seems to be the best bet. At first I tried the minimal yew setup and I was able to deploy it. Hooray❗. Hold on there's a problem, unlike React, Yew and Wasm doesn't have well established tooling. Every time I edit the project, I have to recompile the whole app 😑. I had two options use webpack or &lt;a href="https://github.com/thedodd/trunk"&gt;trunk&lt;/a&gt; a rust wasm bundler. I decided to go with webpack😛. &lt;/p&gt;

&lt;h3&gt;
  
  
  Additional / More Info
&lt;/h3&gt;

&lt;p&gt;Cover Image - &lt;a href="https://unsplash.com/photos/BMnhuwFYr7w?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditShareLink"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dohackathon</category>
      <category>rust</category>
      <category>webassembly</category>
      <category>yew</category>
    </item>
    <item>
      <title>Magento 2 Graphql Development Environment</title>
      <dc:creator>Christopher Daniel</dc:creator>
      <pubDate>Wed, 02 Oct 2019 08:26:50 +0000</pubDate>
      <link>https://dev.to/chris_daniel/magento-2-graphql-development-environment-302f</link>
      <guid>https://dev.to/chris_daniel/magento-2-graphql-development-environment-302f</guid>
      <description>&lt;h2&gt;
  
  
  Graphql Development for Magento 2
&lt;/h2&gt;

&lt;p&gt;Magento 2.3.X comes with Graphql API support. To learn more about graphql visit &lt;a href="https://graphql.org/"&gt;graphql.org&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Interested in Magento Graphql Endpoints, time to setup your development environment. &lt;br&gt;
When it comes to Magento development, &lt;a href="https://www.jetbrains.com/phpstorm/"&gt;PHPStorm&lt;/a&gt; is the best IDE.&lt;br&gt;
Download &lt;a href="https://plugins.jetbrains.com/plugin/8097-js-graphql"&gt;JSGraphql plugin&lt;/a&gt; from PHPStorm marketplace&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup Graphql development environment in Magento
&lt;/h2&gt;

&lt;p&gt;The graphql plugin can run queries, mutations etc defined in your project. It gives autocomplete suggestions for writing query and schema.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;To configure graphql plugin open the graphql tab at the bottom.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I8FcAm9I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/dpsrcmp25pywpphzsptp.png" alt="Alt Text"&gt;
&lt;/li&gt;
&lt;li&gt;Press the '+' icon in the tab, select where you have to place the config file. Usually place at project root folder. (you will see some errors in schema errors section in graphql tab, ignore it for now)&lt;/li&gt;
&lt;li&gt;Now paste the content in generated .graphqlconfig file change $BASE_URL with your magento base url
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Practice GraphQL Schema"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"schemaPath"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"schema.graphql"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"excludes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"dev/**"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"extensions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"endpoints"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Default GraphQL Endpoint"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"$BASE_URL/graphql"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"headers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"user-agent"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"JS GraphQL"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"introspect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Now refresh your graphql tab until your graphql endpoint shows up there. Double click it, and a popup ask you to select Endpoint action.&lt;/li&gt;
&lt;li&gt;Select &lt;code&gt;Get Graphql Schema from Endpoint&lt;/code&gt; option.&lt;/li&gt;
&lt;li&gt;Now schema.graphql file will be generated in project root.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now auto complete will be available for schema, query and mutation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fix schema errors in graphql tab.
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The graphql custom &lt;a href="https://www.apollographql.com/docs/graphql-tools/schema-directives/"&gt;directives&lt;/a&gt; by magento are not present in generated schema. &lt;br&gt;
Copy all the directives from vendor/magento/module-graph-ql\etc\schema.graphqls file to the top of generated schema.graphql file&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now you can see series of &lt;code&gt;FilterTypeInput&lt;/code&gt; error followed by &lt;code&gt;Unexpected Token: "null"&lt;/code&gt; error.&lt;br&gt;
If you fix this error, all &lt;code&gt;FilterTypeInput&lt;/code&gt; errors will be removed.&lt;br&gt;
So easy fix remove it, you wont get auto complete for null filter in &lt;code&gt;FilterTypeInput&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Is null"
null: String 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Find input &lt;code&gt;FilterTypeInput&lt;/code&gt; and remove these two lines.&lt;/p&gt;

&lt;h4&gt;
  
  
  NOTE:
&lt;/h4&gt;

&lt;p&gt;Whenever you update your schema. You have to update your generated schema.graphql file by repeating step 5 and fix these errors again.&lt;/p&gt;

&lt;p&gt;For more information about configuring &lt;a href="https://jimkyndemeyer.github.io/js-graphql-intellij-plugin/docs/developer-guide"&gt;jsGraphql plugin&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Credits:&lt;br&gt;
&lt;a href="https://twitter.com/LenaOrobei"&gt;@LenaOrebei&lt;/a&gt;&lt;br&gt;
&lt;a href="https://twitter.com/mage2tv"&gt;@mage2tv&lt;/a&gt;&lt;/p&gt;

</description>
      <category>magento2</category>
      <category>graphql</category>
      <category>phpstorm</category>
      <category>magento</category>
    </item>
    <item>
      <title>React + GreenSock Integration</title>
      <dc:creator>Christopher Daniel</dc:creator>
      <pubDate>Sun, 31 Mar 2019 06:08:23 +0000</pubDate>
      <link>https://dev.to/chris_daniel/react-greensock-integration-in0</link>
      <guid>https://dev.to/chris_daniel/react-greensock-integration-in0</guid>
      <description>&lt;h2&gt;
  
  
  React + Greensock
&lt;/h2&gt;

&lt;p&gt;I will explain you how to integrate GSAP animations to React application.&lt;/p&gt;

&lt;p&gt;demo: &lt;a href="https://cd-gsap.netlify.com/"&gt;GSAP&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using create-react-app create your react application setup.&lt;/p&gt;

&lt;p&gt;Now the react application setup is done, we have to add green sock for animation.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Now you can see the react icon spinning with the help of css animation. We have to convert it to GSAP.&lt;/p&gt;

&lt;p&gt;Change App.css. We are removing all the animations.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Its time to add GSAP animation ... &lt;/p&gt;

&lt;p&gt;To add animation to an element using GSAP we need a reference for the element in react. I'm going to use &lt;code&gt;useRef()&lt;/code&gt; hook.&lt;/p&gt;

&lt;p&gt;Now I will show how to get reference to the element using callback ref &lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;You can see the element in the console.&lt;/p&gt;

&lt;h4&gt;
  
  
  TweenMax
&lt;/h4&gt;

&lt;p&gt;TweenMax in a animation util from greensock. To learn more about TweenMax visit &lt;a href="https://greensock.com/tweenmax"&gt;tweenmax&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Inorder to rotate the div we have to use&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="nx"&gt;TweenMax&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nx"&gt;logoElement&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                  &lt;span class="c1"&gt;// reference to the element &lt;/span&gt;
            &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                            &lt;span class="c1"&gt;// duration &lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;repeat&lt;/span&gt;&lt;span class="p"&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="c1"&gt;// infinite loop of animation&lt;/span&gt;
                &lt;span class="na"&gt;rotation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;360&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;            &lt;span class="c1"&gt;// 360deg rotation&lt;/span&gt;
                &lt;span class="na"&gt;ease&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Linear&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;easeNone&lt;/span&gt;     &lt;span class="c1"&gt;// linear speed no acceleration -------&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;Now we can add the animation when the component mounts.&lt;br&gt;
Here is the final version&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;The full code is available on github &lt;a href="http://github.com/dani97/react-gsap-animation"&gt;github repo&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>gsap</category>
      <category>greensock</category>
    </item>
  </channel>
</rss>
