<?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: Giorgos Kontopoulos 👀</title>
    <description>The latest articles on DEV Community by Giorgos Kontopoulos 👀 (@giorgosk).</description>
    <link>https://dev.to/giorgosk</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%2F2201%2F520704.jpeg</url>
      <title>DEV Community: Giorgos Kontopoulos 👀</title>
      <link>https://dev.to/giorgosk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/giorgosk"/>
    <language>en</language>
    <item>
      <title>Svelte Smooth page transitions</title>
      <dc:creator>Giorgos Kontopoulos 👀</dc:creator>
      <pubDate>Fri, 20 Nov 2020 19:22:38 +0000</pubDate>
      <link>https://dev.to/giorgosk/smooth-page-transitions-in-layout-svelte-with-sveltekit-or-sapper-4mm1</link>
      <guid>https://dev.to/giorgosk/smooth-page-transitions-in-layout-svelte-with-sveltekit-or-sapper-4mm1</guid>
      <description>&lt;p&gt;Demo: &lt;a href="https://amazing-kirch-8cb3f5.netlify.app/"&gt;&lt;/a&gt;&lt;a href="https://amazing-kirch-8cb3f5.netlify.app/"&gt;https://amazing-kirch-8cb3f5.netlify.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have tried before and failed to make my page transtitions implemented in a way that we don't have to import the pageTransition component in each and every route.&lt;/p&gt;

&lt;p&gt;I have finally created a pageTransition component that &lt;strong&gt;can just be dropped in the $layout.svelte&lt;/strong&gt; component (_layout.svelte in Sapper) and then be used by all existing or future routes.&lt;/p&gt;

&lt;p&gt;I am going to show you here the steps and the thought process for setting up the component and the changes along the way which was the natural steps that I evolved this component and hopefully they can help someone in understanding layout/route based Svelte reactivity better.&lt;/p&gt;

&lt;p&gt;There is also a &lt;a href="https://github.com/GiorgosK/svelte-page-transitions"&gt;github repo&lt;/a&gt; that I have committed all different phases if you need to know all the details.  The tutorial is mostly focuses on inexperienced developers. For more experienced developers you can just skip to the last sections or go straight to the repo.&lt;/p&gt;

&lt;p&gt;I have chosen SvelteKit for this demonstration just to try it out and mostly because it seems to be the future of Svelte. If you are using Sapper the steps should be almost identical.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup Svelte@next
&lt;/h2&gt;

&lt;p&gt;Inside an empty project directory run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="k"&gt;npm&lt;/span&gt; init svelte@next
&lt;span class="k"&gt;pnpm&lt;/span&gt; install
&lt;span class="k"&gt;pnpm&lt;/span&gt; run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;NOTE: Feel free to use &lt;code&gt;npm&lt;/code&gt; where I use &lt;code&gt;pnpm&lt;/code&gt;. The two have exactly the same syntax.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After that you can browse to &lt;code&gt;localhost:3000&lt;/code&gt; and be presented with the demo route.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup a 2nd route a Simple Navigation component and a $layout component
&lt;/h2&gt;

&lt;p&gt;Setup minimum routes and components to be able to navigate from one page to another.&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="c"&gt;&amp;lt;!-- src/components/Nav.svelte --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Home&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/about"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;About&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- src/routes/about.svelte --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;About Page&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is the about page&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;More paragraphs of the about page&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- src/routes/$layout.svelte --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Nav&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../components/Nav&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;Nav/&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;slot/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We should have now the two routes and be able to navigate between Home page and About page.&lt;/p&gt;

&lt;p&gt;The beauty of SvelteKit (the magic of snowpack) is that you should be able to see changes in your browser immediately after saving the files.&lt;/p&gt;

&lt;h2&gt;
  
  
  Consistent styling of pages by creating global.css
&lt;/h2&gt;

&lt;p&gt;Some stylistic changes are due to make the styles consistent across all pages.&lt;/p&gt;

