<?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: sasurau4</title>
    <description>The latest articles on DEV Community by sasurau4 (@sasurau4).</description>
    <link>https://dev.to/sasurau4</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%2F57787%2F59c4d0c3-5645-4074-9ca3-afebef8d6ba9.png</url>
      <title>DEV Community: sasurau4</title>
      <link>https://dev.to/sasurau4</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sasurau4"/>
    <language>en</language>
    <item>
      <title>How to install New Relic infrastructure agent to AWS Elastic Beanstalk with Amazon Linux 2</title>
      <dc:creator>sasurau4</dc:creator>
      <pubDate>Fri, 03 Dec 2021 08:10:05 +0000</pubDate>
      <link>https://dev.to/sasurau4/how-to-install-new-relic-infrastructure-agent-to-aws-elastic-beanstalk-with-amazon-linux-2-2ldi</link>
      <guid>https://dev.to/sasurau4/how-to-install-new-relic-infrastructure-agent-to-aws-elastic-beanstalk-with-amazon-linux-2-2ldi</guid>
      <description>&lt;h2&gt;
  
  
  Problem
&lt;/h2&gt;

&lt;p&gt;I want to install New Relic infrastructure agent to Elastic Beanstalk with Amazon Linux2.&lt;/p&gt;

&lt;p&gt;The guide is following.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.newrelic.com/jp/docs/infrastructure/install-infrastructure-agent/config-management-tools/configure-infrastructure-agent-aws-elastic-beanstalk/"&gt;https://docs.newrelic.com/jp/docs/infrastructure/install-infrastructure-agent/config-management-tools/configure-infrastructure-agent-aws-elastic-beanstalk/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But this guide is not correct about Amazon Linux2.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is the document wrong?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html"&gt;The aws official document&lt;/a&gt; says,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;On Amazon Linux 2 platforms, instead of providing files and commands in .ebextensions configuration files, we highly recommend that you use Buildfile. Procfile, and platform hooks whenever possible to configure and run custom code on your environment instances during instance provisioning. For details about these mechanisms, see Extending Elastic Beanstalk Linux platforms.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In Amazon Linux2, it seems that customizing with &lt;code&gt;.ebextensions&lt;/code&gt; doesn't work anymore.&lt;/p&gt;

&lt;p&gt;We should use &lt;a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-linux-extend.html"&gt;https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-linux-extend.html&lt;/a&gt; instead of &lt;code&gt;.ebextensions&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to install
&lt;/h2&gt;

&lt;p&gt;The solution is following.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;eb setenv NEW_RELIC_LICENSE_KEY=&amp;lt;YOUR_NR_LICENSE_KEY&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Put the following content at &lt;code&gt;.platform/hooks/prebuild/00_install_nr_agent.sh&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt;

&lt;span class="c"&gt;# NEW_RELIC_LICENSE_KEY has set as one of Elastic Beanstalk Environment properties&lt;/span&gt;
&lt;span class="nv"&gt;NR_LICENSE_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;/opt/elasticbeanstalk/bin/get-config environment &lt;span class="nt"&gt;-k&lt;/span&gt; NEW_RELIC_LICENSE_KEY&lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nv"&gt;DISPLAY_NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;YOUR_APPLICATION_NAME&amp;gt;

&lt;span class="nb"&gt;sudo cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /etc/newrelic-infra.yml &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;EOL&lt;/span&gt;&lt;span class="sh"&gt;
license_key: &lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;NR_LICENSE_KEY&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;
display_name: &lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;DISPLAY_NAME&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;
&lt;/span&gt;&lt;span class="no"&gt;EOL

&lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;curl &lt;span class="nt"&gt;-o&lt;/span&gt; /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/el/7/x86_64/newrelic-infra.repo
&lt;span class="nb"&gt;sudo &lt;/span&gt;yum &lt;span class="nt"&gt;-q&lt;/span&gt; makecache &lt;span class="nt"&gt;-y&lt;/span&gt; &lt;span class="nt"&gt;--disablerepo&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'*'&lt;/span&gt; &lt;span class="nt"&gt;--enablerepo&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'newrelic-infra'&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;yum &lt;span class="nb"&gt;install &lt;/span&gt;newrelic-infra &lt;span class="nt"&gt;-y&lt;/span&gt;

&lt;span class="c"&gt;# Restart the process because the update of config isn't reload automatically&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart newrelic-infra
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;chmod 755 ./.platform/hooks/prebuild/00_install_nr_agent.sh&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;eb deploy&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I found Elastic Beanstalk is based on EC2.&lt;/p&gt;

&lt;p&gt;I hope the article helps someone to install newrelic agent with EB.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/hyeoksuhan/c287bc191e5f1757818b9ea0aeeb1b94"&gt;https://gist.github.com/hyeoksuhan/c287bc191e5f1757818b9ea0aeeb1b94&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.newrelic.com/jp/docs/infrastructure/install-infrastructure-agent/config-management-tools/configure-infrastructure-agent-aws-elastic-beanstalk/"&gt;https://docs.newrelic.com/jp/docs/infrastructure/install-infrastructure-agent/config-management-tools/configure-infrastructure-agent-aws-elastic-beanstalk/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/linux-installation/install-infrastructure-monitoring-agent-linux/"&gt;https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/linux-installation/install-infrastructure-monitoring-agent-linux/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>beanstalk</category>
      <category>newrelic</category>
      <category>al2</category>
    </item>
    <item>
      <title>Wrote a cli tool in Rust</title>
      <dc:creator>sasurau4</dc:creator>
      <pubDate>Sat, 23 May 2020 14:26:17 +0000</pubDate>
      <link>https://dev.to/sasurau4/wrote-a-cli-tool-in-rust-388j</link>
      <guid>https://dev.to/sasurau4/wrote-a-cli-tool-in-rust-388j</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;I wrote a simple cli tool named &lt;em&gt;github-cli-utils&lt;/em&gt; in Rust. This tool suppports daily OSS activity in GitHub.&lt;/p&gt;

&lt;p&gt;I'll introduce why and how write it!&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;p&gt;Install from crate.io&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cargo install github-cli-utils
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;After you installed &lt;code&gt;github-cli-utils&lt;/code&gt;, you run it and show following.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;λ github-cli-utils help
github-cli-utils 0.1
Daiki Ihara &amp;lt;sasurau4@gmail.com&amp;gt;
Support developing OSS via cli

USAGE:
    github-cli-utils [FLAGS] &amp;lt;SUBCOMMAND&amp;gt;

FLAGS:
    -d, --debug      Turn debugging information on
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    add-upstream    add upstream to your git repository
    help            Prints this message or the help of the given subcommand(s)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This tool provide add-upstream command. It add upstream repository to your forked repository!&lt;/p&gt;

&lt;h2&gt;
  
  
  Motivation
&lt;/h2&gt;

&lt;p&gt;My motivation of writing &lt;code&gt;github-cli-utils&lt;/code&gt; is 2 following points.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add upstream is a bit troublesome&lt;/li&gt;
&lt;li&gt;Curiosity to Rust&lt;/li&gt;
&lt;li&gt;Needs to platform and shell agonistic command&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Add upstream is a bit troublesome
&lt;/h3&gt;

&lt;p&gt;When you find a bug or typo at readme about the OSS, you forked the repository, clone it and add upstream.&lt;/p&gt;

&lt;p&gt;Adding upstream is a bit troublesome because it needs to copy parent repository's url in browser.&lt;/p&gt;

&lt;p&gt;Going back and forth between terminal and browser is annoying, isn' it?&lt;/p&gt;

&lt;h3&gt;
  
  
  Curiosity to Rust
&lt;/h3&gt;

&lt;p&gt;I've been curious to Rust for about 2 years...&lt;/p&gt;

&lt;p&gt;Time has passed and congrats five years from Rust's birth.&lt;/p&gt;

&lt;p&gt;I began to write the simple cli tool to solve my daily little trouble.&lt;/p&gt;

&lt;h3&gt;
  
  
  Needs to platform and shell agonistic command
&lt;/h3&gt;

&lt;p&gt;I use macOS in my work and also use Ubuntu in my private coding. The enviroment is a bit different.&lt;/p&gt;

