<?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: Mario Loncarek</title>
    <description>The latest articles on DEV Community by Mario Loncarek (@marioloncarek).</description>
    <link>https://dev.to/marioloncarek</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%2F361167%2F805aa735-0b45-409c-aef2-33c4fff4ede2.jpeg</url>
      <title>DEV Community: Mario Loncarek</title>
      <link>https://dev.to/marioloncarek</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marioloncarek"/>
    <language>en</language>
    <item>
      <title>Awesome Shopify Resources for 2022</title>
      <dc:creator>Mario Loncarek</dc:creator>
      <pubDate>Mon, 14 Feb 2022 09:04:18 +0000</pubDate>
      <link>https://dev.to/bornfightcompany/awesome-shopify-resources-for-2022-3hjh</link>
      <guid>https://dev.to/bornfightcompany/awesome-shopify-resources-for-2022-3hjh</guid>
      <description>&lt;p&gt;Shopify released a lot of new features in 2021, and naturally new tools and resources needed to be developed to cover new features. Next is a list of awesome Shopify Resources for 2022 which will help you to create modern Shopify storefronts.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;a href="https://github.com/Shopify/dawn"&gt;Dawn&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Dawn is Shopify's own open source theme with performance, flexibility, and Online Store 2.0 features built-in and acts as a reference for building Shopify themes. Its great for using it as a starter theme for your new Shopify project.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. &lt;a href="https://www.figma.com/community/file/1017615468313501249"&gt;Dawn Figma files&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;If you will use Dawn as a starter theme for a Shopify project, Shopify give us this great Figma file with all Dawn's components/sections/templates that you can send to designer to speed up the design process.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. &lt;a href="https://www.shopify.com/markets"&gt;Shopify Markets&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;In my opinion Shopify Markets will be the biggest update to Shopify since releasing Online Store 2.0 but will be even bigger than that. Markets will finally allow us to create Market-specific buying experiences. That means native multiple currencies, languages, language specific domains, duties collection for each market etc. It's currently available as a preview feature so I suggest that you don't sleep on this one!&lt;/p&gt;

&lt;h3&gt;
  
  
  4. &lt;a href="https://hydrogen.shopify.dev"&gt;Hydrogen&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Another great open source Shopify resource, but this time for creating headless experience. Hydrogen is React-based framework for building custom storefronts on Shopify which gives you everything you need to start fast, build fast, and deliver the best personalised shopping experiences.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. &lt;a href="https://github.com/idbakkasse/helium"&gt;Helium&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Helium is a great resource for using newest Online Store 2.0 features with modern build tools. Helium will allow you to use ES6, SCSS and hot module reloading for both. Great to use in combination with Shopify's Dawn.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. &lt;a href="https://github.com/ndimatteo/HULL"&gt;HULL&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Hull is another resource for creating headless experiences, but Hull is a complete starter powered by Next.js + Sanity.io. It has a lot of features so you can use it as a complete solution for your headless project.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. &lt;a href="https://github.com/uicrooks/shopify-theme-lab"&gt;Shopify Theme Lab&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Another complete headless solution, but this time for the Vue.js fans, and also you can swap Vue.js for pretty much anything if that stack is not suitable for project.&lt;/p&gt;

&lt;h3&gt;
  
  
  8. &lt;a href="https://github.com/bornfight/goCart.js"&gt;goCart.js&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;A complete open source Shopify Ajax cart solution written in vanilla JS. This plugin includes Ajax cart drawer, Ajax mini cart, add to cart modal, and error modal. Developed by Bornfight's frontend team and new, re-written version will be released this year. &lt;/p&gt;

</description>
      <category>engineeringmonday</category>
      <category>shopify</category>
      <category>resource</category>
      <category>ecommerce</category>
    </item>
    <item>
      <title>5 tips I wish I knew as a junior developer</title>
      <dc:creator>Mario Loncarek</dc:creator>
      <pubDate>Mon, 31 Jan 2022 11:34:08 +0000</pubDate>
      <link>https://dev.to/bornfightcompany/5-tips-i-wish-i-knew-as-a-junior-developer-38a1</link>
      <guid>https://dev.to/bornfightcompany/5-tips-i-wish-i-knew-as-a-junior-developer-38a1</guid>
      <description>&lt;p&gt;Here are some tips for junior developers or everyone who just started taking interest in becoming professional in the area, but especially for those who want to progress as quickly as possible. These tips come from my own personal experience and from mistakes I made which resulted in stagnation of my progress.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Kill the ego
