<?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 Georgy Marchuk on Medium]]></title>
        <description><![CDATA[Stories by Georgy Marchuk on Medium]]></description>
        <link>https://medium.com/@gmarcuk?source=rss-a6f6bfd7ac54------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nG_r9_8I1kEBA6Eaaf8Vkg.jpeg</url>
            <title>Stories by Georgy Marchuk on Medium</title>
            <link>https://medium.com/@gmarcuk?source=rss-a6f6bfd7ac54------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 05:03:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gmarcuk/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[Meet Swup v3]]></title>
            <link>https://medium.com/@gmarcuk/meet-swup-v3-fb40a6e4b988?source=rss-a6f6bfd7ac54------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb40a6e4b988</guid>
            <category><![CDATA[webdesign-and-development]]></category>
            <category><![CDATA[animation-and-design]]></category>
            <category><![CDATA[page-transition]]></category>
            <dc:creator><![CDATA[Georgy Marchuk]]></dc:creator>
            <pubDate>Wed, 01 Feb 2023 10:02:27 GMT</pubDate>
            <atom:updated>2023-02-01T10:02:27.559Z</atom:updated>
            <content:encoded><![CDATA[<h4>It&#39;s been over three years since the last major update to the Swup was introduced with the <a href="https://medium.com/@gmarcuk/introducing-swup-v2-814e40316dee">v2 release</a>, and that&#39;s a hell of a lot of time in the internet world. That&#39;s why I&#39;m so excited to announce the next major release happening in the current days.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mCnRjy0n7iz1uj3C-WtCyw.png" /></figure><p>If you&#39;re not sure what Swup is until now, you&#39;re most encouraged to learn <a href="https://css-tricks.com/page-transitions-for-everyone/">about the motivation</a> and <a href="https://swup.js.org/getting-started">Swup</a> itself.</p><p>First, let&#39;s give credit where it&#39;s due. This is all possible thanks to a fantastic GitHub community working on Swup, whether it&#39;s reporting bugs, introducing improvements, or simply brainstorming the next steps in the Swup roadmap.</p><p>Above all, we can thank our core maintainers <a href="https://github.com/daun"><strong>@daun</strong></a> and <a href="https://github.com/hirasso"><strong>@hirasso</strong></a> for this release, who have worked day and night and made it possible in the first place, so a big shout out to them!</p><p>The following paragraphs are about what&#39;s new to Swup, the new features and improvements, and a little about the motivation behind them.</p><p>If you&#39;re impatient and want to jump into the upgrade, here&#39;s a short <a href="https://swup.js.org/getting-started/upgrading">guide to review</a>. The upgrade should be straightforward in most cases, as breaking changes are minimal for the most part, and the new versions of plugins supporting v3 are already available.</p><p>Of course, everything is already reflected in the <a href="https://swup.js.org/getting-started">documentation</a> too.</p><h3>TL/DR</h3><p>This time, it&#39;s mainly about cleanup. I need to be honest; there&#39;s been a lot of mess introduced by yours truly (yes, me) in the past. We needed to get rid of that before we could continue to build new features and improvements. But don&#39;t worry; there are new features and enhancements included in v3 too!</p><p>Let&#39;s have a look at those.</p><ul><li>New bundler called <a href="https://github.com/developit/microbundle"><strong>Microbundle</strong></a>.</li><li>First-class <strong>TypeScript</strong> support.</li><li>Support for <strong>multiple animations</strong> on the same elements.</li><li>Support for <strong>CSS @keyframes</strong> animations.</li><li>The new <strong>ignoreVisit</strong> and <strong>resolveUrl</strong> options.</li><li><strong>Route transition class names</strong> functionality has been improved and moved to <a href="https://swup.js.org/plugins/route-name-plugin">Route Name Plugin</a>.</li><li>Better and more stable access to <strong>Swup helpers for plugins</strong>.</li><li>Plugins can now better <strong>control the page transition process</strong>.</li><li><strong>Improved </strong><a href="https://swup.js.org/plugins/head-plugin"><strong>Head Plugin</strong></a><strong>,</strong> which can now wait for stylesheets to load before displaying the next page.</li><li>A <a href="https://github.com/swup/plugin"><strong>better plugin template</strong></a> with a handy CLI.</li><li>Better <strong>test coverage</strong>.</li><li>Improved <strong>CI/CD, Prettier…</strong></li></ul><p>…and plenty more cleanup, like defining peer dependencies properly in plugins or unifying GH actions and issue templates.</p><p>It&#39;s important to mention that the cleanup didn&#39;t end with the code — the number of existing open issues and discussions has been massively reduced and addressed, leaving us with a clean slate for future works.</p><p>It&#39;s also fair to mention that all of this has been achieved with an even smaller bundle, although it was tiny already.</p><h3>New Bundler</h3><p>We switched to a new bundler called <a href="https://github.com/developit/microbundle">Microbundle</a> for Swup and at least some of the official plugins. This is mainly for the excellent ergonomics it provides to the maintainers, where we can easily manage build steps in the <a href="https://github.com/swup">many repositories</a> we have without the cumbersome setup we had to keep up to date all over the place.</p><p>Still, this also brings some improvements to the Swup users — you can now consume Swup in a future-proof ESM format, apart from the ones existing in the past.</p><h3>TypeScript Support</h3><p>Swup now has first-class TypeScript support. This brings better clarity to the maintainers and should prevent accidental breaking in the future.</p><p>Plugin authors can now consume Swup with typed API, leading to better predictability of what the plugin code might do or how it can use Swup API to achieve whatever it does.</p><p>For the rest of us, Swup now has a fully typed API to easily understand what options are available or how we can control Swup programmatically.</p><h3>Multiple Animations on the Same Element</h3><p>Previously, if an element was running two or more animations with different timing during the transition, Swup would continue the process of page transition whenever the first animation was finished. This could be considered a bug but has been standard behavior of Swup since day one.</p><p>Swup now supports multiple animations on the same elements, meaning we&#39;re able to always wait for all running animations to finish before the page transition continues, giving users better options when it comes to timing multiple animations on the same element.</p><h3>A Couple of New Options</h3><p>Swup now comes with a couple of new options that are helpful in certain situations.</p><p>The ignoreVisit option lets you programmatically ignore certain links and prevent Swup from handling them. This should make the linkSelector option much easier to define and keep up to date.</p><p>The second newly added option is called resolveUrl, and it lets you programmatically configure how different routes are being saved in the Swup cache, meaning you can handle different URLs and search parameters on the same page when it comes to the Swup cache, improving the ability to handle history correctly. This is handy, for example, when your page has some filtering for items, where Swup can handle the transition as usual while only keeping one latest record of the page.</p><h3>CSS @keyframes Animations</h3><p>If you&#39;re a fan of CSS @keyframes animations, you&#39;ll be thrilled to hear Swup now supports those as a way to animate elements and waits for such animations to finish before continuing the page transition. This gives the user much more control over how the animation looks and the timing of different animation steps. After all, @keyframes gives you a much more advanced way of defining the animation steps overall.</p><h3>Route-Based Classnames</h3><p>The functionality of the specific route transition class names (to-homepage and similar) has been removed from Swup. This has long been coming since it&#39;s not essential for Swup to work, and many projects don&#39;t need it at all.</p><p>But don&#39;t you worry, if you&#39;re using these classes in your projects, an improved version is now available in the <a href="https://swup.js.org/plugins/route-name-plugin">Route Name Plugin</a>, which also provides the from-* class names, missing in a previous implementation.</p><h3>Plugins Cleanup</h3><p>There are a few things we&#39;ve done with plugins.</p><p>First, plugins no longer rely on direct imports from subdirectories of Swup&#39;s lib folder, making the Swup API better and more stable for plugin authors. This should avoid accidental breaking of changes for plugins in the future. This has happened in the past and would likely happen again.</p><p>Plugins can better control the page transition process and defer the IN animation until certain conditions are met, which could be helpful for some plugin authors. However, what will likely be more interesting to most is that the improved <a href="https://swup.js.org/plugins/head-plugin">Head Plugin</a> already uses this functionality to wait for any new stylesheets to load before displaying the next page (available with the awaitAssets option).</p><p>Crucially for plugin authors, the <a href="https://github.com/swup/plugin">plugin template</a> has improved and has a bit more functionality. First, it comes with TypeScript types, meaning you can better see what needs to be defined on your plugin. This comes together with a bit of runtime validation too.</p><p>Second, a simple runtime check has been added to define the plugin&#39;s dependencies and their versions, where the dependency could be Swup itself or another Swup plugin.</p><p>The plugin template now comes with a handy CLI for managing the build step, dev mode, lint, and a script to validate the setup for plugin authors, meaning plugin authors don&#39;t need to go through a painful repetitive process of setting up all of that in the repository.</p><h3>Better Test Coverage</h3><p>Swup has long relied on end-to-end Cypress tests to ensure the correct working and avoid breakage. These tests have been cleaned up and extended with tests related to plugins and more. Tests now also run much faster.</p><p>Unit tests were previously missing altogether. The setup for that was added, together with some test coverage too.</p><h3>CI/CD, Prettier…</h3><p>Our GitHub actions now run all the required checks we&#39;ve previously missed, including unit tests, e2e tests, or lint. In addition, the maintainers can now bump the package versions using the GH action. The publish GH action has also been standardized for the repositories, meaning we can work better together as a team and not rely on a single person at all.</p><h3>What Next?</h3><p>With the maintainer&#39;s team fairly active in developing and using Swup in production, following releases (whether minor or major) should become more frequent. The same goes for official plugin updates or new plugins altogether.</p><p>Next up? We have yet to make any big immediate plans, but some ideas have popped up. The <a href="https://github.com/swup/swup/issues/488">fragments support</a> discussion is ongoing, the <a href="https://github.com/swup/swup/issues/489">reCAPTCHA plugin</a> has been in the plans for a while, and there are already <a href="https://github.com/swup/swup/issues?q=is%3Aopen+is%3Aissue+label%3Aswup%40v4">some ideas</a> on what should be included in version 4.</p><p>We&#39;re also playing with the idea of revamping the documentation site to make it clearer how to use Swup to the fullest, but mainly because it should be fun, and we want to make it pretty. 🤭</p><p>Last but not least, if you&#39;re an active user of Swup and want to be able to affect its future roadmap directly, you&#39;re more than welcome to <strong>join the </strong><a href="/service/mailto:gmarcuk@gmail.com"><strong>maintainer&#39;s team</strong></a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb40a6e4b988" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Problems Inserting a Chatbot and The ‘All Too Obvious’ Solution]]></title>
            <link>https://medium.com/pipedrive-engineering/2020-is-iframe-still-useful-8e8f7e099a23?source=rss-a6f6bfd7ac54------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e8f7e099a23</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[bots]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[iframe]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Georgy Marchuk]]></dc:creator>
            <pubDate>Tue, 07 Apr 2020 13:16:55 GMT</pubDate>
            <atom:updated>2020-04-27T10:06:06.189Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s a couple months into the beginning of the year again, and I’ve been subconsciously evaluating the previous year. As luck would have it, the beginning of the year marked almost a year since I’ve joined a team at Pipedrive, which made the evaluation pretty straightforward for me.</p><p>In this piece, I’ll go through the story of developing a global product from the very beginning. The story talks about some unexpected problems encountered while developing a chatbot, and through that, also a case study on the current state of the web.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OkI26CqX5Y9-J9r2.png" /></figure><p>Before we start, let’s talk about the product a bit as it’s an important aspect to the decisions made on the way. The product, LeadBooster, is one of the newest additional features found in Pipedrive and as mentioned before, it’s a chatbot which our customers can include on their website. LeadBooster interacts with the website users in a way that that can be customized by the website owner and if everything goes well, the chatbot saves the contact information as a potential customer. If you’re reading this post, likely you’ve seen a chatbot before on the web so there’s no need to go into any particularly deep explanation of how it works.</p><p>That said, here’s a <a href="https://leadbooster-demo.gmrchk.com/">demo of the LeadBooster chatbot</a> for anyone curious.</p><p>Let me add a few important technical aspects here. Since this is a service that should be globally available for everyone, we officially support browsers down to Internet Explorer 11. The chatbot is injected into a website with JavaScript snippet, just like any other service or analytics that you’re used to.</p><pre>&lt;script&gt;<br>  window.pipedriveLeadboosterConfig = {<br>    base: &#39;leadbooster-chat.pipedrive.com&#39;,<br>    companyId: ...,<br>    playbookUuid: &#39;...&#39;,<br>    version: 2<br>  };<br>&lt;/script&gt;<br>&lt;script src=&quot;https://leadbooster-chat.pipedrive.com/assets/loader.js&quot; async&gt;&lt;/script&gt;</pre><h3>Styling, Styling, and Styling Again</h3><p>There are many lessons learned, but I can reveal the first one right at the beginning, and that’s a somewhat naive thinking of how “clean” the web is in 2020. It all started with a simple question — how to style a module injected into websites? Since the environment is virtually uncontrollable from our side, the decisions we were making had to be well thought out, or at least so we thought.</p><p>The idea was simple: DOM elements of the injected chatbot would be placed into their own wrapper div element, placed right at the root of the website — the body element. Doing this would allow us to avoid most of the non-global styles from outside by default. Yay!</p><p>Of course, most websites include some kind of style reset which set default styles of elements, so we made sure we to take that into account. The chatbot included its own scoped style reset that would globally set styles of elements within our wrapper and those styles could be changed for specific components at will. Some style collisions were surely expected, but since the product was in the early beta at the time, there was no harm in going for try → fail → learn approach.</p><h3>First Issues</h3><p>We had around 3,500 installations in the beta phase, which is a nice number from a business perspective, but about a perfect number to have a wide user base for testing the tool out in the wild.</p><p>It didn’t take much time for the first issues to appear but as mentioned, that was the plan. This rabbit hole eventually turned out to be much deeper than anyone originally expected, but let’s walk through all the steps one by one.</p><p>Most of the issues came from the different global styles used on the websites. The main problem is the unnecessary specific CSS selectors, something like the following example, where the body doesn’t have to be there, probably clears things out.</p><pre>body button {<br>    color: red;<br>}</pre><p>Surely, many readers have met this problem before regardless the circumstances, so I won’t go deeper into the topic of CSS specificity. This topic has been discussed <a href="https://css-tricks.com/specifics-on-css-specificity/">many times over</a> after all and there is even a CSS <a href="https://specificity.keegan.st/">specificity calculator</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*M2EN7g2fmN6VjGdN.png" /><figcaption>CSS selector specificity</figcaption></figure><p>Luckily this problem can be quickly identified by the same try → fail → learn technique. Injecting the chatbot into commonly used websites like popular WordPress templates has shown most of the issues, where the majority of it can be resolved by increasing the specificity of the chatbot selectors.</p><p>Transforming all selectors with a prefix was a go-to fix that resolved a big chunk of bugs related to style conflicts. Plus, it can be easily automatized with pretty much any CSS pre-processor or CSS in JS solution.</p><pre>html body #pipedrive-chat-holder { ... }</pre><h3>The Perils of Important</h3><p>The next wave of problems didn’t take too long to show up, and as the headline suggests, the trouble was something like the following:</p><pre>button {<br>    color: red !important;<br>}</pre><p>The infamous and feared !important. Anyone reading this article likely knows that this CSS feature is mainly meant for overwriting values set on inline on elements by some uncontrolled source, and is not to be used for simply increasing the specificity of selectors. Sure, there are many places where going for !important is a valid, well thought out solution, but let’s face it, we’ve all used it once or twice in that “bad way”. I know I have.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c6wK2raetsaHj9a1.png" /><figcaption>!important</figcaption></figure><p>The problem with !important is simple — once it’s introduced, there’s no way around it. You can’t fight !imporant with your usual CSS toolset. It’s like a magical and immortal creature — it cannot be killed. The only thing that can beat this monster is yet another !imporant.</p><p>Everyone is likely to make this mistake here or there, but what makes the issue worse is that everyone makes this mistake in a different place, which essentially means we needed to account for all of the different places.</p><p>The issues with !important were less common, but started showing up from the users later with reports of “broken chatbot”.</p><p>Since !important was usually applied to some more specific HTML tags like button, unfortunate side effects emerged as well. This issue practically blocked the progress of the “good guy” frontend developers in our team who wanted to make the chatbot more accessible by introducing a semantic HTML5 syntax.</p><p>To sum it all up, we were left in a very unpleasant situation where we found ourselves handling code filled with !important — not because we didn’t know better, but because our customers were inadvertently forcing us to.</p><h3>JavaScript Collisions</h3><p>All the problems above are real-world issues that needed to be solved, but at the same time were issues that were somewhat expected to come up. What was unexpected was a collision of styles for elements sharing one document.</p><p>What no one was anticipating was a collision of JavaScript code. Now don’t get me wrong, I know there are many opportunities to make a mistake in JavaScript, but given a classic toolbox of 2020 where bundlers automatically enclose any code into its own scope and all the linters go crazy when a mistake is made — most dangerous code will never make it to production. I think this particular setup actually makes it quite hard to make mistakes, but then again, that might be just a naive assumption.</p><p>There is another factor to consider however— these tools don’t <em>have</em> to be used by whoever develops the website that the chatbot is injected to.</p><p>There was a perfect real-world example we faced: a user reported that the chatbot wouldn’t load on their website and the report luckily included a helpful console error familiar to most of us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FU8-WJwYke5sVhD-.png" /><figcaption>Uncaught TypeError: fetch is not a function</figcaption></figure><p>The conclusion was made in seconds — the user is accessing the website in IE 11 or lower and we’re missing a polyfill.</p><p>Polyfill is a piece of code that implements features in the browsers that don’t support it. Commonly, a polyfill will check whether the native implementation of the feature is present and if not, implement all the functionality agreed upon by the set standards.</p><p>I’ll get to polyfills once again later, but a quick investigation revealed that there was no such issue and the mystery continued with the fact that the error could be seen in the latest Chrome as well. This suggested that the missing polyfill is likely not the problem we are dealing with.</p><p>Since fetch wasn’t a function, it had to be something else. You would think that <em>null</em> is what would be found, but that wasn’t the case this time around. A quick check of what is the fetch global variable on the page showed us the following:</p><pre>window.fetch  // window.fetch = 4</pre><p>To this day, I’m still wondering what was the origin of this definition. Did the author pick a very unfortunate name for a global variable that holds a <em>number of times</em> loop repeats? Perhaps it was a favorite number that was just saved in the wrong place? Maybe just a simple mistake in the declaration that led to variable going global? Unfortunately, we’ll never know, but a quick chat with support resolved the issue for the customer.</p><h3>Frameworks</h3><p>Now we can move on to the last issue we have faced, but before we do this, let’s talk a little about frontend frameworks. Developing a framework for the web has some advantages over developing a library that people would use. The advantage is simple — framework takes care of everything and you don’t have to take other third party code into account, at least to some extent — it’s essentially an enclosed system that can be designed as a whole. Angular is a great example of such a framework and this actually leads us to our next issue. After testing with thousands of customers, we got our first customer trying to install LeadBooster on an Angular website. We expected this to happen way sooner, but I guess there aren’t as many brave man building websites with Angular as we expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lKWc9g1CxBRHv5zN.png" /></figure><p>As it usually happens, everything started with the first customer complaints. This time however, it was different. Unlike the other reports, this customer stated that LeadBooster broke the website and not the other way around. Being the team of careful developers that we are, we were quite sure couldn’t be the case. All of the chatbot code is structured in a way so that it doesn’t affect any other code on a page.</p><p>Like anyone in our position, we took such a complaint seriously and immediately started to research the issue. We installed a clean installation of Angular, made a few routes and started testing. One thing led to another and guess what? The website broke. It wasn’t broke in the way that a problem was immediately noticeable, but there was still a valid problem.</p><p>You see, as previously mentioned, LeadBooster needs to work everywhere including less-fortunate browsers like Internet Explorer 11. This means our code needs to include a few polyfills.</p><p>Let’s get back to the problem. It turns out that Angular, being a framework that doesn’t need to consider third party code, overwrites a global Promise definition. Unlike polyfills, Angular implements a custom Promise in any browser. This might not be an issue in most cases, but this non-native implementation of Promise doesn’t go well with Promise included by default from Babel. Perhaps you know where I’m going with this…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zpCP5QQu8rnrC8o-.png" /><figcaption>Overwriting Promise Definition</figcaption></figure><p>The browser has a native implementation of Promise and it is overwritten by any custom implementation for any Angular website. Eventually, once LeadBooster has loaded, it overwrites the Angular Promise which then breaks the website altogether. In a sense, it reminds me of those documentaries about the series of unfortunate events leading up to a terrifying catastrophe.</p><p>Whether Angular overwriting native global values is the correct approach is definitely up for discussion, but let’s skip that for now. Let’s focus on the problem instead. We never expected the creators of a website to count on a non-standard implementation of global objects, and that was a mistake on our end. We needed a solution, and we needed it fast.</p><h3>The Ultimate Solution</h3><p>No matter the issues we’ve faced, whether it was the specificity of styles or a collision in JavaScript code, it has culminated to one ultimate solution. This solution was clear from the beginning, but since it adds its own overhead, the initial idea was to avoid it if possible. Many of you have probably figured out the answer to all the troubles by now based on the article title — IFrame.</p><p>IFrame is in many ways, a product of the past. Its original intention is also significantly distant from the way we use it now and yet, it’s the only solution that can cover all the problems arising from a very much current trend — chat windows on a page.</p><p>IFrame, unlike any other HTML tag or JavaScript code that one can stumble upon in a browser, creates a whole new context, whole new document, and whole new window.</p><p>There are of course limitations brought on by IFrame. It makes usage of CSS media queries within the IFrame virtually impossible since media queries are evaluated against the IFrame window object, not the main one. Also, it’s size and position needs to be controlled manually to adjust for anything that needs to be displayed within.</p><p>There was also one argument against the IFrame that surfaced during the initial research of the market, and the argument would probably surprise most people. There are other products within the Pipedrive world that are already using IFrame, so the idea isn’t new at all. However, as it turns out, our customers don’t think IFrame is cool anymore, and they don’t want to use it on their website unless they need to, but that’s just a fun fact more than anything else.</p><p>LeadBooster has now been using IFrame for a few months, and it seems to have solved most of our problems. The transition was also surprisingly smooth, although I should mention a few of the customer complaints we have received. You see, some customers had already started exploiting the benevolent nature of our solution before the change. Some started introducing custom styles for the chatbot, and some even implemented custom solutions for analytics. In a way, it’s amazing (and impressive) what people can manage with a little freedom. Unfortunately, all of this DIY functionality doesn’t work anymore, but since LeadBooster is a SaaS, receiving frequent updates that would sooner or later break any custom functionality, I think it’s for the best.</p><h3>Conclusion</h3><p>When designing a code that needs to run in an unknown environment, one shouldn’t assume anything. Even when everyone involved has the best intentions, there are just too many things that can go wrong, and they will eventually.</p><p>On the contrary, an IFrame, being in a way an outdated tool, can be incredibly helpful and it’s essentially the only solution to certain problems existing on the web today. There are surely a list of disadvantages for IFrame, but the point is — all of them can be solved. What IFrame brings is a definite separation of code, and that’s not possible in any other way at this time. I would never anticipate being the one saying it, but IFrame still has a useful position place in 2020.</p><p>In case anyone is interested, here’s a <a href="https://leadbooster-demo.gmrchk.com/">demo of LeadBooster chatbot</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e8f7e099a23" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pipedrive-engineering/2020-is-iframe-still-useful-8e8f7e099a23">Problems Inserting a Chatbot and The ‘All Too Obvious’ Solution</a> was originally published in <a href="https://medium.com/pipedrive-engineering">Pipedrive R&amp;D Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing Swup v2]]></title>
            <link>https://medium.com/@gmarcuk/introducing-swup-v2-814e40316dee?source=rss-a6f6bfd7ac54------2</link>
            <guid isPermaLink="false">https://medium.com/p/814e40316dee</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[page-transition]]></category>
            <dc:creator><![CDATA[Georgy Marchuk]]></dc:creator>
            <pubDate>Sun, 26 May 2019 17:07:59 GMT</pubDate>
            <atom:updated>2019-05-26T17:07:59.779Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0jYnkr0cd43cJV5-Bl-cwA.png" /></figure><p>It’s been some time since we talked about <a href="https://css-tricks.com/page-transitions-for-everyone/">page transitions</a> when <a href="https://github.com/gmrchk/swup">swup</a> was first introduced to the world. If you’ve still missed it, you’re certainly most encouraged to go ahead and find out more about swup and it’s motivation, but to describe it in a few words, it’s library that helps people implement smooth animated page transitions, faster load times, all together improve user experience and transform any site into a web app worth the title in 2019.</p><p>Since then we have crossed a long way together, fixed countless bugs, and introduced amazing features such as improved automatic scroll control, support for plugins, support for forms, improved API and so much more…</p><p>This wouldn’t be possible without CSS-Tricks and an amazing Github community where people come together to do something for themselves, and for others, so everyone can focus less on fixing bugs and figuring out basics, and focus more on implementing beautiful designs, telling fascinating stories and just being awesome.</p><p>This story is about swup, its new features, and the motivation behind it. If you’re impatient, here’s is a quick overview for you.</p><h3>TL;DR</h3><ul><li><strong>Redesigned </strong><a href="https://swup.js.org/plugins"><strong>plugins</strong></a> to allow anyone easily implement private plugins, or publish their own plugins for a community.</li><li>New <a href="https://swup.js.org/themes"><strong>Themes</strong></a><strong> </strong>feature to allow even faster to implement and much more easy to reuse page transitions. Three basic themes are “prepacked”.</li><li>Swup <a href="https://swup.js.org/cli"><strong>CLI</strong></a> to get started with developing a plugin or theme in seconds.</li><li>New <a href="https://swup.js.org/"><strong>documentation</strong></a> that anyone is welcome to improve and extend.</li><li>Fixed bunch of bugs.</li><li>Improves <a href="https://swup.js.org/api">API</a> for better extensibility with or without plugins.</li><li>Moves any unnecessary functionality into plugins for better load time and development experience:</li><li>forms → moved to <a href="https://swup.js.org/plugins/forms-plugin">Forms Plugin</a></li><li>scroll control and everything connected to it → moved to <a href="https://swup.js.org/plugins/scroll-plugin">Scroll Plugin</a></li><li>preload → moved to <a href="https://swup.js.org/plugins/preload-plugin">Preload Plugin</a></li><li>replacing of class on body tag → moved to <a href="https://swup.js.org/plugins/body-class-plugin">Body Class Plugin</a></li><li>debug mode → moved to <a href="https://swup.js.org/plugins/debug-plugin">Debug Plugin</a>, which also includes a bunch of new functionality to detect common mistakes when using swup</li><li>swupjs is now a <a href="https://swup.js.org/plugins/js-plugin">JS Plugin</a> and is more powerful</li><li>improved <a href="https://swup.js.org/plugins/head-plugin">Head Plugin</a></li><li>new frequently requested <a href="https://swup.js.org/plugins/scripts-plugin">Scripts Plugin</a></li><li>and some more stuff to discover…</li></ul><h3>Plugins and Themes</h3><p>Let’s talk about the plugins revamp. Swup already had a few plugins before, and the idea didn’t change that much. The main reason behind the change is the development experience.</p><p>It used to be hard to implement a plugin, there was no option to disable plugin once enabled, passing of options into a plugin was a pain, and the availability of plugins was strictly limited to the ones that were shipped with swup.</p><p>Well, now we’ve gone a different way. All plugins have a unified structure, all plugins can be enabled, manipulated with, or disabled without any side effects.</p><p>…but let’s get back to the development experience. In a past, I (and probably anyone who has used swup on more than one site) ended up copying a bunch of code from a previous project to re-enable JavaScript snippets/components used across projects, trigger some analytics the same way, or make swup animate in the first place. Well, we don’t have to do that anymore!</p><p>Swup plugins are now meant for people, and I don’t mean just developers utilizing swup plugins available by default… no! Creating and publishing plugins (or themes, while we’re at it) is now as simple as copying the code into a new project, and that’s for a few reasons.</p><p>First of, swup now has a plugin template — a quick head start for a plugin, so anyone going for it can just focus on the code he/she wants to implement. Second, and probably even more exciting, is the swup <strong>CLI</strong>. SCLI is utilizing the plugin/theme templates, with the addition of pulling the repo, renaming all the variables and all that stuff that doesn’t matter much with a first plugin, but gets really annoying when the number grows (trust me, I know…). Another wonderful thing is that any plugins created by SCLI are by default ready to be published into NPM with a standalone bundle included as well.</p><p>Themes, from a technical standpoint, are pretty much plugins with a different purpose. The purpose is to add any required styles, add HTML structure or modify DOM in some way to allow a quick and easy swup setup, without even having to define the animation, because someone has already done it before pretty well already. There are some additional helpers available in themes, the use off .css/.styl/.scss is also supported, but for more info head over to the <a href="https://swup.js.org/themes/create-theme">docs</a>.</p><h3>Spring Cleanup</h3><p>As mentioned before, part of the swup plugin revamp is the fact that most of the swups additional functionality is moved into plugins. In fact, any functionality that could be extracted has been extracted into a plugin.</p><p>This has several benefits, with the first being obviously smaller size of the core library. Swup has always been small and now is even smaller with size a little under 5kb. I don’t think I know any library with similar functionality that would get to this size in a standalone bundle. Plus, all the additional goodies can always be loaded with a tiny plugin.</p><p>However, the size is far from being the primary reason for this code separation. That’s an inability to make any changes or extending the library.</p><p>Page transitions are quite a fun thing actually. It’s a combination of very well planned series of events, a few browser hacks and usually lots of tweaking for the perfect outcome. Swup did take that into account and worked with all of it, but everything was just so much connected to each other that making any changes, or adding new functionality was a very painful process.</p><p>I’m sure I can rewrite the whole library right now, almost line by line after all the time I have spent with it, and it was still hard for me to make any modifications, not to mention an outside user that just came across swup recently. To sum it up, changes or adding of new functionality was hard and unpleasant. It’s funny how a hobby project can become second work that you try to avoid at times.</p><p>That being said, any functionality that is not essential to the core idea is now in plugins, where the use of events is more or less enforced, and swup event bus serves as an interface for each and single plugin to work with swup, while not touching any other plugin in any way.</p><p>I’m one of the people that just like to experiment, and it’s really frustrating when you can’t because any change would be a breaking change. I’m hoping to tackle this problem this way.</p><p>Want to add some more functionality? Create a plugin in minutes. See that you’re reusing some code a lot’s across projects? Plugin. Want to “give something back to the community”? Plugin/theme. Hell, want to try a completely different approach and rewrite the core significantly? Let’s do it! Let’s a create repo under swup organization, and experiment!</p><p>This revamp also includes some changes to the API and swup methods, that makes it much easier to modify the swup to your needs, like pulling a custom structure from a server instead of a standard HTML page.</p><p>This also allows for new functionality like <a href="https://swup.js.org/plugins/scroll-plugin">Scripts plugin</a> which I was always against. Now the functionality is implemented in a plugin, so swup stays untouched, but the functionality is there for anyone who needs it.</p><h3>Documentation</h3><p>Not much revolutionary here to be honest. Docs of swup were growing over time, and single page layout just wasn’t enough anymore. Search is definitely a helpful addition to the navigation structure as well, and anyone is encouraged to pitch in with a fix/improve the documentation, whether it’s content, or the site itself.</p><p>I think that documentation of swup is one of the things that people like about it, but there is always a space for improvement. I would say with every read…</p><h3>Conclusion</h3><p>To sum it up… for a user, swup can do everything it could before and some more, a little better and with an additional choice of whether you even need to load some functionality or not.</p><p>For a developer, it’s not a library anymore, it’s a platform. A platform that you can modify, extend, own a piece of it and help build a community for everyone.</p><p>Great ideas for generally used plugins could include things like ReCaptcha plugin, plugins for easy integration with WordPress in general, or some Vue.js integrations…? The sky is the limit here, so I will leave that for everyone&#39;s imagination.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=814e40316dee" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>