&lt;p&gt;If I just want to achieve my usecase, I would done it by writing shell script like following.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;git-remote-add-upstream&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="nb"&gt;type &lt;/span&gt;jq &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /dev/null 2&amp;gt;&amp;amp;1&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"'jq' is not installed."&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&amp;amp;2
    &lt;span class="nb"&gt;exit &lt;/span&gt;1
  &lt;span class="k"&gt;fi
  if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;$# &lt;/span&gt;&lt;span class="nt"&gt;-ne&lt;/span&gt; 1 &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Need repo name. e.g : 'user/repo'"&lt;/span&gt;
    &lt;span class="nb"&gt;exit &lt;/span&gt;1
  &lt;span class="k"&gt;fi
  &lt;/span&gt;&lt;span class="nb"&gt;local &lt;/span&gt;&lt;span class="nv"&gt;upstream&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-L&lt;/span&gt; &lt;span class="s2"&gt;"https://api.github.com/repos/&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | jq &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="s1"&gt;'.parent.full_name'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$upstream&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"null"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"upstream not found."&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&amp;amp;2
    &lt;span class="nb"&gt;exit &lt;/span&gt;1
  &lt;span class="k"&gt;fi
  &lt;/span&gt;git remote add upstream &lt;span class="s2"&gt;"git@github.com:&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;upstream&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.git"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="nb"&gt;alias &lt;/span&gt;&lt;span class="nv"&gt;grau&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'git-remote-add-upstream'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This script is quoted from &lt;a href="https://tech-blog.sgr-ksmt.org/2016/03/04/git_remote_add_upstream/"&gt;https://tech-blog.sgr-ksmt.org/2016/03/04/git_remote_add_upstream/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's very fine, but need to be &lt;code&gt;jq&lt;/code&gt; command installed. To be worse, I'm using fish shell.&lt;br&gt;
So I wrote a command that add upstream automatically without thinking about platform and shell.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hard point of implementation
&lt;/h2&gt;

&lt;p&gt;The codes is &lt;a href="https://github.com/sasurau4/github-cli-utils"&gt;https://github.com/sasurau4/github-cli-utils&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Argument parsing
&lt;/h3&gt;

&lt;p&gt;I used &lt;a href="https://github.com/clap-rs/clap"&gt;clap&lt;/a&gt; to parse argument. clap is useful library for that purpose.&lt;/p&gt;

&lt;p&gt;I implemented &lt;code&gt;add-upstream&lt;/code&gt; by subcommand. I wanted to use debug argument after command like &lt;code&gt;github-cli-utils add-upstream --debug&lt;/code&gt;.&lt;br&gt;
In default, clap only allows flags place before subcommand like &lt;code&gt;github-cli-utils [FLAGS] &amp;lt;SUBCOMMAND&amp;gt;&lt;/code&gt;. I had to use global(true) in argument setting to allow flags placed after subcommand.&lt;/p&gt;

&lt;h3&gt;
  
  
  Https access
&lt;/h3&gt;

&lt;p&gt;At first, I use &lt;a href="https://github.com/hyperium/hyper"&gt;hyper&lt;/a&gt; as http client. It's very useful but a bit complicated when accessing some resource via https.&lt;sup id="fnref1"&gt;1&lt;/sup&gt; &lt;/p&gt;

&lt;p&gt;I use &lt;a href="https://github.com/seanmonstar/reqwest"&gt;reqwest&lt;/a&gt; instead of hyper. It's very easy to use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Rust is a good language to implement cli tool thanks to language itself and the ecosystem.&lt;br&gt;
I hope this article help you implement cli tools.&lt;/p&gt;

&lt;p&gt;Also, I'm welcome PRs and issues to &lt;code&gt;github-cli-utils&lt;/code&gt;!&lt;/p&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;&lt;a href="https://github.com/hyperium/hyper/issues/1025"&gt;https://github.com/hyperium/hyper/issues/1025&lt;/a&gt; ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>rust</category>
      <category>cli</category>
    </item>
    <item>
      <title>Meetup report about React Native users in Japanese Startups the 3rd.</title>
      <dc:creator>sasurau4</dc:creator>
      <pubDate>Tue, 02 Apr 2019 14:13:07 +0000</pubDate>
      <link>https://dev.to/sasurau4/meetup-report-about-react-native-users-in-japanese-startups-the-3rd-14l</link>
      <guid>https://dev.to/sasurau4/meetup-report-about-react-native-users-in-japanese-startups-the-3rd-14l</guid>
      <description>

&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;I participated on the event of React Native users in Japanese startups at March 28,  2019. &lt;br&gt;
This me7 people talked about React Native such as its advantage and disadvantage or  hard point to use etc.&lt;br&gt;
etup was the 3rd and held in Tokyo.&lt;br&gt;
&lt;a href="https://r-n.connpass.com/event/121961/"&gt;https://r-n.connpass.com/event/121961/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;7 people talked about various things about React Native such as its advantage and disadvantage or hard point to use etc in 5 or 10 minutes.&lt;/p&gt;

&lt;p&gt;Although all lightning talks and its slides are Japanese, it's very excited.&lt;br&gt;
So, I posted the report about the meetup in English because I want to help empowering the react native community.&lt;br&gt;
There are many React Native users in Japan!&lt;/p&gt;

&lt;h2&gt;
  
  
  Note
&lt;/h2&gt;

&lt;p&gt;Following summaries are originally Japanese so my translation may be wrong. &lt;br&gt;
If there were mistakes, they were not presenter's mistake and they were probably my mistakes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary of LTs
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Launch the React Native app based on the react web app.
&lt;/h3&gt;

&lt;p&gt;presenter: @t0m0120&lt;br&gt;
slide: &lt;a href="https://speakerdeck.com/t0m0120/reactzhi-websabisuworeactnativedeapurihua-sitahua"&gt;https://speakerdeck.com/t0m0120/reactzhi-websabisuworeactnativedeapurihua-sitahua&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The presenter talked about how speedy it is they launched the new react native  app based on react web app.&lt;br&gt;
&lt;a href="https://social-dog.net/en"&gt;socialdog&lt;/a&gt; is a service that make us smart and efficient Twitter Account Management.&lt;br&gt;
They launched a new iOS app based on react web app in only 4 month.&lt;br&gt;
Why so short developing? The answer is they use same logic in both web and native.&lt;br&gt;
The best example is redux code. The presenter said our code was almost the same code in react and react native!&lt;/p&gt;

&lt;p&gt;Do you think it is an success of &lt;code&gt;Learn Once, Write Anywhere&lt;/code&gt; that is the one of React's core concept?&lt;br&gt;
I think absolutely yes.&lt;/p&gt;

&lt;h3&gt;
  
  
  I want to talk about many many pitfalls of react-native-firebase
&lt;/h3&gt;

&lt;p&gt;presenter: @tkow39&lt;br&gt;
slide: &lt;a href="https://www.slideshare.net/TakeoKusama/react-nativefirebase-startupmtup-138554329"&gt;https://www.slideshare.net/TakeoKusama/react-nativefirebase-startupmtup-138554329&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The presenter talked about how useful react-native-firebase library is. But there are many fitfalls because of its various functionality.&lt;br&gt;
The presenter talked the cases he was stuck in theTo make matters worse, the tool named react-native-git-upgrade that provided React Native haven't &lt;br&gt;
 alreeady maintained and didn't work fine. pitfalls like authentication, DeepLink, Firestore etc.&lt;/p&gt;

&lt;p&gt;I think some pitfalls are caused by firebase itself rather than react-native -firebase.&lt;br&gt;
Of course firebase and react-native-firebase are both great and useful! I hope somebody who stucks in pitfalls shares the knowledge or workaround and even contribute to official documents!&lt;/p&gt;

&lt;h3&gt;
  
  
  Testability in React Native
&lt;/h3&gt;