&lt;/h2&gt;

&lt;p&gt;This is the most important one. Stop thinking that you already know everything. Stop trying to get attention to show how much you know. Stop saying “I know that”. Relax - everybody knows that you are a junior, they know how much you know and they shape your tasks to fit that fact. &lt;/p&gt;

&lt;p&gt;Coming into an agency environment for the first time in your life and thinking that you know something is a good sign of the level you are on. Know that every junior is a company’s investment for the future. It’s not expected that you make money for the company right away because you could not be independent in your work - when you’re a junior, there will always be someone checking after you, mentoring you and helping you when you get stuck. It's OK not to know everything and accept that, you are here to learn and that is what being a junior is. &lt;/p&gt;

&lt;p&gt;Killing your ego is the first step in making progress. Thinking that you know everything is the biggest blocker you can do for yourself, and you will not progress or grow until you completely eliminate your ego. Stay humble, hustle hard.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Request a good mentorship
&lt;/h2&gt;

&lt;p&gt;Now that you are ready to really learn and understand where you are, and on your path to becoming a better developer and worker, it’s time to understand how important it is to have a good mentor. I was very lucky to have the best possible person to mentor me, which made my skills skyrocket in a year or two. If you don't have one, request this from your company first thing in the morning. If a company would not provide you with a mentor, leave the company, that's not a good place for a junior developer, and it also shows red flags about how other aspects of the company are handled.&lt;/p&gt;

&lt;p&gt;Good mentor is a life hack in becoming a really good developer and useful for your company in much less time than it would take you alone (we are talking years here). A mentor will give you all of the answers you need many times faster than Google or Stack Overflow will. Take every advice you can from a mentor, squeeze as much information as you can and absorb like a sponge. Realize what mindset you need in order to be on your mentor’s level. It’s really important to learn how to listen - you are here to ask questions and not to be smart. Insist on constant code reviews, and insist on them to be very critical, and understand that critical code reviews are for your own good. Never take them personally. &lt;/p&gt;

&lt;p&gt;Never forget to respect your mentor because he is putting a lot of time and effort into making you a good developer and that is a very hard job to do, because knowing how to be a good mentor is a science on its own.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Show initiative
&lt;/h2&gt;

&lt;p&gt;If you want to stand out as a motivated worker, show initiative. That’s what separates people who are only doing their jobs from someone who wants to grow constantly. And that’s what being a good worker really is - a person who is highly motivated and shows initiative. That kind of person adds value to the company and pushes things to be done. &lt;/p&gt;

&lt;p&gt;Give constructive suggestions. Take the hardest task that no one else wants. Take ownership of the things you are doing and take responsibility for how they are done. But try to be useful while doing it, don’t just do things for the sake of doing them to show off - meaning don’t be fake!&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Be the hardest working individual
&lt;/h2&gt;

&lt;p&gt;Work hard and stay hungry. Seek to be the best developer in your company, but compete only with yourself. Not everyone has the same timeline, so never compare yourself to others. You are on your own path and things will come - and that will only depend on you. &lt;/p&gt;

&lt;p&gt;Difference between being good and being great is proportional with the hard work you are willing to invest in your skill. Most of the time this will mean going an extra mile in your free time. Having a good life/work balance is important, but I do not regret working hard after my 9-5 job when I needed to understand things deeper because it helped me to get where I wanted to be and to learn much faster.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Understand how business really works
&lt;/h2&gt;

&lt;p&gt;Don't think about the money at all as a junior developer. Only focus on learning, progressing and gathering real experience. You want to be on a level on which you are useful for the company and you can create real revenue with the work you do. Until that point you really don't have many arguments for some crazy salary. Money will come naturally, and a good company will never exploit your level, so don’t worry about being hungry, or recognize another red flag of a bad company. &lt;/p&gt;

&lt;p&gt;But don’t fool yourself - realize early that when talking about the business side of everything, in the end it’s all about the money. Your salary depends on how much money you can earn for the company through your work. Companies can not do business if they are losing money. That's why employing a junior is an investment for the future of the company because companies lose money until you can be independent in your work and become useful. That also means that your salary will be bigger with more useful work you can do if you're into the money thing. &lt;/p&gt;