&lt;p&gt;We take all styles from &lt;code&gt;index.svelte&lt;/code&gt; and add them to a new file &lt;code&gt;static/global.css&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* static/global.css */&lt;/span&gt;
&lt;span class="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;-apple-system&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BlinkMacSystemFont&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;"Segoe UI"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Roboto&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Oxygen&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;Ubuntu&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Cantarell&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;"Open Sans"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;"Helvetica Neue"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;main&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1em&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ff3e00&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;text-transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;uppercase&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;line-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4rem&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;14rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;14rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2rem&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;line-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.35&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;min-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;480px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&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;Link css file from &lt;code&gt;app.html&lt;/code&gt; by adding following line before &lt;code&gt;%svelte.head%&lt;/code&gt;&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="c"&gt;&amp;lt;!-- add to src/app.html --&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"global.css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Simple PageTransitions component
&lt;/h2&gt;

&lt;p&gt;Here is a simple PageTranstitions svelte component using &lt;code&gt;svelte/transition&lt;/code&gt; package.&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="c"&gt;&amp;lt;!-- src/component/PageTransitions.svelte --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;fly&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;svelte/transition&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt;
    &lt;span class="na"&gt;in:fly=&lt;/span&gt;&lt;span class="s"&gt;"{{ y: -50, duration: 250, delay: 300 }}"&lt;/span&gt;
    &lt;span class="na"&gt;out:fly=&lt;/span&gt;&lt;span class="s"&gt;"{{ y: -50, duration: 250 }}"&lt;/span&gt; 
    &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;slot/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It makes the page fly in and out from top of the viewport.  We delay a bit on the in transition to avoid the in and out transitions from working at the same time.  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Perhaps if anyone know how to add &lt;code&gt;crossfade&lt;/code&gt; to it please do let me know in the comments.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you add it as a wrapper on any route it does work as expected and it is the way I have seen all tutorials use a page transition component.  There might also be use cases where we only need it on certain routes and than this would be the way to use it.&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="c"&gt;&amp;lt;!-- src/routes/about.svelte --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
    &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Counter&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;$components/Counter.svelte&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;PageTransitions&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../components/PageTransitions.svelte&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;PageTransitions&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;About Page&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is the about page&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;More paragraphs of the about page&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/PageTransitions&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  More versatile PageTransitions component
&lt;/h2&gt;

&lt;p&gt;For most use cases though I believe setting PageTransitions in the &lt;code&gt;$layout.svelte&lt;/code&gt; component and than having all routes use it is the way to go as it we set it and forget it.&lt;/p&gt;

&lt;p&gt;First lets remove the component from all routes and bring them to their initial state (setup setps a little above).&lt;/p&gt;

&lt;p&gt;If we just put the PageTransitions component in &lt;code&gt;$layout.svelte&lt;/code&gt; component without any modifications though we will not be able to see any transitions.&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="c"&gt;&amp;lt;!-- src/routes/$layout.svelte --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Nav&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../components/Nav&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;PageTransitions&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../components/PageTransitions&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;Nav/&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;PageTransitions&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;slot/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/PageTransitions&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;NOTE: I noticed that SvelteKit is not loading all changes automatically to the browser. Perhaps this is something that will be fixed in later versions so lets not focus on it just keep in mind to refresh the browser when you can't see any changes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The problem is that the component is not reactive as is. We should make it reactive to the change of the route.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reactive Nav component
&lt;/h3&gt;

&lt;p&gt;Lets first make the Nav component reactive by underlying the current route link.&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="c"&gt;&amp;lt;!-- src/components/Nav.svelte --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
    &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;segment&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;text-decoration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nc"&gt;.current&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;text-decoration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;underline&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;'{segment === "/" ? "current" : ""}'&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Home&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/about"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;'{segment === "/about" ? "current" : ""}'&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;About&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pass the &lt;code&gt;$page.path&lt;/code&gt; as &lt;code&gt;segment&lt;/code&gt; variable to &lt;code&gt;$layout.svelte&lt;/code&gt; to make the Nav reactive.&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="c"&gt;&amp;lt;!-- src/routes/$layout.svelte --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Nav&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../components/Nav&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@sveltejs/kit/assets/runtime/app/stores.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;Nav&lt;/span&gt; &lt;span class="na"&gt;segment=&lt;/span&gt;&lt;span class="s"&gt;{$page.path}/&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;slot/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now if you change the Nav links the current route link should be underlined.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reactive PageTransition component