&lt;p&gt;presenter: @L_e_k_o&lt;br&gt;
slide: &lt;a href="https://talks.leko.jp/react-native-testability/"&gt;https://talks.leko.jp/react-native-testability/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The presenter talked about how to write tests for React Native Application.&lt;br&gt;
React Native Application generally consists of  many parts like redux, usecase, universal JS and native layer.&lt;br&gt;
He introduced some useful techniques and libraries for writing test. For example interface injection, using &lt;a href="https://github.com/reduxjs/reselect"&gt;reselect&lt;/a&gt;, [supertest(&lt;a href="https://github.com/visionmedia/supertest"&gt;https://github.com/visionmedia/supertest&lt;/a&gt;) and &lt;a href="https://www.npmjs.com/package/@storybook/addon-storyshots"&gt;storyshots&lt;/a&gt;.&lt;br&gt;
Keep connect logic as simple as possible benefit for no need writing E2E tests.&lt;br&gt;
And he wanted to know about how to write tests for some native modules like Bluetooth and Push Notification. They are not available in Simulators. Do you know how to test them?&lt;/p&gt;

&lt;h3&gt;
  
  
  There is no royal road to upgrading React Native.
&lt;/h3&gt;

&lt;p&gt;presenter: @natural_clar&lt;br&gt;
slide: &lt;a href="http://slides.naturalclar.com/"&gt;http://slides.naturalclar.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The presenter talked about why and how upgrading React Native.&lt;br&gt;
The reason why is very simple. Upgrading makes us to use new features like React Hooks! &lt;br&gt;
But upgrading occasionally breaks our app for example TextInput broken for Chinese and Japanese and  the build failed because of XCode 10 new build system.&lt;br&gt;
Upgrading React Native needs many steps like upgrading npm dependencies, changing build config (build.gradle or .pbxproj file) and so on.&lt;br&gt;
To make matters worse, the tool named react-native-git-upgrade that provided by React Native has not maintained and didn't work fine.&lt;br&gt;
But new tool named rn-diff-purge solves this situation. We can get the diffs of each versions that &lt;code&gt;react-native init&lt;/code&gt;ed by using the tool.&lt;br&gt;
So comparing the diffs with our project  and applying them make us ease to upgrade React Native.&lt;/p&gt;

&lt;h3&gt;
  
  
  Usefulness of Development with React Native and GraphQL
&lt;/h3&gt;

&lt;p&gt;presenter: @mediaboxes&lt;br&gt;
slide: &lt;a href="https://speakerdeck.com/mediaboxes/react-native-x-graphql-dekai-fa-sitarabian-li-datutaohua"&gt;https://speakerdeck.com/mediaboxes/react-native-x-graphql-dekai-fa-sitarabian-li-datutaohua&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The presenter talked about the advantages and disadvantages of React Native x GraphQL.&lt;br&gt;
He explained about GraphQL and talked he used Apollo Client. He benefits from cache system of apollo that available auto cache update without Redux. And he explained disadvantages was also cache controll and error handling.&lt;/p&gt;

&lt;p&gt;I thought the combination of React Native and GraphQL was very good when I used React Native and GraphQL before. Apollo client has many functions so using them is a bit complicated but it's very useful!&lt;/p&gt;

&lt;h3&gt;
  
  
  Struggle with introduction of E2E test library Detox
&lt;/h3&gt;

&lt;p&gt;presenter: @ariiyu&lt;br&gt;
slide: &lt;a href="https://speakerdeck.com/ariiyu/struggle-with-introduction-of-e2e-test-library-detox"&gt;https://speakerdeck.com/ariiyu/struggle-with-introduction-of-e2e-test-library-detox&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The presenter talked about Detox and its trouble shoots. &lt;br&gt;
&lt;a href="https://github.com/wix/Detox"&gt;Detox&lt;/a&gt; is a good library for E2E test of React Native app. &lt;br&gt;
He met the trouble that E2E test not ending. He dived into how Detox works and debugged step by step steadily. Finally, he found the cause. Detox waited for animations end by default and there were background infinite animation loop in the app. So he solved the problem by replacing the file only when E2E test.&lt;br&gt;
He finished the LT saying he wanted Detox buddies to share the knowledge.&lt;/p&gt;

&lt;h3&gt;
  
  
  How a web engineer fights in React Native
&lt;/h3&gt;

&lt;p&gt;presenter: @NaoshiHoshi&lt;br&gt;
slide:  &lt;a href="https://www.slideshare.net/NaoshiHoshi/how-web-engineer-fight-in-the-reactnative-138559060"&gt;https://www.slideshare.net/NaoshiHoshi/how-web-engineer-fight-in-the-reactnative-138559060&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The presenter talked about how a web engineer fights in React Native.&lt;br&gt;
His company met difficult situation that there were iOS app without native application engineer. The main developer has already left his company and the remaining engineers don't have developing experience of native application. They couldn't continue to develop existed iOS app.&lt;br&gt;
So, they changed the way by choosing React Native instead. He decided to implement functionalities only in React Native + Expo. Not Ejected. &lt;/p&gt;

&lt;p&gt;I think his idea is right because React Native has some constrains because of cross platform. Avoiding these constraints is a key of developing with React Native.&lt;/p&gt;

&lt;h2&gt;
  
  
  Others
&lt;/h2&gt;

&lt;p&gt;The meetup organizer tries very interesting challenges in each time. At this time, there were seat that the applied person must take the champagne to the meeting place. We drunk champagne at the start of meet up!&lt;br&gt;
And, the organizer announced he was planning a big meetup with around 100 participants.&lt;br&gt;
I'm looking forward it!&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;There are many React Native users and  its community in Japan.&lt;br&gt;
React Native is a good framework and exciting tools. Thanks for maintainers and the community!&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;


</description>
      <category>reactnative</category>
      <category>meetup</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Metro Bundler in Web</title>
      <dc:creator>sasurau4</dc:creator>
      <pubDate>Wed, 27 Feb 2019 13:08:56 +0000</pubDate>
      <link>https://dev.to/sasurau4/metro-bundler-in-web-1385</link>
      <guid>https://dev.to/sasurau4/metro-bundler-in-web-1385</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;Do you know Metro Bundler?&lt;br&gt;
If you using React Native, you are familiar with it.&lt;br&gt;
Metro Bundler is the JavaScript bundler for React Native.&lt;br&gt;
I found one tweet about surprising thing about Metro Bundler few month ago.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1088628642970783744-724" src="https://platform.twitter.com/embed/Tweet.html?id=1088628642970783744"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1088628642970783744-724');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1088628642970783744&amp;amp;theme=dark"
  }



&lt;br&gt;
&lt;iframe class="tweet-embed" id="tweet-1088711186424758272-68" src="https://platform.twitter.com/embed/Tweet.html?id=1088711186424758272"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1088711186424758272-68');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1088711186424758272&amp;amp;theme=dark"
  }



&lt;br&gt;
&lt;iframe class="tweet-embed" id="tweet-1088825340829421569-100" src="https://platform.twitter.com/embed/Tweet.html?id=1088825340829421569"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1088825340829421569-100');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1088825340829421569&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;Hahaha, I couldn't believe it!&lt;br&gt;
Because &lt;a href="https://facebook.github.io/metro/" rel="noopener noreferrer"&gt;The document&lt;/a&gt; says "The JavaScript Bundler &lt;em&gt;for React Native&lt;/em&gt;" at the top.&lt;br&gt;
But Ms. Nakazawa and Mr.Conner are inside Facebook team members and more Mr.Conner is the tech lead for web foundation of Instagram.&lt;br&gt;
So, I checked whether Instagram use metro bundler for web or not.&lt;/p&gt;
&lt;h2&gt;
  
  
  Checking
&lt;/h2&gt;

&lt;p&gt;Metro Bundler has &lt;a href="https://facebook.github.io/metro/docs/en/cli" rel="noopener noreferrer"&gt;document about using as CLI&lt;/a&gt;, so I bundles some JavaScript files and compare it with web's bundled file.&lt;br&gt;
I found common points like &lt;code&gt;__BUNDLE_START_TIME__=this.nativePerformanceNow?nativePerformanceNow():Date.now()&lt;/code&gt;.&lt;br&gt;
And enter &lt;code&gt;window._sharedData&lt;/code&gt; in Chrome's Developer tools console, you'll find &lt;code&gt;bundle_variant: "metro"&lt;/code&gt; that seems the bundle config.&lt;/p&gt;

&lt;p&gt;I confirmed Instagram use Metro Bundler for Web. I'm very curious how to do it.&lt;br&gt;
Let's try it!&lt;/p&gt;
&lt;h2&gt;
  
  
  Using Metro Bundler in Web!
&lt;/h2&gt;

&lt;p&gt;The repo: &lt;a href="https://github.com/sasurau4/sample-metro-bundler-in-web" rel="noopener noreferrer"&gt;https://github.com/sasurau4/sample-metro-bundler-in-web&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I explain how to use Metro Bundler in Web.&lt;/p&gt;