&lt;p&gt;Of course, you can make more money on your own, but you will never become a great specialist if you don’t start working in the company first - that is where you will be given real experience, big projects and the best possible education. That’s all the things you will not get as a junior developer going on your own. And in my opinion, that will slow your progress - and we’re talking about years here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;These are the tips that would have helped me a lot throughout my junior years. What do you think about them?&lt;br&gt;
Do you have any other tips or disagreements with any of them? Let me know in the comments.&lt;/p&gt;

</description>
      <category>engineeringmonday</category>
      <category>career</category>
      <category>beginners</category>
      <category>motivation</category>
    </item>
    <item>
      <title>How to protect GitHub projects from non-reviewed code and force code review culture</title>
      <dc:creator>Mario Loncarek</dc:creator>
      <pubDate>Tue, 31 Aug 2021 07:39:24 +0000</pubDate>
      <link>https://dev.to/bornfightcompany/how-to-protect-github-projects-from-non-reviewed-code-and-force-code-review-culture-3ip7</link>
      <guid>https://dev.to/bornfightcompany/how-to-protect-github-projects-from-non-reviewed-code-and-force-code-review-culture-3ip7</guid>
      <description>&lt;p&gt;In this blog post I will show you a way of protecting GitHub repositories from random pushes of non-reviewed code or pushes to the &lt;code&gt;master&lt;/code&gt;/&lt;code&gt;main&lt;/code&gt; branch. I’m a strong believer in deploying features via pull requests with code review. I will not get into the question if the branch and pull request workflow is good or bad, I have my opinion which is that pull requests and code reviews are a must for a team that wants to learn, so if you don't agree this article is not for you because it forces all team members to use it.&lt;/p&gt;

&lt;p&gt;Code review is a practice that depends on the culture. A culture with no ego, with a great wish for continuous learning, sharing and teamwork. Besides learning code, code reviews will improve your communication soft skills as you will need to be clear and professional without being harsh which will also show you if you are a good mentor or not.&lt;/p&gt;

&lt;p&gt;This article will focus on 3 steps to achieve pull request with code review practice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Workflow in theory &lt;/li&gt;
&lt;li&gt;Setting up your project&lt;/li&gt;
&lt;li&gt;Creating pull request template&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Workflow in theory
&lt;/h3&gt;

&lt;p&gt;1.On GitHub create a new branch from &lt;code&gt;master&lt;/code&gt; and use standard naming convention for branches:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;feature/name-of-the-feature&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;fix/name-of-the-fix&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Try to do this for every &lt;code&gt;feature&lt;/code&gt;/&lt;code&gt;fix&lt;/code&gt; to avoid creating very large pull requests which will be very time consuming for reviewers.&lt;/p&gt;

&lt;p&gt;2.After you finish working, commit and push your code to your &lt;code&gt;feature&lt;/code&gt;/&lt;code&gt;fix&lt;/code&gt; branch and create pull request to merge this branch to &lt;code&gt;master&lt;/code&gt; branch.&lt;/p&gt;

&lt;p&gt;3.Assign someone for code review. The goal here is to learn from each other and to make sure all standards are met and code style is respected, and of course to make sure code does not have any bugs. &lt;/p&gt;

&lt;p&gt;4.If there are any questions/suggestions/fixes/changes requested from the person which is conducting code review, that person will request changes on GitHub with clear comments and the process starts again. All comments need to be resolved before the reviewer can accept the pull request, either changes or only answering the questions.&lt;/p&gt;

&lt;p&gt;5.After successful code review, the branch will be merged into the &lt;code&gt;master&lt;/code&gt; branch and the &lt;code&gt;feature&lt;/code&gt;/&lt;code&gt;fix&lt;/code&gt; branch will be automatically deleted.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting up your project
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Create &lt;code&gt;CODEOWNERS&lt;/code&gt; file
&lt;/h4&gt;

&lt;p&gt;Code owners file defines individuals or teams that are responsible for code in a repository. Code owners are automatically requested for review when someone opens a pull request that modifies code that they own. To use a &lt;code&gt;CODEOWNERS&lt;/code&gt; file, create a new file called &lt;code&gt;CODEOWNERS&lt;/code&gt; in the &lt;code&gt;root&lt;/code&gt;, &lt;code&gt;docs/&lt;/code&gt;, or &lt;code&gt;.github/&lt;/code&gt; directory of the repository, in the branch where you'd like to add the code owners. I’m a simple guy so I always put everything in the &lt;code&gt;root&lt;/code&gt;. You can assign different code owners for different branches. In practice, no one could approve pull requests without code owners approval. This will protect developers from trying to merge pull requests that no one approved.&lt;/p&gt;