&lt;/h3&gt;

&lt;p&gt;We now need to make the component reactive by creating a &lt;code&gt;refresh&lt;/code&gt; prop and using &lt;code&gt;key&lt;/code&gt; directive which means that when the key changes, svelte removes the component and adds a new one, therefore triggering the transition.&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="c"&gt;&amp;lt;!-- src/component/PageTransitions.svelte --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;fly&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;svelte/transition&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;refresh&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

{#key refresh}
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt;
    &lt;span class="na"&gt;in:fly=&lt;/span&gt;&lt;span class="s"&gt;"{{ y: -50, duration: 250, delay: 300 }}"&lt;/span&gt;
    &lt;span class="na"&gt;out:fly=&lt;/span&gt;&lt;span class="s"&gt;"{{ y: -50, duration: 250 }}"&lt;/span&gt; 
    &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;slot/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
{/key}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also lets pass the &lt;code&gt;$page.path&lt;/code&gt; variable to PageTransition component similar to how we did it with the Nav component.&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="c"&gt;&amp;lt;!-- src/routes/$layout.svelte --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Nav&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../components/Nav&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;PageTransitions&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../components/PageTransitions&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@sveltejs/kit/assets/runtime/app/stores.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;Nav&lt;/span&gt; &lt;span class="na"&gt;segment=&lt;/span&gt;&lt;span class="s"&gt;{$page.path}/&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;PageTransitions&lt;/span&gt; &lt;span class="na"&gt;refresh=&lt;/span&gt;&lt;span class="s"&gt;{$page.path}&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;slot/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/PageTransitions&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should now have your smooth page transtitions without needing to add the component to every route.&lt;/p&gt;

&lt;h2&gt;
  
  
  Improving the page transitions
&lt;/h2&gt;

&lt;p&gt;When the pages are longer in height the transition are not actually that smooth because it might cause the scrollbars to flicker creating an undesired moving effect on the contents of the page.&lt;/p&gt;

&lt;p&gt;For understanding the problem lets force each page to be a little bigger in height&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* add in static/global.css */&lt;/span&gt;
&lt;span class="nt"&gt;main&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;min-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;600px&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;Depending on your viewport size you might need to adjust the height so that there is no scrollbars on when not transitioning (idle state).&lt;/p&gt;

&lt;p&gt;If you refresh your browser and navigate from page to page you should see the flickering effect.&lt;/p&gt;

&lt;p&gt;To mitigate this problem lets add the following css to your &lt;code&gt;global.css&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* add in static/global.css */&lt;/span&gt;
&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;overflow-y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;scroll&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;And now the scrollbars will be visible at all times but might not always have the scroll handle to drap up/down.  This will prevent them from appearing and disappearing and eliminates the problem.&lt;/p&gt;

&lt;p&gt;Another alternative would be to use&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* add in static/global.css */&lt;/span&gt;
&lt;span class="nt"&gt;html&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
  &lt;span class="nl"&gt;margin-left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;calc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;100vw&lt;/span&gt; &lt;span class="n"&gt;-&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; 
&lt;span class="err"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read more about the flickering scrollbar and the above solutions &lt;a href="https://css-tricks.com/elegant-fix-jumping-scrollbar-issue/"&gt;on css-tricks&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Making a component reactive on the layout/routing level is easy enough as seen above.  This technique can be used with any component we include in &lt;code&gt;layout&lt;/code&gt; or any component that we want to be reactive when the route changes. &lt;/p&gt;

&lt;p&gt;Please post your thoughts on the comments below.  I would be happy to improve on the above code if something is not considered right or best practice and I do welcome corrections.&lt;/p&gt;

&lt;p&gt;If you liked this tutorial or found it useful please share or like or give me a star on &lt;a href="https://github.com/GiorgosK/svelte-page-transitions"&gt;github&lt;/a&gt;.  Any of the above gives me an incentive to dig deeper and write more useful tutorials.&lt;/p&gt;

</description>
      <category>svelte</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>animations</category>
    </item>
    <item>
      <title>Expose your local 💻 web server to the world 🌐</title>
      <dc:creator>Giorgos Kontopoulos 👀</dc:creator>
      <pubDate>Fri, 17 Jan 2020 09:30:35 +0000</pubDate>
      <link>https://dev.to/giorgosk/expose-your-local-web-server-to-the-world-using-localhost-run-or-serveo-net-l83</link>
      <guid>https://dev.to/giorgosk/expose-your-local-web-server-to-the-world-using-localhost-run-or-serveo-net-l83</guid>
      <description>&lt;h2&gt;
  
  
  Why ?
&lt;/h2&gt;

&lt;p&gt;Web developers (mostly) develop on localhost using our preferred tools and languages and have a local server to test what we build.  At times we might need to show a coleague or a client our progress or even test using online test tools such as browserstack. &lt;/p&gt;

&lt;p&gt;It might be not worth the effort to deploy on a dev server to test a small change that we made or the process of deploying might be time consuming or might not have time to wait for deployment to finish.&lt;/p&gt;

&lt;p&gt;Whatever the reason, &lt;strong&gt;no stress&lt;/strong&gt; there is very easy way to expose our localhost using services such as  &lt;a href="//localhost.run"&gt;localhost.run&lt;/a&gt;, &lt;a href="//serveo.net"&gt;serveo.net&lt;/a&gt;, &lt;a href="//ngrok.com"&gt;ngrok.com&lt;/a&gt;, &lt;a href="//no-ip.com"&gt;no-ip.com&lt;/a&gt; and there is probably others.&lt;/p&gt;

&lt;p&gt;Perhaps the most well known are ngrok and no-ip.com but last time I checked you had to register to use them and hence I looked for easier ways and discovered the alternatives which I will present below.&lt;/p&gt;

&lt;p&gt;For tutorials on how to use ngrok.com and/or no-ip.com I am sure you can find plenty on dev.to or just with a quick search.&lt;/p&gt;

&lt;h2&gt;
  
  
  How ?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Localhost.run&lt;/strong&gt; can be used without registering you just need to call a simple command on your terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -R 80:localhost:8080 ssh.localhost.run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where 8080 is assumed to be the listening port of your local server.&lt;/p&gt;

&lt;p&gt;Here is a simple example.  Suppose you have your local development server running on port 3000 so you are testing things out by visting &lt;code&gt;localhost:3000&lt;/code&gt;.  &lt;/p&gt;

&lt;p&gt;On your terminal you would run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -R 80:localhost:3000 ssh.localhost.run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you would wait to get a response like the following&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Connect to http://MACHINENAME-7zhx.localhost.run or https://MACHINENAME-7zhx.localhost.run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can give 1 of the above links to anyone to access on the internet or use them in you external testing environment.&lt;/p&gt;

&lt;p&gt;The server will be running until you terminate the process&lt;/p&gt;

&lt;p&gt;That is all, nothing else to it, no need for registering or any other hassle and its a free service.&lt;/p&gt;

&lt;p&gt;Similarly you can use &lt;strong&gt;serveo.net&lt;/strong&gt; service with the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -R 80:localhost:3000 serveo.net
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For serveo check with their &lt;a href="//serveo.net"&gt;website&lt;/a&gt; before using as they have their ups and downs lately.&lt;/p&gt;

&lt;h2&gt;
  
  
  All similar services
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="//localhost.run"&gt;localhost.run&lt;/a&gt; (free, no registration)&lt;/li&gt;
&lt;li&gt;
&lt;a href="//serveo.net"&gt;serveo.net&lt;/a&gt; (appears to be not working, free, no registration)&lt;/li&gt;
&lt;li&gt;
&lt;a href="//ngrok.com"&gt;ngrok.com&lt;/a&gt; (paid, free trial, also free with no registration)&lt;/li&gt;
&lt;li&gt;
&lt;a href="//no-ip.com"&gt;no-ip.com&lt;/a&gt; (paid, free trial, free with monthly re-registration)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://developers.cloudflare.com/argo-tunnel/trycloudflare/"&gt;cloudflare argo tunnel&lt;/a&gt; (free, no registration)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dyn.com/remote-access/"&gt;dyn.com&lt;/a&gt; (paid, free trial)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/kingsquare/docker-tunnel"&gt;Docker tunnel&lt;/a&gt; (free, needs setup)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/vitobotta/docker-tunnel"&gt;Docker tunnel&lt;/a&gt; (free, needs setup)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://medium.com/@gabriel.bentara/ngrok-you-might-not-need-it-de4e3e34a55d"&gt;Do it yourself tutorial&lt;/a&gt; (free, needs setup)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please post any other similar services you have in mind or using with any advantages that they might have or send me any corrections to the above list.&lt;/p&gt;

&lt;h2&gt;
  
  
  WARNING
&lt;/h2&gt;

&lt;p&gt;Some people have raised concerns in the comments that using such a service is actually in violation of your ISP's terms and conditions.  This includes usage of any of the alternatives.  There is probably a very slight possibility that an ISP can know or detect such a connection though.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>tutorial</category>
      <category>productivity</category>
      <category>testing</category>
    </item>
    <item>
      <title>The hiring manager's dilemma / perspective ?</title>
      <dc:creator>Giorgos Kontopoulos 👀</dc:creator>
      <pubDate>Wed, 05 Dec 2018 19:09:29 +0000</pubDate>
      <link>https://dev.to/giorgosk/the-hiring-managers-dilemmaperspective--26i5</link>
      <guid>https://dev.to/giorgosk/the-hiring-managers-dilemmaperspective--26i5</guid>
      <description>&lt;p&gt;I was wondering lately how a decision is made when a company is looking for a developer of any position and how the previous environment a candidate has worked for can affect the decision and in what ways.&lt;/p&gt;

&lt;p&gt;What are the dilemma's faced when evaluating candidates from different work environments ? What is the developer's perspective and most importantly what is the hiring manager's perspective ? &lt;/p&gt;

&lt;p&gt;Lets say for the sake of simplicity that there are only &lt;strong&gt;2 candidates&lt;/strong&gt; applying for the same position. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Candidate 1 (C1)&lt;/strong&gt; always worked in companies that were advanced and efficient, with great  managers, the salary always more than enough, the environment ideal, company paid for education and conferences and meetups, and and never had to work overtime because everyting was pretty much laid out and never had to deal with customer support.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Candidate 2 (C2)&lt;/strong&gt; always worked in companies that were all opposite of previous candidate's, No established channels of communication or progress or reporting, unit or even functional tests were unknown, outdated infrastucture, people communicated with emails attaching DOCX revisions, has spend a fair amount of time supporting customers, probably overworked and underpaid.&lt;/p&gt;

&lt;p&gt;Both take a technical test for a developer's position for a company that pretty much resembles C1's previous companies and C1 scores 97% while C2 scores a mere 85%.&lt;/p&gt;

&lt;p&gt;From a purely technical view I understand that perhaps C1 deserves to get the job.&lt;/p&gt;

&lt;p&gt;Some extreme perspectives I could think of &lt;/p&gt;

&lt;h3&gt;
  
  
  C2 Developer's perspective
&lt;/h3&gt;

&lt;p&gt;Has fought his/her way to become the best but it was always an uphill.  He/she is thinking that if has managed to be a 85% competent while being paid X gets excited with what he/she could achieve if can land a job getting paid 2X-5X as much.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hiring manager's perspective
&lt;/h3&gt;

&lt;p&gt;Perhaps there is no dilemma since C2 has failed to be up to the company's standards and is not fit therefore C1 will get the position.&lt;/p&gt;

&lt;p&gt;Personally if I was to make the decision on the above scenario I would probably hire C2. &lt;/p&gt;

&lt;p&gt;I know the above is a very extreme scenario but only presenting it in order to serve the basis of a discussion.&lt;/p&gt;

&lt;p&gt;If anyone has some real (or even no) experience on either the developer's or hiring manager's side of things I would love to hear your thoughts or general comments.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>career</category>
      <category>webdev</category>
      <category>interview</category>
    </item>
  </channel>
</rss>