&lt;p&gt;Metro Bundler provides its functions as CLI, server itself and express middleware according to &lt;a href="https://facebook.github.io/metro/docs/en/getting-started.html" rel="noopener noreferrer"&gt;the document&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So, I choose express middleware and the server is following.&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Metro&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;metro&lt;/span&gt;&lt;span class="dl"&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;express&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;express&lt;/span&gt;&lt;span class="dl"&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;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;Metro&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loadConfig&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nx"&gt;config&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;metroBundlerServer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;Metro&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;runMetro&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;metroBundlerServer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;processRequest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;metroBundlerServer&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

  &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;static&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;public&lt;/span&gt;&lt;span class="dl"&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="na"&gt;server&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;serverConfig&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;config&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;port&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;serverConfig&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;port&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;This server serve static files inside &lt;code&gt;public&lt;/code&gt; dir and bundle file bundled by Metro.&lt;/p&gt;

&lt;p&gt;The static file is following.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Metro Bundler in Web!&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"root"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"index.bundle?platform=web&amp;amp;dev=true&amp;amp;minify=false"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can get bundle file from the path of &lt;code&gt;index.bundle&lt;/code&gt; with various parameters.&lt;/p&gt;

&lt;p&gt;If you want to only bundling files, it's all done. &lt;/p&gt;

&lt;p&gt;In the real world, we often need to transpile JS files with babel or like that.&lt;/p&gt;

&lt;p&gt;It's very easy to use Babel with Metro.&lt;/p&gt;

&lt;p&gt;If you want to use React, put the &lt;code&gt;babel.config.js&lt;/code&gt; like following.&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;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;presets&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@babel/preset-env&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@babel/preset-react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@babel/plugin-proposal-export-default-from&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the server and access to localhost, the application run in the browser!&lt;br&gt;
It's all done.🎉&lt;/p&gt;

&lt;p&gt;I explain how to use Metro Bundler same like webpack-dev-server.&lt;br&gt;
If you want to deploy artifacts to hosting services, you can do it from cli!&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Although Metro Bundler is mainly focus to the React Native, we can also use it for web.&lt;br&gt;
I also learned functions provided by the webpack and webpack-dev-server.&lt;br&gt;
It is rare to use Metro Bundler for web in production today.&lt;br&gt;
I imagine If someday that Metro Bundler is regulary used for web comes true, we could write Universal Application with React Native and React Native Web.&lt;br&gt;
It's exciting future!&lt;/p&gt;

&lt;p&gt;Thanks for the Metro team about documentation and maintenance.&lt;br&gt;
Thanks for reading!&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>node</category>
    </item>
    <item>
      <title>Tips for react-native upgrade to v0.58.4</title>
      <dc:creator>sasurau4</dc:creator>
      <pubDate>Fri, 08 Feb 2019 03:19:01 +0000</pubDate>
      <link>https://dev.to/sasurau4/tips-for-react-native-upgrade-to-v0584-197k</link>
      <guid>https://dev.to/sasurau4/tips-for-react-native-upgrade-to-v0584-197k</guid>
      <description>

&lt;h2&gt;
  
  
  What is the article
&lt;/h2&gt;

&lt;p&gt;I tried upgrade react-native v0.57.7. to v0.58.4.&lt;/p&gt;

&lt;p&gt;This article is the saga of upgrading.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps
&lt;/h2&gt;

&lt;p&gt;At first, upgrade react-native to v0.58.4, , react to 16.6.1 and metro-react-native-babel-preset to 0.51.1 by yarn or npm.&lt;/p&gt;

&lt;p&gt;You might meet errors when &lt;code&gt;yarn react-native ios or android&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Additional steps here.&lt;/p&gt;

&lt;h3&gt;
  
  
  For iOS
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md#058"&gt;Mentioned from changelog&lt;/a&gt;, you need to link &lt;code&gt;JavaScriptCore.framework&lt;/code&gt; as librariy by manual.&lt;/p&gt;

&lt;p&gt;It's all done when my use case.&lt;/p&gt;

&lt;h3&gt;
  
  
  For Android
&lt;/h3&gt;

&lt;p&gt;Upgrading for android is a bit complicated, follow the &lt;a href="https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md#058"&gt;changelog&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I met error of &lt;code&gt;More than one file was found with OS independent path 'lib/x86_64/libjsc.so'&lt;/code&gt; same as &lt;a href="https://github.com/facebook/react-native/issues/2814#issuecomment-458866869"&gt;this issue comment&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, I fixed errors by modifying build.gradle files.&lt;/p&gt;

&lt;p&gt;The final result of files are following.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;android/build.gradle&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight gradle"&gt;&lt;code&gt;&lt;span class="o"&gt;...&lt;/span&gt;
&lt;span class="n"&gt;ext&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="o"&gt;...&lt;/span&gt;
    &lt;span class="n"&gt;buildToolsVersion&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"28.0.2"&lt;/span&gt;
    &lt;span class="n"&gt;compileSdkVersion&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;28&lt;/span&gt;
    &lt;span class="o"&gt;...&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;code&gt;android/app/build.gradle&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight gradle"&gt;&lt;code&gt;&lt;span class="n"&gt;android&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="o"&gt;...&lt;/span&gt;
    &lt;span class="n"&gt;packagingOptions&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;pickFirst&lt;/span&gt; &lt;span class="s1"&gt;'lib/x86_64/libjsc.so'&lt;/span&gt;
        &lt;span class="n"&gt;pickFirst&lt;/span&gt; &lt;span class="s1"&gt;'lib/arm64-v8a/libjsc.so'&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;...&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I hope these tips are helpful for you.&lt;br&gt;
Have a habby react-native developing!&lt;/p&gt;


</description>
      <category>reactnative</category>
    </item>
    <item>
      <title>The way to downgrade expo client on Android</title>
      <dc:creator>sasurau4</dc:creator>
      <pubDate>Wed, 30 Jan 2019 10:55:41 +0000</pubDate>
      <link>https://dev.to/sasurau4/the-way-to-downgrade-expo-client-on-android-2mca</link>
      <guid>https://dev.to/sasurau4/the-way-to-downgrade-expo-client-on-android-2mca</guid>
      <description>

&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;React Native is one of the most actively developed project in the world.&lt;br&gt;
According to &lt;a href="https://octoverse.github.com/projects#repositories"&gt;The State of the Octoverse&lt;/a&gt;, React Native has the second largest number of contributors in 2018.&lt;/p&gt;

&lt;p&gt;This means React Native is often released. &lt;br&gt;
The latest version at the beginning of 2018 is &lt;code&gt;0.52.0&lt;/code&gt;. And the latest version (at the beginning of 2019) is &lt;code&gt;0.57.8&lt;/code&gt;. How fast developing React Native was!&lt;/p&gt;

&lt;p&gt;So, Expo that is a set of tools, libraries and services for React Native app is developing as fast as React Native is.&lt;/p&gt;

&lt;p&gt;One day I met the error like &lt;code&gt;No compatible manifest found. SDK Versions supported: 32.0.0, 31.0.0, 30.0.0, 29.0.0, 28.0.0, 27.0.0, 26.0.0 Provided manifestString: 25.0&lt;/code&gt; in expo client.&lt;/p&gt;

&lt;p&gt;This error means the expo sdk version in your app has not been already supported by expo client.&lt;br&gt;
&lt;strong&gt;I strongly recommend to upgrade your expo sdk version&lt;/strong&gt; when you meet the error!&lt;/p&gt;

&lt;p&gt;I'll explain the workaround to continue developing your app in Android.&lt;br&gt;
But I strongly recommended &lt;code&gt;upgrade expo sdk&lt;/code&gt; as soon as possible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step1.
&lt;/h3&gt;

&lt;p&gt;Check the client version compatible with your expo sdk version from &lt;a href="https://expo.io/--/api/v2/versions"&gt;https://expo.io/--/api/v2/versions&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In my case, my app use expo sdk of &lt;code&gt;v25.0.0&lt;/code&gt;, so the compatible expo client version is &lt;code&gt;v2.3.0&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step2.
&lt;/h3&gt;

&lt;p&gt;Access &lt;a href="https://expo.io/tools#client"&gt;https://expo.io/tools#client&lt;/a&gt; and click link of &lt;code&gt;Download APK &amp;lt;Version&amp;gt;&lt;/code&gt;. You can download apk file from CDN.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step3.
&lt;/h3&gt;

&lt;p&gt;Modify CDN link to compatible version that you checked at Step.1&lt;/p&gt;

&lt;p&gt;Example: &lt;a href="https://d1ahtucjixef4r.cloudfront.net/Exponent-2.3.0.apk"&gt;https://d1ahtucjixef4r.cloudfront.net/Exponent-2.3.0.apk&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step4.
&lt;/h3&gt;