&lt;p&gt;Example &lt;code&gt;CODEOWNERS&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* @marioloncarek
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. Manage user roles
&lt;/h4&gt;

&lt;p&gt;On GitHub repository go to the &lt;code&gt;Settings&lt;/code&gt; tab and then choose &lt;code&gt;Manage access&lt;/code&gt; from the left menu. Here you can define which users can access your repository and what are their roles. Always have at least one administrator, and all other developers can have write permissions. In practice, administrators could override everything from this article and use their privileges to make changes on master branch or force merge without review. This could be helpful for hotfixes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fswdnah795f1ije4m0ybd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fswdnah795f1ije4m0ybd.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Configure branch protection settings
&lt;/h4&gt;

&lt;p&gt;On GitHub repository go to the &lt;code&gt;Settings&lt;/code&gt; tab and then choose &lt;code&gt;Branches&lt;/code&gt; from the left menu. Under &lt;code&gt;Branch protection rules&lt;/code&gt; click &lt;code&gt;Add rule&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8oaw6a95dh7c8c7z3rou.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8oaw6a95dh7c8c7z3rou.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will open branch protection configuration. Under &lt;code&gt;Branch name pattern&lt;/code&gt; write your main branch name (probably &lt;code&gt;master&lt;/code&gt;) or any other branch you wish to protect. Configure all options according to this image:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1v8u1bjmg093g7o5hyvi.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1v8u1bjmg093g7o5hyvi.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This configuration will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;require pull request reviews before merging &lt;/li&gt;
&lt;li&gt;require review from code owners&lt;/li&gt;
&lt;li&gt;restrict who can dismiss pull request reviews&lt;/li&gt;
&lt;li&gt;require status checks to pass before merging&lt;/li&gt;
&lt;li&gt;require branches to be up to date before merging&lt;/li&gt;
&lt;li&gt;require conversation resolution before merging&lt;/li&gt;
&lt;li&gt;restrict who can push to matching branches&lt;/li&gt;
&lt;li&gt;disallow force pushes for all users with push access&lt;/li&gt;
&lt;li&gt;disallow users with push access to delete matching branches&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Creating &lt;code&gt;pull_request_template.md&lt;/code&gt; file
&lt;/h3&gt;

&lt;p&gt;When you add a pull request template to your repository, project contributors will automatically see the template's contents in the pull request body.&lt;/p&gt;

&lt;p&gt;To make your pull request template visible in the repository's root directory, name the pull request template &lt;code&gt;pull_request_template.md&lt;/code&gt; and put it in the &lt;code&gt;root&lt;/code&gt; of the repository.&lt;/p&gt;

&lt;p&gt;Now when a contributor creates a new pull request they will see the template which will make pull request more standardised and contributors can be reminded about stuff that is important for the project (like standards, code style, build flows etc etc) with checklists.&lt;/p&gt;

&lt;p&gt;Example &lt;code&gt;pull_request_template.md&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

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

Please include a summary of the change or which issue is fixed.

## Type of change

- [ ] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

## Area of change

- [ ] Frontend
- [ ] Backend

## General checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I ran `npm run format`/`yarn format` before commit
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation where needed
- [ ] My changes generate no new warnings
- [ ] I have checked my code and corrected any misspellings
- [ ] I have updated `master` and merged to my branch before submitting pull request
- [ ] My pull request generate no conflicts with `master` branch
- [ ] I requested code review from other team members

## Frontend checklist:

- [ ] I followed guidelines for `HTML`/`LIQUID`, `SCSS`, `JAVASCRIPT` from readme
- [ ] My `Javascript` generate no new console errors  
- [ ] I tested my code cross browsers
- [ ] My slice is pixel perfect for both desktop and mobile according to design
- [ ] I conducted basic QA to assure all features are working
- [ ] I tested responsive for mobile and tablet resolutions

## Backend checklist:

