<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Vitalii Elenhaupt on Medium]]></title>
        <description><![CDATA[Stories by Vitalii Elenhaupt on Medium]]></description>
        <link>https://medium.com/@veelenga?source=rss-f9b66ca2f572------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*_Ox4dLduRhmwXWVk.jpg</url>
            <title>Stories by Vitalii Elenhaupt on Medium</title>
            <link>https://medium.com/@veelenga?source=rss-f9b66ca2f572------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 18:53:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@veelenga/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Linting Crystal on Codacy]]></title>
            <link>https://medium.com/@veelenga/linting-crystal-on-codacy-4c19aa8216df?source=rss-f9b66ca2f572------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c19aa8216df</guid>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Vitalii Elenhaupt]]></dc:creator>
            <pubDate>Wed, 06 Mar 2019 11:30:44 GMT</pubDate>
            <atom:updated>2019-03-06T11:30:44.841Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://www.codacy.com/">Codacy</a> is an automated code review platform. It helps quickly identifying the issues and code smell in hosted repositories (GitHub, Bitbucket etc). The difference between Codacy and CI tools is that it does not require any initial configuration and can visually explain the problem and even suggest a fix.</p><p>I was excited to see Codacy started to support <a href="https://crystal-lang.org/">Crystal programming language</a>.</p><p>This short guide shows how quickly any developer can start linting Crystal repositories on Codacy platform. Only 3 steps, let’s get started.</p><ol><li>Adding a project for processing as easy as just searching one and clicking a button for confirmation:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uj8z6d4ANnhL-ZCKqESqkA.png" /></figure><p>2. Once it is added, Codacy starts cloning and analyzing the project. It could take a couple of minutes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mo4yUMuU5y7FJqSBrdcPTw.png" /></figure><p>3. When Codacy finishes it’s work, results can be reviewed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9K5KZsbxckxAUdGfDSmwaQ.png" /></figure><p>That’s it, we automated code review process of Crystal repository using Codacy platform. Each new commit and pull request will be automatically analyzed.</p><p>Hope you will find it helpful. Cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c19aa8216df" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HEIF converter on AWS Lambda]]></title>
            <link>https://medium.com/@veelenga/heif-converter-on-aws-lambda-3674afb4e59d?source=rss-f9b66ca2f572------2</link>
            <guid isPermaLink="false">https://medium.com/p/3674afb4e59d</guid>
            <category><![CDATA[imagemagick]]></category>
            <category><![CDATA[heif]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[image-processing]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Vitalii Elenhaupt]]></dc:creator>
            <pubDate>Sat, 16 Feb 2019 22:10:56 GMT</pubDate>
            <atom:updated>2019-03-07T11:04:21.603Z</atom:updated>
            <content:encoded><![CDATA[<h3>HEIC converter on AWS Lambda</h3><p>In this story, you will find how to create a sample AWS Lambda which converts <a href="https://en.wikipedia.org/wiki/High_Efficiency_Image_File_Format"><strong>HEIF</strong></a> images to <a href="https://en.wikipedia.org/wiki/JPEG"><strong>JPEG</strong></a>. We will build static binaries and properly configure AWS Lambda runtime to use it. Also, we will use docker to locally run and test our lambda function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_toPRoqT3Folv_v9N-gMTw.png" /><figcaption>HEIC converter on AWS Lambda</figcaption></figure><blockquote>HEIF stands for High Efficient Image Format. It’s a modern image format that is a replacement for JPEG, and often has the .HEIC file extension. The HEIF format produces images with a smaller file size and higher image quality than the older JPEG standard. In other words, HEIF is just better than JPEG.</blockquote><p><a href="https://www.imagemagick.org/">ImageMagick</a> supports HEIF format, so that’s possible to do a simple conversion via NodeJS (or any other runtimes). The main challenge here is that the default installation of ImageMagick doesn’t support HEIF, thus it is not available at AWS Lambda runtime by default. Fortunately, we are able to compile a needed binary and upload it together with the lambda function.</p><p>Since we want to convert HEIF images using AWS Lambda, we will need to compile those binaries in the same environment lambda will be running on (and it’s Linux AMI).</p><h3>Environment setup</h3><p>At first, we need to create a folder for our lambda function:</p><pre>$ mkdir aws-heic-converter &amp;&amp; cd aws-heic-converter</pre><p>Of source, the best way to emulate AWS Lambda runtime is to create a new EC2 instance of Linux AMI and SSH there. However, in most situation, you don’t need that. The alternative is <a href="https://github.com/lambci/docker-lambda">docker-lambda</a> — a sandboxed local environment that replicates the live AWS Lambda environment <strong>almost identically</strong>. So let&#39;s just spin up a new container with latest, for now, NodeJS runtime:</p><pre><br>$ docker run -it -v $PWD:/var/task lambci/lambda:build-nodejs8.10 bash</pre><p>The command above pulls the pre-built docker image and opens a shell. Yeah, it is just that simple!</p><p>We can quickly test our environment and ensure we can build our binaries:</p><pre>$ uname -a<br>Linux 477c92edf189 4.9.125-linuxkit #1 SMP Fri Sep 7 08:20:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux</pre><pre>$ whoami<br>root</pre><pre>$ make -version<br>GNU Make 3.82<br>Built for x86_64-redhat-linux-gnu<br>Copyright (C) 2010  Free Software Foundation, Inc.<br>License GPLv3+: GNU GPL version 3 or later &lt;<a href="http://gnu.org/licenses/gpl.html">http://gnu.org/licenses/gpl.html</a>&gt;<br>This is free software: you are free to change and redistribute it.<br>There is NO WARRANTY, to the extent permitted by law.</pre><p><strong>Note: </strong>AWS Lamba runtime (and this docker-emulated environment) already hasImage Magick installed as well as some dependencies (<strong>libpng</strong>, <strong>libjpeg</strong> etc.) This simplifies the work we need to do since we just need to add support of <strong>libheif</strong>.</p><h3>Build libheif &amp; libde265</h3><p>To be able to work with HEIF images, ImageMagick delegates it’s work to <a href="https://github.com/strukturag/libheif">libheif</a> library, which on itself depends on <a href="https://github.com/strukturag/libde265">libde265</a> h.265 codec implementation. That means we will need to build both those libraries first before building new ImageMagick binary.</p><p>We mounted the lambda source directory to /var/task, which’s where the lambda function deployed via AWS Console. Let’s create build folder there to download and track downloaded assets:</p><pre>$ cd /var/task &amp;&amp; mkdir build &amp;&amp; cd build</pre><p>Now, download the libde265 release archive and following readme instructions, compile and install it:</p><pre>$ curl -L <a href="https://github.com/strukturag/libde265/releases/download/v1.0.3/libde265-1.0.3.tar.gz">https://github.com/strukturag/libde265/releases/download/v1.0.3/libde265-1.0.3.tar.gz</a> | tar zx<br>$ cd libde265-1.0.3<br>$ ./autogen.sh &amp;&amp; ./configure &amp;&amp; make &amp;&amp; make install</pre><pre>$ cd ../</pre><p>The next one is libheif. The procedure is almost identical, however, we need to provide build flags to let the linker find libde265 library we just built:</p><pre>$ curl -L <a href="https://github.com/strukturag/libheif/releases/download/v1.3.2/libheif-1.3.2.tar.gz">https://github.com/strukturag/libheif/releases/download/v1.3.2/libheif-1.3.2.tar.gz</a> | tar zx<br>$ cd libheif-1.3.2</pre><pre>$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig<br>$ export LDFLAGS=-L/usr/local/lib<br>$ export CPPFLAGS=-I/usr/local/include/libde265</pre><pre>$ ./autogen.sh &amp;&amp; ./configure &amp;&amp; make &amp;&amp; make install</pre><pre>$ cd ../</pre><p>Both libraries are built and placed to /usr/local/lib. ImageMagick will need only two shared libraries (technically speaking, only one — libheif.so , but it depends on libde265, so it will require another shared library: libde265.so.0).</p><p>Let’s copy needed ones to our mounted directory into /var/task/lib:</p><pre>$ cd /var/task &amp;&amp; mkdir lib<br>$ cp /usr/local/lib/libde265.so.0 lib/<br>$ cp /usr/local/lib/libheif.so.1 lib/</pre><h3>Build ImageMagick with HEIF support</h3><p>We have built required dependencies so let’s finally build the image magick static binary. To do that we are going to follow the same approach as before, but with three small differences:</p><ol><li>Provide build flags to let the linker find the libheif library.</li><li>Use --enable-static=yes flag to build a static binary.</li><li>Pass --with-heic flag, which is needed to enable HEIF support.</li></ol><pre>$ cd /var/task/build</pre><pre>$ curl -L <a href="https://imagemagick.org/download/ImageMagick-7.0.8-27.tar.gz">https://imagemagick.org/download/ImageMagick-7.0.8-27.tar.gz</a> | tar zx<br>$ cd ImageMagick-7.0.8-27</pre><pre>$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig<br>$ export LDFLAGS=-L/usr/local/lib<br>$ export CPPFLAGS=-I/usr/local/include/libheif</pre><pre>$ ./configure --prefix=/etc/imagemagick --enable-shared=no --enable-static=yes --with-heic<br>$ make &amp;&amp; make install</pre><p>Installation is done to/etc/imagemagick directory. Let’s copy binaries to our lambda directory and verify whether it works and supports HEIF (a list of supported features at the bottom):</p><pre>$ cp -r /etc/imagemagick/bin /var/task/</pre><pre>$ /var/task/bin/magick -version<br>Version: ImageMagick 7.0.8-27 Q16 x86_64 2019-02-15 <a href="https://imagemagick.org/">https://imagemagick.org</a><br>Copyright: © 1999-2019 ImageMagick Studio LLC<br>License: <a href="https://imagemagick.org/script/license.php">https://imagemagick.org/script/license.php</a><br>Features: Cipher DPC HDRI OpenMP<br>Delegates (built-in): bzlib fontconfig freetype heic jng jpeg lcms lzma png tiff x xml zlib</pre><p>Perfect, it works. However, to be sure it is able to convert HEIF images we need to try converting one. So we could copy some HEIF image to our lambda source directory, re-run the container (with mounted source folder) and run magick convert command:</p><pre>$ /var/task/bin/magick convert assets/example.heic example.jpeg</pre><p>Now we can safely remove build assets from our source folder. Only the binary and library once should left:</p><pre>$ cd /var/task<br>$ rm -rf build<br>$ ls<br>bin lib</pre><h3>Writing Lambda</h3><p>What should the lambda function do? To simplify the things, let it just convert HEIF image example which is existed on the filesystem to JPEG.</p><p>To do that we are going to use <a href="https://github.com/aheckmann/gm">gm</a> node package, which is simply a wrapper over ImageMagick. The code to convert images is quite simple: read and write an image with a different extension. You can follow a huge list of examples in the readme if you want to do more than that.</p><p>But, if you remember, we need to use a pre-built ImageMagick binary, which is available in bin folder and depends on libraries in lib folder. Fortunately, AWS Lambda allows changing runtime environment variables, so we can append paths to our binary and libs to the environment.</p><p>Let’s see how the hole lambda looks:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5bb190afa2daa75a0b30fd3732860282/href">https://medium.com/media/5bb190afa2daa75a0b30fd3732860282/href</a></iframe><p>Let’s use docker-lambda again to test what we built.</p><pre>docker run --rm -v $PWD:/var/task lambci/lambda:nodejs8.10 index.handler &#39;{&quot;img&quot;: &quot;assets/example.heic&quot;}&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RiOW-vHB-nx_Vi1c4pNnCw.png" /></figure><p>A couple of things to note here:</p><ol><li>We passed the path to the image as an argument to the function (in json format): &#39;{&quot;img&quot;: &quot;assets/example.heic&quot;}&#39;</li></ol><p>2. Lambda took <strong>400 ms</strong> of time and used <strong>33 MB</strong> of memory.</p><p>3. Our image is successfully converted and example.jpeg is created.</p><h3>Wrapup</h3><p>In this article we did:</p><ol><li>Built libde265 shared library, which is h.265 codec implementation and is a libheif’s dependency.</li><li>Built libheif shared library, which is HEIF file format decoder and is ImageMagick’s dependency.</li><li>Built ImageMagick static binary with HEIF support.</li><li>Wrote AWS Lambda function, which uses pre-built ImageMagick static binary and converts HEIF images to JPEG.</li><li>Run and tested built AWS Lambda function locally in the emulated docker environment.</li></ol><p>This was just an example of how powerful infrastructure over Lambdas is and what customizations could be done the let it quickly work.</p><p>The sample repo can be found on <a href="https://github.com/veelenga/aws-heic-converter">GitHub</a>.</p><p>Hope you found it helpful. Cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3674afb4e59d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy Ember.js App to GitHub Pages with Travis]]></title>
            <link>https://medium.com/@veelenga/deploy-ember-js-app-to-github-pages-via-travis-262183e816e6?source=rss-f9b66ca2f572------2</link>
            <guid isPermaLink="false">https://medium.com/p/262183e816e6</guid>
            <category><![CDATA[ember]]></category>
            <category><![CDATA[github-pages]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[deployment]]></category>
            <dc:creator><![CDATA[Vitalii Elenhaupt]]></dc:creator>
            <pubDate>Fri, 25 May 2018 11:15:22 GMT</pubDate>
            <atom:updated>2018-05-25T11:38:10.377Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*2qm2xwilIdgPfm35TX5iyw.jpeg" /></figure><p><a href="https://www.emberjs.com/">Ember.js</a> is a known JavaScript framework for ambitious web developers. In contrast to many other frameworks, Ember is focused on the productivity and the speed of the development.</p><p>Out of the box Ember provides a really easy way to build the application into the distro, so the sharing or deployment is not a pain as well. Ember allows to create scalable single-page web applications as well as much more complex apps, so it might be a common task to deploy a hobby project to <a href="https://pages.github.com/">GitHub Pages</a>.</p><h3>Deploy with ember-cli</h3><p><a href="https://github.com/poetic/ember-cli-github-pages">ember-cli-github-pages</a> is a nice addon that adds a new command to your ember-cli. Having that, the app can be deployed running few commands in the console:</p><pre>$ git checkout master<br>$ ember github-pages:commit --message &quot;First release 🚀&quot;</pre><p>But what if we want to deploy automatically, let’s say on every change pushed to master branch of the GitHub repository? <a href="https://travis-ci.org/">Travis CI</a> will help!</p><h3>Deploy with Travis</h3><ol><li>Adjust .travis.yml file:</li></ol><pre># .travis.yml</pre><pre># ...</pre><pre>script:<br>  - npm run lint:js<br>  - npm test<br>  - npm run build -- -prod # build app and prepare dist folder</pre><pre># deploy master branch to GitHub pages<br>deploy:<br>  provider: pages<br>  skip-cleanup: true<br>  github-token: $GITHUB_TOKEN<br>  keep-history: true<br>  on:<br>    branch: master<br>  local-dir: dist<br>  verbose: true</pre><p>We added two important changes here.</p><p>First is npm run build -- -prod(added to script section), which prepares production dist folder with all needed assets and html files. That command is equivalent to ember build -prod.</p><p>Second is a deploy section. More of it <a href="https://docs.travis-ci.com/user/deployment/pages/">here</a>. But, talking in few words, it basically will check-in the dist folder to gh-pages branch of the repo, so the app will go live at https://GITHUB_USERNAME.github.io/REPOSITORY_NAME .</p><p>2. Add GitHub’s personal access token to the Travis CI</p><p>Travis CI wants to have the permissions to deploy the app to the GitHub pages. To allow it, we just need to add <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/">a personal access token</a> to Travis CI project config:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c5k6ncZOJ_EWnDTOhKjnvw.png" /></figure><p>3. Change app’s root url</p><p>Above we configured our app to be deployed to https://GITHUB_USERNAME.github.io/REPOSITORY_NAME . That means, our app’s root url is /REPOSITORY_NAME (and not /, which is default in a new Ember App). To handle it, the Ember App should use a new root url. Change it in config/environment.js file:</p><pre>// config/environment.js</pre><pre>if (environment === &#39;production&#39;) {<br>  ENV.rootURL = &#39;/REPOSITORY_NAME/&#39;;<br>}</pre><p>That’s basically, it. Push a new change to master branch and find your ambitious app at https://GITHUB_USERNAME.github.io/REPOSITORY_NAME .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=262183e816e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Displaying Rails flash messages with React]]></title>
            <link>https://medium.com/@veelenga/displaying-rails-flash-messages-with-react-5f82982f241c?source=rss-f9b66ca2f572------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f82982f241c</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Vitalii Elenhaupt]]></dc:creator>
            <pubDate>Sat, 04 Feb 2017 18:47:18 GMT</pubDate>
            <atom:updated>2017-02-05T08:09:13.343Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tR7DdtgNq_hEABhr5BxctA.gif" /></figure><p>Rails has a nice and useful mechanism to communicate to user via <a href="http://api.rubyonrails.org/classes/ActionDispatch/Flash.html">flash messages</a>. By default these messages come from backend and are injected into the page while rendering the view.</p><p>But what if we want to show a client side message ? Or, for example, we did an unsuccessful Ajax request and want to warn user using a message in response. If you already use React in your project then you will find it as a good candidate to handle this.</p><p>The project sample is on <a href="https://github.com/veelenga/react-flash-messages">Github</a>.</p><p><strong>Tooling</strong></p><ul><li><a href="https://github.com/reactjs/react-rails">React in Rails</a> for React/JSX/ES6 support in Rails app</li><li><a href="https://github.com/seyhunak/twitter-bootstrap-rails">Twitter Bootstrap for Rails 3.x</a> for Bootstrap styles</li></ul><p><strong>Implementation</strong></p><p>First what we would have to do is to implement <em>Alert</em> React component that could display a message using Bootstrap alerts:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/89cbeb5f5032296278ddecba751d6153/href">https://medium.com/media/89cbeb5f5032296278ddecba751d6153/href</a></iframe><p>As there might be multiple flash messages at once, we need to implement another React component that could display list of alerts. Let’s name it <em>FlashMessages</em>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/384526e96d455f01305f6835754c92c3/href">https://medium.com/media/384526e96d455f01305f6835754c92c3/href</a></iframe><p><em>FlashMessages </em>component is also <a href="https://facebook.github.io/react/docs/thinking-in-react.html#step-4-identify-where-your-state-should-live">a component where the state should live</a> and it wraps a list of <em>Alert</em>s into a div tag.</p><p>Our React components are ready to use, so we can put them to the pages. First we would define a small application helper to convert Rails flash messages to the structure our React component expects it:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9858a01cab3d05c0a4ad8cac2ec587b9/href">https://medium.com/media/9858a01cab3d05c0a4ad8cac2ec587b9/href</a></iframe><p>And now we can add react components to the pages using react_component helper in application template:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7ccdfa52ae981c3b7b63aa4c7ff8773c/href">https://medium.com/media/7ccdfa52ae981c3b7b63aa4c7ff8773c/href</a></iframe><p>So now Rails flash messages could be displayed using React. Nice. But two things need to be clarified:</p><ul><li>How to add new messages from client side ?</li><li>Because we plan to add messages from client side, it would be nice to automatically hide older messages on timeout and unmount appropriate React components, wouldn’t it be ?</li></ul><p>To achieve this we can slightly modify our components:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ce115e5ca85cdf34adb8aec9c33321a/href">https://medium.com/media/9ce115e5ca85cdf34adb8aec9c33321a/href</a></iframe><p>Now <em>Alert </em>component accepts onClose callback and defines two new methods: componentDidMount and componentWillUnmount . These methods are used to set/clear timer to call onClose callback. That’s it, after some period of time the component is going to be unmounted automatically.</p><p>Also now, the button to close an alert will call onClose callback if being clicked instead of a data-dismiss: &#39;alert&#39; . This will let React to fully control the component. The process of dismissal was controlled by DOM itself.</p><p>Another small addition is <a href="https://facebook.github.io/react/docs/typechecking-with-proptypes.html">type checking</a> (propTypes) and default properties (defaultProps) that makes our component much more sensitive.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c723b80bdfbdf61bb4578040fc8c8f4c/href">https://medium.com/media/c723b80bdfbdf61bb4578040fc8c8f4c/href</a></iframe><p><em>FlashMessages </em>component is modified in the following way:</p><ul><li>In constructor we have saved a reference to this React component into a global variable. After a component being rendered, we can easily add a new message on client side:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c8ecf10fca83c31857e5b02d65078ba6/href">https://medium.com/media/c8ecf10fca83c31857e5b02d65078ba6/href</a></iframe><ul><li>New methods addMessage and removeMessage to add a message to the list and remove it. Both use update addon to change the collection.</li><li>List of alerts are now wrapped into CSSTransitionGroup to make some css <a href="https://facebook.github.io/react/docs/animation.html">animation</a>. According the docs the animation itself has to defined using css transitions. So here it is:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/791430783b9595adc74661fa254899e6/href">https://medium.com/media/791430783b9595adc74661fa254899e6/href</a></iframe><p>This transition is really very similar to fade in and slide up effect. And the coolest thing is that now we have the same effect if we close alert manually or it is closed after a timeout:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*3ai-p8aYWFXosbShxkaEHw.gif" /></figure><p><strong>Wrap up</strong></p><p>It the article we found a pretty way to display Rails flash messages using React components. For this we created <em>Alert </em>and <em>FlashMessages </em>components and wrote a little of css for fade in and slide up effect.</p><p>This gives us a nicely looking and powerful mechanism to consistently talk to user from server side and client side as well.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f82982f241c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>