&lt;p&gt;Download apk, transfer it to the Android device and install app directly from apk! That's all!&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Though I explained the workaround that you continue developing the app using deprecated expo sdk, it is important to upgrade sdk as soon as possible.&lt;br&gt;
Upgrade may need a lot of time and effort but you can benefit from new libraries and performance improvements as much.&lt;/p&gt;

&lt;p&gt;I hope this article help you meet the same error.&lt;br&gt;
Thanks for reading!&lt;/p&gt;


</description>
      <category>reactnative</category>
      <category>javascript</category>
      <category>expo</category>
    </item>
    <item>
      <title>How to migrate store persisted by redux-persist?</title>
      <dc:creator>sasurau4</dc:creator>
      <pubDate>Tue, 22 Jan 2019 12:14:57 +0000</pubDate>
      <link>https://dev.to/sasurau4/how-to-migrate-store-persisted-by-redux-persist-5dng</link>
      <guid>https://dev.to/sasurau4/how-to-migrate-store-persisted-by-redux-persist-5dng</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;Recently, I got caught in a pitfall about redux-persist when developing react-native application.&lt;br&gt;
 It 's because two reasons. The one is the redux store in app has complicated shape. Another is &lt;a href="https://github.com/rt2zz/redux-persist/blob/v5.10.0/docs/migrations.md" rel="noopener noreferrer"&gt;redux-persist's migration sample document&lt;/a&gt; is very simple and I can't find any other douments about migration.&lt;/p&gt;

&lt;p&gt;If you read the doc and figure it out, you don't perhaps need to read following.&lt;br&gt;
But you have questions about how to migrate store or how migration works, this article would be helpful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisite
&lt;/h2&gt;

&lt;p&gt;This article based on following version.&lt;/p&gt;

&lt;p&gt;yarn: v1.13.0&lt;br&gt;
redux-persist: v5.10.0&lt;/p&gt;

&lt;h2&gt;
  
  
  First Step
&lt;/h2&gt;

&lt;p&gt;All codes in this article is &lt;a href="https://github.com/sasurau4/sample-redux-persist-migration" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;br&gt;
This repo made by create-react-app and already setup.&lt;/p&gt;

&lt;p&gt;Please clone the repo and checkout &lt;code&gt;v1.0.0&lt;/code&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

git clone https://github.com/sasurau4/sample-redux-persist-migration.git
cd sample-redux-persist-migration
git checkout v1.0.0


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

&lt;/div&gt;

&lt;p&gt;Starting development server following commands.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

yarn install
yarn start


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

&lt;/div&gt;

&lt;p&gt;Then automatically open new tab on your browser! First step is done🎉&lt;/p&gt;

&lt;h2&gt;
  
  
  Inspect what happen in app
&lt;/h2&gt;

&lt;p&gt;You would see very simple app consists of counter and favorite fruit picker.&lt;br&gt;
Play with the app by increment or decrement or choose your favorite fruit!&lt;br&gt;
Reload the page after playing. What happens to the app?&lt;/p&gt;

&lt;p&gt;The state of the app will be the same as before the reload!&lt;br&gt;
It's thanks to the redux-persist.&lt;/p&gt;

&lt;p&gt;What happen in the app? Go to inspect it.&lt;/p&gt;

&lt;p&gt;I usually use Google Chrome. I use it for explanation too.&lt;/p&gt;

&lt;p&gt;Open your developer tools and see like following.&lt;/p&gt;

&lt;p&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%2F37an4jo7jshsqqmkninf.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%2F37an4jo7jshsqqmkninf.png" alt="version1.0.0 store"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can find &lt;code&gt;persist:root&lt;/code&gt; key in local session and &lt;code&gt;_persist&lt;/code&gt; key inside the value.&lt;br&gt;
It shows redux-persist serialize our reducers by &lt;code&gt;JSON.stringify&lt;/code&gt;.&lt;br&gt;
You can see &lt;a href="https://github.com/rt2zz/redux-persist/blob/v5.10.0/src/createPersistoid.js#L126" rel="noopener noreferrer"&gt;code&lt;/a&gt;&lt;br&gt;
&lt;code&gt;_persist&lt;/code&gt; is meta data added by redux-persist.&lt;/p&gt;

&lt;p&gt;If no version specified the config, the library recognize the reducer as &lt;code&gt;minus 1 version&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You can see the persisted data in local storage sync to the state of the app when change something!&lt;/p&gt;

&lt;p&gt;So, go to the main question, migrate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Store Migration
&lt;/h2&gt;

&lt;p&gt;Keep te webpack-dev-server running and enter following command.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

git checkout v2.0.0


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

&lt;/div&gt;

&lt;p&gt;What happened to the app?&lt;/p&gt;

&lt;p&gt;The favorite animal item appear in the app and some log in the console!&lt;br&gt;
It's the success of redux-persist migration.&lt;/p&gt;

&lt;p&gt;The migration setting is following extracted &lt;a href="https://github.com/sasurau4/sample-redux-persist-migration/blob/v2.0.0/src/Store.js#L12" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;migrations&lt;/span&gt; &lt;span class="o"&gt;=&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="nx"&gt;state&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;return&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="na"&gt;favorite&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;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;favorite&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;animal&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Tiger&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="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;persistConfig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;root&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;version&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="nx"&gt;storage&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;debug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;migrate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;createMigrate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;migrations&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;debug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&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;Migrated state has favorite animal as &lt;code&gt;Tiger&lt;/code&gt;, so you see favorite animal as &lt;code&gt;Tiger&lt;/code&gt; in the app!&lt;br&gt;
Check the version in &lt;code&gt;_persist&lt;/code&gt;, you'll find version 0.&lt;/p&gt;

&lt;p&gt;Next, checkout to master. What happened?&lt;/p&gt;

&lt;p&gt;You see &lt;code&gt;I don't like fruit!&lt;/code&gt; message on the app!&lt;br&gt;
The migration of  v0 to v1 succeeded.&lt;/p&gt;

&lt;p&gt;The code is &lt;a href="https://github.com/sasurau4/sample-redux-persist-migration/blob/master/src/Store.js#L16" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;migrations&lt;/span&gt; &lt;span class="o"&gt;=&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="nx"&gt;state&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;return&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="na"&gt;favorite&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;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;favorite&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;animal&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Tiger&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="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;state&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;return&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="na"&gt;favorite&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;animal&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;favorite&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;animal&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="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;You find the difference of missing &lt;code&gt;state.favorite&lt;/code&gt; between key of &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;1&lt;/code&gt;.&lt;br&gt;
Migrated store of version 1 already doesn't have &lt;code&gt;fruit&lt;/code&gt; key in &lt;code&gt;Favorite&lt;/code&gt; reducer.&lt;br&gt;
So, you see "I don't like fruit!" message.&lt;/p&gt;

&lt;p&gt;If you want to more playing with the app, you checkout any version what you want.&lt;br&gt;
If you want to know more details about redux-persist, I recommend checking the &lt;a href="https://github.com/rt2zz/redux-persist" rel="noopener noreferrer"&gt;repo&lt;/a&gt;&lt;br&gt;
It's very helpful and well documented.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;redux-persist is very useful library when you think about persist store. &lt;br&gt;
It provides simple and powerful APIs!&lt;/p&gt;

&lt;p&gt;If you find any mistakes or misunderstanding, please pointed it out to me. 🙏&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

&lt;p&gt;Note: After posted this article, I found the article told same theme from redux-persist's README!&lt;br&gt;
It's be helpful too! Please read &lt;a href="https://medium.freecodecamp.org/how-to-use-redux-persist-when-migrating-your-states-a5dee16b5ead" rel="noopener noreferrer"&gt;it&lt;/a&gt; if you need.&lt;/p&gt;

</description>
      <category>react</category>
      <category>redux</category>
      <category>javascript</category>
    </item>
    <item>
      <title>VimConf 2018 Report</title>
      <dc:creator>sasurau4</dc:creator>
      <pubDate>Thu, 29 Nov 2018 11:12:05 +0000</pubDate>
      <link>https://dev.to/sasurau4/vimconf-2018-report-144</link>
      <guid>https://dev.to/sasurau4/vimconf-2018-report-144</guid>
      <description>&lt;h2&gt;
  
  
  What is VimConf?
&lt;/h2&gt;

&lt;p&gt;VimConf is the international conference of Vim held in Japan.&lt;br&gt;
This conference is organized by VimConf Jumbikai that mainly consists of vim-jp members.&lt;br&gt;
I think VimConf is the only one conference about text editors all over the world.&lt;/p&gt;