- [ ] I tested admin by manually adding content from zero
- [ ] I followed guidelines for naming admin fields
- [ ] I created easy to use admin experience which is self-explanatory
- [ ] I added description to admin fields in hard-to-understand areas
- [ ] I followed guidelines for naming `php`/`liquid` variables
- [ ] I conducted basic QA to assure all features are working
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;These 3 setup steps will create strong protection of repositories against pushes of non-reviewed code or direct pushes to the master/main branch. It will force the team to apply the rules and maintain the code review culture.&lt;/p&gt;

&lt;p&gt;It’s not always easy to enforce people to follow the rules, but with suggestions given throughout the post, you can automate them quickly, to make sure that everyone follows them.&lt;/p&gt;

&lt;p&gt;What do you think about rules mentioned above? Do you have other advices to improve your team’s workflow?&lt;/p&gt;

</description>
      <category>engineeringmonday</category>
      <category>github</category>
      <category>codereview</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Fast Shopify development with hybrid Debut theme</title>
      <dc:creator>Mario Loncarek</dc:creator>
      <pubDate>Mon, 12 Apr 2021 11:48:02 +0000</pubDate>
      <link>https://dev.to/bornfightcompany/fast-shopify-development-with-hybrid-debut-theme-3940</link>
      <guid>https://dev.to/bornfightcompany/fast-shopify-development-with-hybrid-debut-theme-3940</guid>
      <description>&lt;p&gt;In this article I will explain how we &lt;a class="mentioned-user" href="https://dev.to/bornfight"&gt;@bornfight&lt;/a&gt; approach developing Shopify themes for clients with a budget or timeline that is not suitable for full custom development, which we prefer. If that is the case we love to suggest starting with a theme to lower the cost and shorten the development time. Hybrid in this context means crossing a theme with fully developed features with tools for modern frontend development like ES6, SCSS and utilizing features like Hot Module Replacement etc. &lt;/p&gt;

&lt;p&gt;To achieve this we will be using: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://themes.shopify.com/themes/debut/styles/default" rel="noopener noreferrer"&gt;Shopify Debut theme&lt;/a&gt; - as scaffolding tool for faster development&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/Shopify/themekit" rel="noopener noreferrer"&gt;Themekit&lt;/a&gt; - development tools to interact with the Shopify platform to watch for local changes and upload them automatically to Shopify&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/hayes0724/shopify-packer" rel="noopener noreferrer"&gt;Shopify Packer&lt;/a&gt; - bridge that allows us to develop using modern tools like Webpack 5 for minification, bundle splitting, bundle analysis, prefetch and easier manipulation with themekit &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/bornfight/b-creative" rel="noopener noreferrer"&gt;Bornfight b-creative&lt;/a&gt; - &lt;a href="https://www.bornfight.com" rel="noopener noreferrer"&gt;Bornfight&lt;/a&gt; frontend project template for code style and rules&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why Debut theme?
&lt;/h3&gt;

&lt;p&gt;I like starting with the Debut theme because it's designed and written by the Shopify team and it's free. It offers a great number of features like predictive search, adding to cart with Ajax, product image zoom and gallery etc, basically everything you need to develop a shop with all the features . It's also written quite well and offers some of the latest tricks for making ultra fast websites which is very important for any website, and it's fully accessible. It also comes with a large number of locales for the whole theme. Since we are not using Debut because of the design, its minimal looks is a feature, not a bug. &lt;/p&gt;

&lt;h3&gt;
  
  
  Introducing Shopify Packer
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/hayes0724/shopify-packer" rel="noopener noreferrer"&gt;Shopify Packer&lt;/a&gt; written by &lt;a href="https://github.com/hayes0724" rel="noopener noreferrer"&gt;Eric Hayes&lt;/a&gt; is probably the best thing happened to Shopify theme development since Shopify stopped supporting Slate. It's everything we all hoped for and that's a promise. Packer uses Webpack 5 with zero config to compile, bundle, split and minify your modern development technologies and start a server for development with hot module reloading actually working perfectly. It can also create, list and manipulate (delete, download, deploy etc) themes from your shop which is a lifesaver sometimes. I also love using Eric's Shopify Packer because it uses SCSS, Stylelint, ESLint, Babel and PostCSS. It can analyze bundles and have multiple entry points for templates and layouts. It's actually a CLI tool that’s installed globally and you can start a new project or integrate Packer with an existing theme in ridiculously little time. Most importantly you can easily customize all settings for the site and webpack if needed. Eric also provides quick support for the packer so i would highly recommend it and also buy him a beer because he deserves one for this! &lt;/p&gt;

&lt;h3&gt;
  
  
  Standardising code with Bornfight’s b-creative
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/bornfight/b-creative" rel="noopener noreferrer"&gt;B-creative&lt;/a&gt; is a modern frontend starter from &lt;a href="https://www.bornfight.com" rel="noopener noreferrer"&gt;Bornfight&lt;/a&gt; that has standardised opinionated code style and architecture for SCSS, Javascript and HTML/PHP/Liquid. It’s used and contributed by multiple teams. B-creative integrates perfectly with Packer because it uses the same linters so we can just copy their configs and have the same style across all platforms. Templates for SCSS and Javascript modules give us faster development times without having to write the same stuff over and over again. Using b-creative’s SCSS is also future proof because it provides tools to scale the site from 1440px (or any configured base resolution) to any bigger resolution and the site will look the same, while still giving the ability to have the other logic for mobile resolutions. &lt;/p&gt;

&lt;h3&gt;
  
  
  How to connect all the tools to create hybrid setup?
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Thinking about design
&lt;/h4&gt;

&lt;p&gt;Firstly create a new development store which will then come with a Debut theme pre-installed or just install the Debut as a new theme. Now you can provide the designer with the preview link so he/she can look at all the stuff that it needs to style. Goal here is to create a design that follows Debut themes features, components and repeatable sections. &lt;/p&gt;

&lt;h4&gt;
  
  
  Integrating Packer
&lt;/h4&gt;

&lt;p&gt;Next thing to do is to connect Shopify Packer with the Debut theme for local development and to utilize modern development tools. You can connect Packer with an existing theme or you can create a new blank theme and copy and replace Packers starter theme files from &lt;code&gt;src&lt;/code&gt; folder with all of the Debut files you get when you download, which is my preferred way. This will then leave you with all of the Debut &lt;code&gt;assets&lt;/code&gt;, &lt;code&gt;config&lt;/code&gt;, &lt;code&gt;layout&lt;/code&gt;, &lt;code&gt;locales&lt;/code&gt;, &lt;code&gt;sections&lt;/code&gt;, &lt;code&gt;snippets&lt;/code&gt; and &lt;code&gt;templates&lt;/code&gt;, along with Packers &lt;code&gt;styles&lt;/code&gt; and &lt;code&gt;scripts&lt;/code&gt; folder which will then be used to create new custom styles and scripts. Follow Packers docs to generate API access that Packer needs to work with the themekit (same process as only using themekit - private app API password). &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk2jcs6zwlya4r4vxwztr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk2jcs6zwlya4r4vxwztr.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next thing to do is to include Packers &lt;code&gt;CSS&lt;/code&gt; and &lt;code&gt;JS&lt;/code&gt;  files into &lt;code&gt;theme.liquid&lt;/code&gt; and then you will load all of the assets from Debut and all of the assets from Packer. You can do the same for &lt;code&gt;password.liquid&lt;/code&gt; and &lt;code&gt;gift_card.liquid&lt;/code&gt; if needed.  You will probably want to delete the Debuts CSS file completely and only use its Javascript features, because it's not likely you will need any Debuts styles. Note that in order for all of the Debuts Javascript features to work you should not remove classes from the liquid files, because CSS classes used by Debuts Javascript are not prefixed with &lt;code&gt;js-*&lt;/code&gt; so you can just build upon the necessary sections and snippets with your new custom classes. &lt;/p&gt;

&lt;p&gt;To test if you did everything correctly at this point, running Packers start script should open a new local server for assets and you should see unstyled Debut theme files if you deleted the CSS file or styled Debut theme if you did not. If you try to change the background color of the body in SCSS, Packer should compile it and trigger Hot Module Replacement and you should see the background color changing without you reloading. If that works, then Packer is correctly integrated with Debut. To test if all of the Javascript features from Debut are working, try clicking on the search icon in the navigation bar and predictive search should work properly. Try adding some dummy products to help you with testing that feature. Also on the product single page you should be able to zoom the product image on hover and add to cart without reloading with Ajax. If that works, that means all Javascript features you wanted from Debut are working. &lt;/p&gt;

&lt;p&gt;Feel free to delete all sections and snippets you don't need and which do not contain any wanted Javascript features but always test if everything is working properly. You can also remove unnecessary styles and variables from Debuts theme.liquid file where you included Packers CSS and JS because you probably will not need them. Also reduce the number of assets from Debut by removing the ones you don't need.&lt;/p&gt;