&lt;p&gt;VimConf 2018 held Nov 24th in Japan.&lt;/p&gt;

&lt;p&gt;The conference is 6th of VimConf and this time is very special and memorable to organizers.&lt;br&gt;
Because the Author of Vim, Mr. Bram Moolenaar, come to Japan and attend the conference!&lt;/p&gt;

&lt;p&gt;The organizers had a dream that they invite him to the conference someday when they held the first VimConf in 2013.&lt;br&gt;
Someone said "just a kidding!" when organizers tell them about that.&lt;br&gt;
But, the dream has come true for six years.&lt;/p&gt;

&lt;p&gt;I'd like to quote the sentence from &lt;a href="https://vimconf.org/2018/" rel="noopener noreferrer"&gt;VimConf 2018 website&lt;/a&gt;. That is the best explanation of  the conference.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;VimConf is a place to share your love of Vim to everyone&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  Contents
&lt;/h2&gt;

&lt;p&gt;I explains a summery of each keynotes, sessions and lighitning talks. Then write my impressions.&lt;br&gt;
If you want to know more about contents, see the movies on youtube or session's slides.&lt;/p&gt;
&lt;h3&gt;
  
  
  Keynotes
&lt;/h3&gt;
&lt;h4&gt;
  
  
  What is the next feature?
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;presenter: Yasuhiro Matsumoto aka mattn&lt;/li&gt;
&lt;li&gt;slide: &lt;a href="https://docs.google.com/presentation/d/e/2PACX-1vTj2uCbuCffhaLVBZE6biI538GG6jMi1INbku-T9q5hu5W0zGLwuibN3m5xbEuqdUFTDnhdhtikPyTi/pub?start=false&amp;amp;loop=false&amp;amp;delayms=3000&amp;amp;slide=id.p" rel="noopener noreferrer"&gt;Keynote - What is the next feature?&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;video: &lt;iframe width="710" height="399" src="https://www.youtube.com/embed/o3NygmN5lHM"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This keynote tell us 2 things. One is why vim-jp started and what they doing. The other is 3 proposals of new feature from mattn!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://vim-jp.org/" rel="noopener noreferrer"&gt;vim-jp&lt;/a&gt; is very famous to Vim users in Japan. I usually refer to the site when I want to know something difficult about Vim. vim-jp seems very active development and discussion for Vim. &lt;br&gt;
I was impressed that mattn said "vim-jp did only two things from started. Feedback to vim dev group about bug and patch, and writing patch."&lt;br&gt;
Today, vim-jp is one of ideal managed OSS community. But what they did is very simple.&lt;/p&gt;

&lt;p&gt;Also I was surprised that Vim became a Web Server in the presentation.&lt;br&gt;
Vim evolved to a Web Application Platform.&lt;br&gt;
If you wonder what was going on the presentation, watch the video!&lt;/p&gt;
&lt;h4&gt;
  
  
  Vim: From hjkl to a platform for plugins
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;presenter: Bram Moolenaar&lt;/li&gt;
&lt;li&gt;slide: &lt;a href="https://vimconf.org/2018/slides/Vim_From-hjkl-to-a-platform-for-plugins.pdf" rel="noopener noreferrer"&gt;Vim: From hjkl to a platform for plugins&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;video: &lt;iframe width="710" height="399" src="https://www.youtube.com/embed/ES1L2SPgIDI"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mr.Bram is the author of Vim. He talked about 3 things, Vim's history, plugin performance tuning and (plugin support poll)[&lt;a href="https://github.com/vim/vim/issues/3573" rel="noopener noreferrer"&gt;https://github.com/vim/vim/issues/3573&lt;/a&gt;]&lt;br&gt;
He explained how Vim evolved from the start to the recent. I was suprised to how big PDP-11 was. I thought that is refrigerator rather than a computer.&lt;br&gt;
Also, I was excited about new feature ideas like official dependency manager, Compile Vim script etc.&lt;br&gt;
I was happy to hear the keynote directly from Mr.Bram!&lt;/p&gt;
&lt;h3&gt;
  
  
  Sessions
&lt;/h3&gt;
&lt;h4&gt;
  
  
  Migrating plugins to standard features
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;presenter: daisuzu&lt;/li&gt;
&lt;li&gt;slide: &lt;a href="https://speakerdeck.com/daisuzu/migrating-plugins-to-standard-features" rel="noopener noreferrer"&gt;Migrating plugins to standard features&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;video: &lt;iframe width="710" height="399" src="https://www.youtube.com/embed/1Lfx7vck7So"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;How many plugins do you install to vim? If you count them and you think it may be a bit too much, this session is very  helpful.&lt;br&gt;
The session told me that vim have how various functions in default. Vim seems poor at first glance, but they are just hiding. The more you use vim, the more you find them!&lt;br&gt;
I decided check my installed plugins and organize them well someday.&lt;/p&gt;
&lt;h4&gt;
  
  
  Modes
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;presenter: Tatsuhiro Ujihisa&lt;/li&gt;
&lt;li&gt;slide: &lt;a href="https://speakerdeck.com/ujihisa/vimconf-2018" rel="noopener noreferrer"&gt;Modes&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;video: &lt;iframe width="710" height="399" src="https://www.youtube.com/embed/3uUYf7eiI8Q"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This session described the vim implementation by demo with GNU Project Debugger. I didn't understand the session content perfectly, but felt the convenience of &lt;code&gt;:Termdebug&lt;/code&gt;.&lt;br&gt;
I was surprised to the demo because I didn't think Vim support step by step execution!&lt;/p&gt;
&lt;h4&gt;
  
  
  A day in the life of (ordinary) Vimmer
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;presenter: OKURA Masafumi&lt;/li&gt;
&lt;li&gt;slide: &lt;a href="https://speakerdeck.com/okuramasafumi/a-day-in-the-life-of-the-ordinary-vimmer" rel="noopener noreferrer"&gt;A day in the life of (ordinary) Vimmer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;video: &lt;iframe width="710" height="399" src="https://www.youtube.com/embed/H_gjNweFdpc"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This session explained tips from an one ordinary day of presenter. Demos were not succeeded, tips were very practical to use from tomorrow!&lt;/p&gt;
&lt;h4&gt;
  
  
  Modern editor-independent development environment for PHP
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;presenter: USAMI Kenta&lt;/li&gt;
&lt;li&gt;slides: &lt;a href="https://niconare.nicovideo.jp/watch/kn3635" rel="noopener noreferrer"&gt;Modern editor-independent development environment for PHP&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;video: &lt;iframe width="710" height="399" src="https://www.youtube.com/embed/LA6ZH_GdzNI"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This session described about today's development environment focusing on PHP. I didn't know that PHP has a lot of funcsions lke abstract class, trait interface, etc until this session.&lt;br&gt;
I recognized VimConf is a conference of Text editor. If vim was the only text editor in the world, did vim evolved so far? I don't think so. Text editors have evolved as they mutually influence each other.&lt;br&gt;
So, we are friends that wish to become text editors more useful and convenient.&lt;/p&gt;
&lt;h4&gt;
  
  
  Effective Modern Vim scripting
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;presenter: Alisue&lt;/li&gt;
&lt;li&gt;slide: &lt;a href="https://docs.google.com/presentation/d/e/2PACX-1vQKaWJY8w6QJpebvuzg334RfLDbQHv4-J_06yFxdTzLrrjhE_y5iuzA-JxCCuFdUAZQB2QQsidF_mys/pub?start=false&amp;amp;loop=false&amp;amp;delayms=3000&amp;amp;slide=id.p" rel="noopener noreferrer"&gt;Effective Modern Vim scripting&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;video: &lt;iframe width="710" height="399" src="https://www.youtube.com/embed/J5BX1FXnKBw"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are interested in creating vim plugin, I strongly recommend to watch the video and see the slide.&lt;br&gt;
The presenter explained how to write modern vim script step by step. This was very easy to understand.&lt;br&gt;
I want to fall into dark side motivated by the presentation.&lt;br&gt;
See you again at the dark side!&lt;/p&gt;
&lt;h4&gt;
  
  
  Oni - The GUI-fication of Neovim
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;presenter: Akin&lt;/li&gt;
&lt;li&gt;slide: ?&lt;/li&gt;
&lt;li&gt;video: &lt;iframe width="710" height="399" src="https://www.youtube.com/embed/MCBHz9o6gAg"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Have you ever thought vim become an IDE? I have.&lt;br&gt;
If you want to make vim as IDE, you need to spend a lot of time and customize &lt;code&gt;.vimrc&lt;/code&gt;.&lt;br&gt;
Manage &lt;code&gt;.vimrc&lt;/code&gt; is very very excited but it's time consuming.&lt;br&gt;
So, Oni solve the problem. You can use IDE like Vim just install Oni!&lt;br&gt;
It's very easy and fantastic. Why don't you try Oni?&lt;/p&gt;
&lt;h4&gt;
  
  
  Vim ported to WebAssembly
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;presenter: rhysd&lt;/li&gt;
&lt;li&gt;slide: &lt;a href="https://speakerdeck.com/rhysd/vim-ported-to-webassembly-vimconf-2018" rel="noopener noreferrer"&gt;Vim ported to WebAssembly&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;video: &lt;iframe width="710" height="399" src="https://www.youtube.com/embed/IczXWo2-MWI"&gt;
&lt;/iframe&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We use Vim everywhere for example Mac, Linux and Windows etc..&lt;br&gt;
Today, new wave is coming and we also use Vim on Web Browser!&lt;br&gt;
Try &lt;a href="https://rhysd.github.io/vim.wasm/" rel="noopener noreferrer"&gt;https://rhysd.github.io/vim.wasm/&lt;/a&gt;&lt;br&gt;
This presentation how the presenter ported Vim to WebAssembly. It seems magic of WebAssembly.&lt;br&gt;
I'm looking forward to the future work of wasm.vim!&lt;/p&gt;
&lt;h3&gt;
  
  
  LTs