&lt;h4&gt;
  
  
  Integrating b-creative
&lt;/h4&gt;

&lt;p&gt;Next we will copy SCSS and JS architecture from Bornfight's b-creative along with linter configs to achieve standardised code. Best thing to do is not to change names of the Packer main entrance point files and just include b-creative’s files inside existing Packer files (they are empty anyways). Don't forget to copy the fonts folder because it's needed for including fonts with b-creative. Your new SCSS and JS will also need some dependencies installed which you can find in b-creative’s package.json file under dependencies. B-creative comes with Bornfight’s modern &lt;a href="https://github.com/bornfight/b-reset" rel="noopener noreferrer"&gt;CSS reset&lt;/a&gt; to help you with developing new features.&lt;/p&gt;

&lt;p&gt;Test again if everything compiles properly. Now you should expect opening a new local server for assets with Packer, Roboto font used as main font (for testing purposes) and all of the Javascript features from Debut working as tested few steps back. If so, now you have a Debut theme ready for modern local development with modernisation and code style from Bornfight’s b-creative. If the designer followed the Debut’s flow, you will probably only need to write new styles according to design, without even touching JS because you already use all from Debut. This will then drastically change the time needed for development of the shop.&lt;/p&gt;

&lt;p&gt;Your final structure should look something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsbjhng5ozck1kvt137ll.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsbjhng5ozck1kvt137ll.png" alt="Folder structure"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And if everything is configured correctly, running &lt;code&gt;packer start&lt;/code&gt; should give you this result:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhz7rrivmi0colup6sm21.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhz7rrivmi0colup6sm21.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Final thoughts
&lt;/h3&gt;

&lt;p&gt;I would like to finish this article with some pros and cons of using this hybrid setup for developing new themes.&lt;/p&gt;

&lt;h4&gt;
  
  
  Pros:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Faster and cheaper development time when designing and developing upon the Debut theme for “projects on budget”&lt;/li&gt;
&lt;li&gt;Local development with all of the features&lt;/li&gt;
&lt;li&gt;Using modern tools like ES6 and SCSS to develop themes&lt;/li&gt;
&lt;li&gt;Hot Module Replacement so you don't have to reload all the time while development&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Cons:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Slightly complex for setting up a new project because it needs multiple tools merged into one&lt;/li&gt;
&lt;li&gt;Leaves a lot of code bloat from Debut theme, mostly in Javascript that you will not use&lt;/li&gt;
&lt;li&gt;Is probably not suitable for anything else then to develop themes cheaper and with tight timeline &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you need Shopify development, feel free to contact us at &lt;a href="mailto:hello@bornfight.com"&gt;hello@bornfight.com&lt;/a&gt; .&lt;/p&gt;

</description>
      <category>engineeringmonday</category>
      <category>shopify</category>
      <category>webpack</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to improve loading custom fonts with font-face</title>
      <dc:creator>Mario Loncarek</dc:creator>
      <pubDate>Mon, 06 Apr 2020 13:48:14 +0000</pubDate>
      <link>https://dev.to/bornfightcompany/how-to-improve-loading-custom-fonts-with-font-face-5ai3</link>
      <guid>https://dev.to/bornfightcompany/how-to-improve-loading-custom-fonts-with-font-face-5ai3</guid>
      <description>&lt;h3&gt;
  
  
  Why
&lt;/h3&gt;

&lt;p&gt;I would like to start this article with why are we even optimising the font delivery. Have you ever thought about why we are forcing &lt;code&gt;font-face&lt;/code&gt; properties to be on the top of our CSS, as a first thing? So we have the font as fast as possible and reduce blocking time for users. By going even further and possibly eliminating time users only see the white (blank) screen on above the fold area, we can directly affect user centric performance metrics which then affect speed index time. So Google will give you a bigger performance score, which is now one of the most important scores for Google page rank.&lt;/p&gt;

&lt;h3&gt;
  
  
  Background
&lt;/h3&gt;

&lt;p&gt;Optimising font delivery is a process in which developers optimise the way custom web fonts are downloaded on critical rendering path with different strategies. There are few ways to include custom web fonts on a website, and in this article we will be focusing on using &lt;code&gt;font-face&lt;/code&gt; to include them. By default using custom fonts means that the files will be render blocking resources. That also means that until the custom fonts are downloaded, the browser has some default behaviours how to handle that. By default, text is invisible and the user is seeing white (blank) screen until the fonts are downloaded. That period is called FOIT or Flash of Invisible Text. Let’s use Chrome Dev Tools’ Network recording feature to further analyse the font loading.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pus5gKSv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/76ohro2b734rw6qczvfv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pus5gKSv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/76ohro2b734rw6qczvfv.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see on the image that the browser is not showing text until the custom font is loaded. But that period has a timeout, it will not last forever because it has a bad influence on the speed index. Chrome, Opera and Firefox will hide your text for up to 3 seconds before showing a fallback font. This period is called FOUT or Flash of Unstyled Text. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--m1CgTFN6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5dbt3fpactfinuv4414h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--m1CgTFN6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5dbt3fpactfinuv4414h.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Good news is that we can control the way browsers handle fonts and optimise the delivery. So we can force or not force some of the periods explained in this text, depending on what we are trying to achieve and what are our performance optimisation strategies.&lt;/p&gt;

&lt;p&gt;While there are many ways to do it, this article will explain the most simple way - &lt;code&gt;font-display&lt;/code&gt; CSS property. &lt;/p&gt;

&lt;h3&gt;
  
  
  About &lt;code&gt;font-display&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;font-display&lt;/code&gt; CSS descriptor for &lt;code&gt;font-face&lt;/code&gt; is a new way developers can optimise font delivery by deciding how custom web fonts will be downloaded and displayed. Works similar to some Javascript strategies to load fonts but this is CSS only solution and that's why it's great. It has &lt;code&gt;auto&lt;/code&gt;, &lt;code&gt;swap&lt;/code&gt;, &lt;code&gt;block&lt;/code&gt;, &lt;code&gt;fallback&lt;/code&gt; and &lt;code&gt;optional&lt;/code&gt; as potential values. Let’s see what each of these values represent.&lt;/p&gt;

&lt;h4&gt;
  
  
  Auto
&lt;/h4&gt;

&lt;p&gt;This is the default browser behaviour and typically that would be FOIT and then FOUT if needed (as explained in the “Background” part of this article).&lt;/p&gt;

&lt;h4&gt;
  
  
  Swap
&lt;/h4&gt;

&lt;p&gt;Fallback text is immediately rendered, so no FOIT time, but we are forcing FOUT. As soon as a custom font is downloaded and available, browser will swap the font. This is the fastest method but also the most aggressive. Swap gives the font face a zero second block period. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GR75cBsL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/n3oabdtci9d8dsx43rbs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GR75cBsL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/n3oabdtci9d8dsx43rbs.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Block
&lt;/h4&gt;

&lt;p&gt;No fallback fonts are shown, so we are forcing FOIT and not FOUT. Text will be invisible until custom fonts are loaded, and as soon as the custom fonts are downloaded and available browser will swap the font.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rhMmT4Ny--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gqc24pl9ebtbw0x6ncx3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rhMmT4Ny--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gqc24pl9ebtbw0x6ncx3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Fallback
&lt;/h4&gt;

&lt;p&gt;Hybrid between block and swap. Browser will give a very short period of FOIT, but if too much time passes, fallback font will be shown and we will have FOUT. As soon as the custom fonts are downloaded and available browser will swap the font.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9fnlCoX7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4mkvfqptny4f4eq9np00.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9fnlCoX7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4mkvfqptny4f4eq9np00.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Optional
&lt;/h4&gt;

&lt;p&gt;Optional acts like fallback but gives the browser freedom to choose whether or not a font should even be used, depending on the user’s connection speed, where slower connections are less likely to receive the custom font.&lt;/p&gt;

&lt;h3&gt;
  
  
  Which one to use?
&lt;/h3&gt;

&lt;p&gt;My advice would be to not use the properties without thinking or defining what is your loading strategy, what is the priority for rendering and what is more important when the page is loading. So firstly analyze your current situation, define what is important for your loading strategy and then use the appropriate one. After that test visually how user would see loading of the page on various network connection speeds, and see if it suits your needs.&lt;/p&gt;

</description>
      <category>engineeringmonday</category>
      <category>performance</category>
      <category>optimisation</category>
      <category>frontend</category>
    </item>
  </channel>
</rss>