&lt;/h3&gt;

&lt;p&gt;Lighitning Talks were  also very excited. &lt;br&gt;
Talks are very short but contains various things!&lt;br&gt;
See the slides for more details.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://takaxp.github.io/event/vimconf2018.html" rel="noopener noreferrer"&gt;A brief introduction to vim-orgmode&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gitpitch.com/notomo/slides/vimconf-2018-lt#/" rel="noopener noreferrer"&gt;Neovim as a web browser controller&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://speakerdeck.com/rattcv/vimphone2018" rel="noopener noreferrer"&gt;VimPhone2018&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.slideshare.net/Shougo/differences-between-nvim-and-vim-full-version" rel="noopener noreferrer"&gt;Differences between Nvim and Vim in 5 minites&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.slideshare.net/k-takata/the-vimhistory-repository-vimconf-2018-lightning-talk" rel="noopener noreferrer"&gt;The vim-history repository&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;videos: &lt;iframe width="710" height="399" src="https://www.youtube.com/embed/3bJNLu0AkC4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  After party
&lt;/h3&gt;

&lt;p&gt;After party was awesome. Participants talked about a lot of things like Emacs, programing languages, their work, Of course Vim in Japanese and English. Foods and drinks were delicious.&lt;br&gt;
I satisfied with the after party.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;VimConf 2018 was great and awesome. We didn't know where and when the next VimConf 't will be held.&lt;br&gt;
I can't wait for the next VimConf!&lt;/p&gt;

&lt;p&gt;Thanks for Mr.Bram, organizers, staffs and all related people!&lt;br&gt;
Thank you for your reading. If you find any mistakes about this article, feel free to point it out.&lt;/p&gt;

&lt;p&gt;Finally, I'd like to say every one.&lt;/p&gt;

&lt;p&gt;"Happy Vimming!"&lt;/p&gt;

&lt;p&gt;P.S. Updated at Dec 7 adding videos. You can check all videos about VimConf 2018 at &lt;a href="https://www.youtube.com/channel/UCSk7TnXVB0BMtY416dmFMuw/featured" rel="noopener noreferrer"&gt;vim-jp youtube channel&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>vim</category>
      <category>neovim</category>
      <category>conferences</category>
    </item>
    <item>
      <title>metro v0.48.1 needs react-native v0.53.3 when run test with jest</title>
      <dc:creator>sasurau4</dc:creator>
      <pubDate>Sun, 28 Oct 2018 06:55:39 +0000</pubDate>
      <link>https://dev.to/sasurau4/metro-v0481-needs-react-native-v0533-when-run-test-with-jest-2b6o</link>
      <guid>https://dev.to/sasurau4/metro-v0481-needs-react-native-v0533-when-run-test-with-jest-2b6o</guid>
      <description>

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;If you met a problem that test fail unexpectedly after upgrading metro-react-native-babel-preset v 0.48.1, you try to upgrade react-native v0.57.3.&lt;/p&gt;

&lt;h2&gt;
  
  
  Jest failed situation
&lt;/h2&gt;

&lt;p&gt;One day, I upgraded many libraries. After upgrade, I ran &lt;code&gt;yarn test&lt;/code&gt; and saw jest failed with below error message.&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt; TypeError: Cannot &lt;span class="nb"&gt;read &lt;/span&gt;property &lt;span class="s1"&gt;'default'&lt;/span&gt; of undefined
      at new Icon &lt;span class="o"&gt;(&lt;/span&gt;node_modules/react-native-vector-icons/lib/create-icon-set.js:42:389&lt;span class="o"&gt;)&lt;/span&gt;
      ...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;On my environment.&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OS: Ubuntu 18.04
node: v11.0.0
react-native: v0.57.2
react-native-elements: v0.19.1
metro-react-native-babel-preset: v0.48.1
react-native-vector-icons: v6.0.2
@babel/runtime: v7.1.2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;my package.json&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="s2"&gt;"jest"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"preset"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"react-native"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"transform"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="s2"&gt;"^.+&lt;/span&gt;&lt;span class="err"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;.js$"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;rootDir&amp;gt;/node_modules/react-native/jest/preprocessor.js"&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;For more details, see my &lt;a href="https://github.com/sasurau4/jestBabelTransform/tree/jest-reproduce"&gt;reproduce repository&lt;/a&gt;&lt;br&gt;
Umm, why jest test failed?&lt;/p&gt;

&lt;h2&gt;
  
  
  The reason why jest failed
&lt;/h2&gt;

&lt;p&gt;It is because that metro changed the default config of using @babel/runtime or not when jest.&lt;br&gt;
This config affects babel use plugin-tranform-runtime or not.&lt;/p&gt;

&lt;p&gt;metro-react-native-babel-preset at v0.48.1 use plugin-transform-runtime by default.&lt;br&gt;
&lt;a href="https://github.com/facebook/metro/pull/285/files#diff-691dcb134bb2a1276f7a1fea8728f634L150"&gt;https://github.com/facebook/metro/pull/285/files#diff-691dcb134bb2a1276f7a1fea8728f634L150&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But preprocessor.js at v0.57.2 has only disableBabelRuntime option.&lt;br&gt;
&lt;a href="https://github.com/facebook/react-native/blob/v0.57.2/jest/preprocessor.js#L55"&gt;https://github.com/facebook/react-native/blob/v0.57.2/jest/preprocessor.js#L55&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, our javascript code are transpiled by babel with plugin-transform-runtime.&lt;/p&gt;

&lt;p&gt;Upgrade react-native to v0.57.3 solve the problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Detailed question: why jest fails with @babel/runtime?
&lt;/h2&gt;

&lt;p&gt;I didn't understand the difference with @babel/runtime or not.&lt;br&gt;
I read &lt;a href="https://babeljs.io/docs/en/babel-runtime"&gt;https://babeljs.io/docs/en/babel-runtime&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It's sense for me. But still remain unknown point.&lt;br&gt;
My situation has &lt;code&gt;@babel/runtime&lt;/code&gt; in dependencies, why the property 'default' of undefined?&lt;/p&gt;

&lt;p&gt;So, I investigated transpiled codes by modifying preprocessor's code.&lt;/p&gt;

&lt;p&gt;Jest failed at &lt;code&gt;create-icon-set.js&lt;/code&gt; in &lt;code&gt;react-native-vector-icons package&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;First, I change the file of preprocessor.js to intercept generated code and write it to file.&lt;br&gt;
&lt;a href="https://github.com/sasurau4/jestBabelTransform/tree/analyze-babel-and-jest-collaboration/intercepted"&gt;Here&lt;/a&gt; is generated codes.&lt;br&gt;
Babel generated code is minified and not human-readble, so the repo codes are formatted by prettier.&lt;/p&gt;

&lt;p&gt;The deference of two files is same as babel's document explained.&lt;/p&gt;

&lt;p&gt;I matched generated code and error massage from jest.&lt;br&gt;
The problem is at &lt;a href="https://github.com/sasurau4/jestBabelTransform/blob/analyze-babel-and-jest-collaboration/intercepted/babeled-by-jest-with-runtime.js#L82"&gt;line 82 in babeled-by-jest-with-runtime.js&lt;/a&gt;&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;...&lt;/span&gt;
        &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;_getPrototypeOf2&lt;/span&gt; &lt;span class="o"&gt;=&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="nx"&gt;_getPrototypeOf2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="nx"&gt;Icon&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nx"&gt;call&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;apply&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;This code correspond to &lt;a href="https://github.com/oblador/react-native-vector-icons/blob/master/lib/create-icon-set.js#L43"&gt;static propTypes in react-native-vector-icons&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Second, I transpile &lt;code&gt;create-icon-set.js&lt;/code&gt;by &lt;code&gt;@babal\cli&lt;/code&gt;.&lt;br&gt;
The result is &lt;a href="https://github.com/sasurau4/jestBabelTransform/blob/analyze-babel-and-jest-collaboration/babeled/create-icon-set-enabled-runtime.js"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The result is &lt;a href="https://github.com/sasurau4/jestBabelTransform/blob/analyze-babel-and-jest-collaboration/babeled/create-icon-set-enabled-runtime.js"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The different point of result is below.&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;...&lt;/span&gt;
        &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;_getPrototypeOf2&lt;/span&gt; &lt;span class="o"&gt;=&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="nx"&gt;_getPrototypeOf3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="nx"&gt;Icon&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nx"&gt;call&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;apply&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;babel by jest code is &lt;code&gt;_getPrototypeOf2.default&lt;/code&gt;, babel by cli is &lt;code&gt;_getPrototypeOf3.default&lt;/code&gt;.&lt;br&gt;
This difference may cause of jest fail.&lt;/p&gt;

&lt;p&gt;I'm not convinced because I don't fully understand about jest and babel.&lt;/p&gt;

&lt;p&gt;Also, metro use babel runtime from &lt;a href="https://github.com/facebook/metro/commit/8932a9caa8f9ffe82160f2da25342a0bde3bbb26"&gt;this commit&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/facebook/react-native/pull/21283"&gt;From this issue&lt;/a&gt;, jest still use old regeneratorRuntime from &lt;a href="https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime"&gt;regeneratro-runtime&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I think it affects the above result.&lt;/p&gt;

&lt;p&gt;The full result of analyze is &lt;a href="https://github.com/sasurau4/jestBabelTransform/tree/analyze-babel-and-jest-collaboration"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'll happy that this article help you when you show jest fail.&lt;br&gt;
If you found the cause of the proble or my misunderstood, tell me about it!&lt;br&gt;
Thanks for your reading!&lt;/p&gt;


</description>
      <category>reactnative</category>
      <category>babel</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Create mock API server with Authorization by Micro, GraphQL</title>
      <dc:creator>sasurau4</dc:creator>
      <pubDate>Thu, 02 Aug 2018 13:24:16 +0000</pubDate>
      <link>https://dev.to/sasurau4/create-mock-api-server-with-authorization-by-micro-graphql-51h8</link>
      <guid>https://dev.to/sasurau4/create-mock-api-server-with-authorization-by-micro-graphql-51h8</guid>
      <description>&lt;p&gt;In these days, Modern web application divided into 2 parts.&lt;br&gt;
One is client side such as web browser, iOS or Android application.&lt;br&gt;
Another is server side.&lt;br&gt;
They are connected with web API.&lt;/p&gt;

&lt;p&gt;If we define API schema like GraphQL or Swagger, this Architecture enable us to develop frontend and backend in parallel.&lt;/p&gt;

&lt;p&gt;Parallel development seems good and faster than other methods, but it cause problem about frontend development.&lt;br&gt;
How to develop frontend when no backend implementation?&lt;/p&gt;

&lt;p&gt;One answer is mock backend server from schema. &lt;/p&gt;

&lt;p&gt;So, This article introduce how to mock GraphQL server with json-web-token authorization.&lt;br&gt;
The code is &lt;a href="https://github.com/sasurau4/mock-micro-graphql-auth"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tools
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/zeit/micro-dev"&gt;micro-dev&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/apollographql/apollo-server/tree/master/packages/apollo-server-micro"&gt;apollo-server-micro&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/auth0/node-jsonwebtoken"&gt;node-jsonwebtoken&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The reason why I choice micro as mock-server
&lt;/h2&gt;

&lt;p&gt;micro-dev features are very useful.&lt;br&gt;
Hot reloading make us faster to write mock server, Pretty logs in stdout are very convenient for debugging and some other feature are good.&lt;/p&gt;

&lt;p&gt;Of course, we can also use same features as micro-dev with express-server. &lt;br&gt;
To enable hot reload, install webpack and some related npm modules, modify webpack config and some others.&lt;br&gt;
To enable pretty log, apply middleware, customize morgan output. &lt;br&gt;
They are a bit complicated.&lt;/p&gt;

&lt;p&gt;So, micro-dev has these features by default. &lt;/p&gt;

&lt;h2&gt;
  
  
  Recipe
&lt;/h2&gt;

&lt;h3&gt;
  
  
  All routes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/auth/login&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;loginHandler&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/graphql&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;graphqlHandler&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/graphql&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;graphqlHandler&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;Only two routes one is for login, another is graphql.&lt;br&gt;
micro doesn't have router itself, so use micro-router.&lt;br&gt;
This is very simple!&lt;/p&gt;

&lt;h3&gt;
  
  
  Login Handler
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;loginHandler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&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;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&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;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// check correct user's email and password set&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;isUser&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;password&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;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;401&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Incorrect email or password&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;access_token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;createToken&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;password&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;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;access_token&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;LoginHandler simply check whether email and password in request body is correct combination or not.&lt;br&gt;
If pass the check, send 200 with access_token.&lt;/p&gt;

&lt;p&gt;More details about authorization with jwt, see &lt;a href="https://github.com/sasurau4/mock-micro-graphql-auth/blob/master/auth.js"&gt;auth.js&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  GraphQL Handler
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;apolloHandler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;apolloServer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createHandler&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;graphqlHandler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&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="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;authorization&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// check authorization format check&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;authorization&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;authorization&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; &lt;/span&gt;&lt;span class="dl"&gt;'&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="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Bearer&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;return&lt;/span&gt; &lt;span class="nx"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;401&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Error in authorization format&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="c1"&gt;// check token&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;error&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;verifyToken&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;authorization&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; &lt;/span&gt;&lt;span class="dl"&gt;'&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="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&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;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;e&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;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&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;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;401&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Error access_token is revoked&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;return&lt;/span&gt; &lt;span class="nx"&gt;apolloHandler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&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;GraphQL handler simply check whether Bearer token in request header is valid or not.&lt;br&gt;
If pass the check, it return apolloHandler that is defined in apollo-server-micro.&lt;/p&gt;

&lt;p&gt;GraphQL resovers and schemas are ommited this article, see &lt;a href="https://github.com/sasurau4/mock-micro-graphql-auth/blob/master/apollo-server.js"&gt;apollo-server.js&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Note: &lt;br&gt;
You want to see GraphQL playgruond in your browser for trying queries.&lt;br&gt;
Adding some checks and early return of apolloHandler.&lt;br&gt;
In my  &lt;a href="https://github.com/sasurau4/mock-micro-graphql-auth"&gt;repo&lt;/a&gt;, check user-agent as Chrome or not.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Micro-dev server using API mock server is very good for developmer experience.&lt;br&gt;
No config, Good looks log, Hot reloading.&lt;/p&gt;

&lt;p&gt;If you interested in micro, see &lt;a href="https://github.com/amio/awesome-micro"&gt;awesome-micro&lt;/a&gt;!&lt;br&gt;
Thanks for reading.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reference
&lt;/h2&gt;

&lt;p&gt;This article inspired by below articles. Thanks!&lt;br&gt;
&lt;a href="https://qiita.com/acro5piano/items/d421e2d41ee15e20e1de"&gt;https://qiita.com/acro5piano/items/d421e2d41ee15e20e1de&lt;/a&gt;&lt;br&gt;
&lt;a href="https://qiita.com/oz4you/items/3f3223048bd2109de47b"&gt;https://qiita.com/oz4you/items/3f3223048bd2109de47b&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>micro</category>
      <category>javascript</category>
      <category>graphql</category>
    </item>
  </channel>
</rss>
