<?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 Eduard Pochtar on Medium]]></title>
        <description><![CDATA[Stories by Eduard Pochtar on Medium]]></description>
        <link>https://medium.com/@eduarddotgg?source=rss-2128947d2813------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0VumHNhqxf05zgL4cFuZTg.jpeg</url>
            <title>Stories by Eduard Pochtar on Medium</title>
            <link>https://medium.com/@eduarddotgg?source=rss-2128947d2813------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 06:13:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@eduarddotgg/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[Utility first CSS class names hell. Is there any solution?]]></title>
            <link>https://eduarddotgg.medium.com/utility-first-css-class-names-hell-is-there-any-solution-858ecc9c3f2e?source=rss-2128947d2813------2</link>
            <guid isPermaLink="false">https://medium.com/p/858ecc9c3f2e</guid>
            <dc:creator><![CDATA[Eduard Pochtar]]></dc:creator>
            <pubDate>Tue, 25 May 2021 08:29:19 GMT</pubDate>
            <atom:updated>2021-05-25T08:29:19.375Z</atom:updated>
            <content:encoded><![CDATA[<p>Utility first CSS is very powerful and flexible but it has one downside that I personally don’t like — long long <br>long class attributes:<br>```pug<br>div(class=”bg-gray-900 flex flex-col gap-24 absolute top-1/2 left-1/2 transform -translat-x-1/2 -translat-y-1/2 <br>text-center”)<br>```<br>and this one is not the longest one, but it’s enough to understand that it’s hard to read even here.</p><p>The problem with this approach is that it’s har to read the code especially when there are so many complex elements.<br>It’s possible to solve this problem with mixins and use one or several classNames but this can make your css file <br>very big and it will be hard to optimize it in the future.</p><p>Or you can use wrap elements with additional ones to distribute class names but this will bloat html with <br>unnecessary elements.</p><p>There is another way how to solve this problem put your class name to variables for example something like i18n does.<br>But I would like to share less complex method using simple variables this can work in almost any modern framework or <br>almost any template language. In this short article I will use pug for demonstration.</p><p>So instead of writing all class names into class attribute you can use variable in pug:<br>```pug<br>- var myComponent = “bg-gray-900 flex flex-col gap-24 absolute top-1/2 left-1/2 transform -translat-x-1/2 <br>-translat-y-1/2 text-center”</p><p>div(class=myComponent)<br>```<br>But wait a minute what if I need some kind of modifier? Well there is also solution for that. You can split your <br>variables into different kind of levels so you could mix them too:<br>```pug<br>- var myComponentBase=” bg-gray-900 flex flex-col gap-24 absolute top-1/2 left-1/2 transform -translat-x-1/2 <br>-translat-y-1/2 text-center “<br>- var myComponentText1=” font-24 leading-32 font-800 “<br>- var myComponentText2=” font-18 leading-32 font-400 “</p><p>div(class=myComponentBase + myComponentText1)<br>div(class=myComponentBase + myComponentText2)</p><p>// or<br>div(class=myComponentBase + “ font-18 leading-32 font-400”)<br>```<br>Variables can be global, you can put them into separate file include them where ever you need them. You can also <br>have separate file per component. As you can see there are a lot of possibilities with this approach everything <br>depends on your imagination!</p><p>There is one thing to keep in mind. Each approach has it’s own downsides. The problem with this one is that if you <br>would like to debug something in a browser than to search for something in the code that it will be a little bit <br>tricky to dao that if your code is not organized well for example if your class name variables are somewhere far <br>away from your components that it will take more time to find them.</p><p>As for frameworks everything works very similar you put all your class names into variables and then use them where ever you want to use them. Additionally you can implement something like i18n but for utility first css.</p><p>In the end of the day you should decide which approach would you like to use, which downsides are acceptable for you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=858ecc9c3f2e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Poco — project orchestration. Introduction.]]></title>
            <link>https://eduarddotgg.medium.com/poco-project-orchestration-introduction-f2a834db965d?source=rss-2128947d2813------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2a834db965d</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Eduard Pochtar]]></dc:creator>
            <pubDate>Wed, 14 Nov 2018 09:10:23 GMT</pubDate>
            <atom:updated>2018-11-14T09:10:23.339Z</atom:updated>
            <content:encoded><![CDATA[<h3>Poco — project orchestration. Introduction.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*m1bS5XgJpSDOSrMx" /><figcaption>“aerial photography of delivery ship” by <a href="https://unsplash.com/@cmventi20?utm_source=medium&amp;utm_medium=referral">Cameron Venti</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Today’s amount of the technologies and instruments is just impressive. But, unfortunately, we still don’t have one solution that will solve all our problems. Probably, this is what helps us to evolve.</p><p>There is no just one solution that would fit to any project, these means that each project might have its own, sometimes unique, solution. Of course it doesn’t mean that we can’t use one solution for different projects, but at the same time, we should not be limited to only one solution. For example there are a lot of advices that you have to enable gzip, which will make your website smaller and load faster. But what if your server has limited hardware resources like raspberry Pi, shared server, etc.? In this case it will help you to compress your data but at the same time it will slow down your sever which can be critical for you. Another example — I have encountered websites that use JS frameworks (like React.js, Vue.js or Angular.js) for landing or login pages. Of course these frameworks can the best fit for complex apps (components, isolation, hype). But it doesn’t mean that we have to apply them everywhere where it is possible and not possible. Why anyone who visits your web app and will never login should download bundle he/she will never use? Why login page should have extra +/-300kb of JavaScript when in most of the cases it will be enough to use vanilla solutions like HTML form or simple links for social logins? I can continue this list of examples, but the point is that we should solve problems individually for each case, finding the best solution.</p><p>Individuality of our projects is what makes them complex as they have different requirements and serve for different goals. Ability to set up locally, build, deploy as fast as possible any project of any complexity is very important criteria of today’s teams and companies. Depending on the project’s complexity, its set up and configuration can take from few minutes to few hours or days. If the project is not yet containerized, the time of it’s set up and configuration is multiplied by number of machines (local, servers) where it should run. When you work with other developers in a team or at the company or even by yourself, time is one of the most expensive resources you have. So it’s very important to spend time for things that really matter.</p><p>Containerization is what drives today’s developers crazy. It’s one of the biggest innovations since invention of internet (well not really, but it is still very big and important innovation for many of us). It helps us to set up and configure any project in any environment with the speed of light (well actually not, but comparing to the past years).</p><p>Docker is today’s pioneer of containerization. It’s really powerful but of course, as any other technology, it has it’s own advantages and disadvantages. In good hands it can do impossible things, for some of us, even magical. It was game changing when we tried Docker for the first time. We were so impressed by it’s power, that decided to create tool called Poco, which dramatically improved our workflow with docker. In this article I would like to share with you how Poco helps us in our everyday development.</p><h3>Issue.</h3><p>As in any other fast-growing team, the question about automation of setting up local environment in our team was raised quite early. The bigger our team was growing the harder for us it was to configure local environment for new developers. The main problem was that each developer had unique environment, which meant, that each time we tried to set up local environment, we faced new and new problems. We tried to fix the situation with manuals and check lists but they didn’t work very well, we still had a lot of problems and we still wasted a lot of time figuring out why some things didn’t work.</p><p>Docker saved the world. After we had tried docker it solved a lot of problems for us. We were really excited, so excited that decided to go further and to make it even better. We didn’t have problems with docker itself. By its nature docker is very simple and flexible. Instead, we found that our entire workflow (searching, cloning, starting) could be improved. If we look at a usual workflow it might look like this:</p><ul><li>search and find desired project</li><li>clone project</li><li>start project</li></ul><p>While this workflow may seem simple, it can have a lot of questions:</p><ul><li>what are the requirements?</li><li>how to start it?</li><li>how to start required environment?</li><li>and more…</li></ul><p>Sometimes it can take some time. Even with docker itself sometimes things can get complicated especially when we have to work with complex projects. So at some point we thought what if it would be possible to clone and start any project, of any complexity, in any environment just with one command line. And we could not find anything simpler than:</p><pre>poco up my-project</pre><p>Believe it or not it’s so easy, that even manager will be able to launch any project.</p><h3>What is Poco and how does it work?</h3><p>Poco is a tiny wrapper over Git and Docker. Both Git and Docker can be optional but in that case it’s really hard to feel the power of Poco. As I mentioned before, Poco’s main feature is to clone and start docker project just with one command line. You can create custom catalogs (registries) to manage and organise your projects. You can create multiple plans for multiple running modes (frontend, backend, full-stack, test, production, demonstration).</p><p>Poco is very handy for developers and teams who work with big amount of projects.</p><h4>Getting Started</h4><p>Requirenments:</p><ul><li>Python (<a href="https://www.python.org/downloads/">https://www.python.org/downloads/</a>)</li><li>Git (<a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git">https://git-scm.com/book/en/v2/Getting-Started-Installing-Git</a>)</li><li>Docker (<a href="https://docs.docker.com/install/">https://docs.docker.com/install/</a>)</li></ul><p>Install poco:</p><pre>pip install poco</pre><p>Create hello-world git repository:</p><pre>mkdir hello-world<br>cd hello-world<br>git init<br>poco init</pre><p>This will create poco.yaml:</p><pre>version: &#39;2.0&#39;<br>maintainer: &quot;<a href="/service/mailto:operation@shiwaforce.com">operation@shiwaforce.com</a>&quot;</pre><pre>plan:<br>    default:<br>       docker-compose.yml</pre><p>and docker-compose.yaml:</p><pre>version: &#39;2.0&#39;<br>services:<br>  helloworld:<br>    image: &#39;ubuntu:14.04&#39;<br>    command: &quot;/bin/echo &#39;Hello world&#39;&quot;</pre><p>Now you can start your project:</p><pre>poco up</pre><p>If everything is ok, you should see:</p><pre>helloworld uses an image, skipping<br>Pulling helloworld ... done<br>services:<br>  helloworld:<br>    command: /bin/echo &#39;Hello world&#39;<br>    image: ubuntu:14.04<br>version: &#39;2.0&#39;</pre><pre>Creating network &quot;hello-world_default&quot; with the default driver<br>Creating hello-world_helloworld_1 ... done<br>          Name                     Command          State    Ports<br>------------------------------------------------------------------<br>hello-world_helloworld_1   /bin/echo Hello world   Exit 0</pre><p>Push your changes:</p><pre>git remote add origin <a href="https://github.com/user/repo.git">https://github.com/<em>user</em>/<em>repo</em>.git</a><br>git add .<br>git commit...<br>git push</pre><p>Don’t forget to replace <em>user </em>with your user name and <em>repo </em>with your repository name.</p><p>Now we can create catalog (registry) and add our project into it. Let’s create new git repository:</p><pre>mkdir poco-catalog<br>cd poco-catalog<br>git init</pre><p>Add poco-catalog.yml file to the root folder:</p><pre>hello-world:<br>  file: poco.yaml<br>  git: <a href="https://github.com/user/repo.git">https://github.com/<em>user</em>/<em>repo</em>.git</a><br>  repository_dir: hello-world</pre><p>Push changes:</p><pre>git remote add origin <a href="https://github.com/user/repo.git">https://github.com/<em>user</em>/<em>repo</em>.git</a><br>git add .<br>git commit...<br>git push</pre><p>And now we can add our catalog to our local poco:</p><pre>poco repo add my-catalog <a href="https://github.com/user/repo.git">https://github.com/<em>user</em>/<em>repo</em>.git</a></pre><p>Where <em>repo</em> is name of our poco-catalog repository. If everything is ok, you should see something like this:</p><pre>Catalog configuration initialized: /Users/user/.poco/config</pre><pre>Actual config<br>-------------</pre><pre>Project name: None<br>Working directory: /Users/user/workspace<br>Mode: None<br>Offline: False<br>Always update: False<br>Config location: /Users/user/.poco/config<br>Config:<br>-------<br>my-catalog:<br>    repositoryType: git<br>    server: <a href="/service/mailto:git@github.com">git@github.com</a>:<em>user</em>/<em>repo</em>.git</pre><p>To show all available projects run:</p><pre>poco catalog</pre><p>And all available projects will be printed into console:</p><pre>-------------------<br>Available projects:<br>-------------------<br>hello-world ()</pre><p>Finally when everything is ready we can start our project by running:</p><pre>poco up hello-world</pre><p>It will clone this project to /Users/user/workspace folder and start it.</p><h4>Try existing example</h4><p>Additionally you can try poco-catalog-example. Just add it to your local poco repo:</p><pre>poco repo add my-catalog git@github.com:shiwaforce/poco-catalog-example.git</pre><p>And run hello-world project:</p><pre>poco up hello-world</pre><h3>Summary</h3><p>Poco is a very simple but powerful tool. It can provide common interface for all the projects so developers will intuitively know how to get started with their next existing projects.</p><p>Despite the simplicity of example I’ve showed in this article, Poco is able to handle more complex, furthermore, it was developed to handle very complex projects.</p><p>Possibilities of Poco are only limited by your imagination.</p><p><em>Article with a closer look on more complex projects is coming soon.<br>Find out more:<br></em><a href="https://getpoco.io/"><em>https://getpoco.io</em></a><em><br></em><a href="https://github.com/shiwaforce/poco"><em>https://github.com/shiwaforce/poco</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2a834db965d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Developing Side Project And Not Going Crazy. Intro.]]></title>
            <link>https://eduarddotgg.medium.com/developing-side-project-and-not-going-crazy-intro-6bd7e1178270?source=rss-2128947d2813------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bd7e1178270</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[side-project]]></category>
            <dc:creator><![CDATA[Eduard Pochtar]]></dc:creator>
            <pubDate>Thu, 04 Jan 2018 17:29:04 GMT</pubDate>
            <atom:updated>2018-01-04T17:31:19.697Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*BhxRaSMDIVXKHZknauQ46g.png" /></figure><p>It’s been a while since I have started my little, or not so, journey of deeper learning web technologies, javascript especially. At that point I was already familiar with the basics and a little bit beyond, so I wanted to learn on some bigger and more ambitious project. That was on of the reasons I have started <a href="https://asterisk.news/">https://asterisk.news</a> project.</p><p>Asterisk.News is under development a lot of new features are yet to come, but I already have what to share. I would like to share my journey with you so I will start a series of posts about it. I will write about all the good and the bad things I have faced, what I have learned and what I still have to learn, what problems I have faced and have did I solved them.</p><p>I hope you will find it exciting and interesting. See you later!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bd7e1178270" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How PostCSS Made Me To Create My Own Components]]></title>
            <link>https://medium.com/front-end-weekly/how-postcss-made-me-to-create-my-own-components-ecf29abaff0e?source=rss-2128947d2813------2</link>
            <guid isPermaLink="false">https://medium.com/p/ecf29abaff0e</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[postcss]]></category>
            <category><![CDATA[components]]></category>
            <dc:creator><![CDATA[Eduard Pochtar]]></dc:creator>
            <pubDate>Fri, 19 Aug 2016 12:26:53 GMT</pubDate>
            <atom:updated>2016-08-25T17:22:27.654Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gHyqH19hOVmPAxdvqp2ikg.png" /></figure><h3>Prelude.</h3><p>Let me introduce myself, my name is Eduard Pochtar [ɛduʌrd pɒtʃtʌr], I’m front-end developer from Budapest. I’m at the very beginning of my developer journey but I already have something to share. I would like to share my version of component driven development.</p><p>P.S. Don’t judge me too harshly, I’m open minded and I’m opened to any feedback or help.</p><h3>Beginning.</h3><p>It was my 18th birthday, I’ve got Canon 400d as a present. I had no idea how to use it and what is good photography. But my desire to be a photographer was so strong that I have learned how to use camera and how to take good photos very quickly. I was taking photos of everything, trying to find my personal style in photography.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*dBTgJfZi8PVNEpp1U74wsQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*7wV9AVLijAqCyYUGrEqfMg.jpeg" /></figure><p>At some point i’ve understood that I need some place where I can share my work. I didn’t have money for personal website, so I decided to find some free service. I was satisfied with it. But not for a long time. Very quickly I decided to create my own website. As I didn’t have money, I had to develop it by myself. Developing a website seemed something unreal. I didn’t how to start what to learn. I have heard about flash at that time. Technology itself was really great, and I thought it was really easy to learn it. How I was wrong. Any way I decided to learn flash. After some time of learning flash and trying to understand how to develop website with flash my website was ready.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6-PnHiqWeJkZBTIqSzgULg.png" /></figure><p>Step be step I was developing and improving my personal website. It got another version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*83uX0yS-i_M4dZ-UZdnJew.png" /></figure><p>Very soon I’ve got some good offers for some other flash projects. After some projects I understood that creating websites is what I like. It was not a question any more, I decided to be front-end developer.<br>After some flash projects I understood that I need to move forwards and to learn HTML and CSS. At first I thought it would be very hard, but it was surprisingly easy.</p><p>I didn’t understand yet, but my journey as front-end developer has began. I’ve got some freelance projects very quickly.</p><h3>First pre-processor</h3><p>Learning web technologies I was completely by myself. I didn’t have anyone who could show me on my mistakes and teach me best practices, so I had to do it by myself. And it was really hard. It is hard to understand what is good and what is bad when you don’t have someone who can explain. Any way I understood that if want to get better as a front-end developer I always need to research how can I get better as a front-end developer, how my projects can get better. So I kept looking for new technologies, better practices, and other knowledge that can make me better as a developer, and I still do. <br>At that time I didn’t use any pre-processor and all my projects had one css file for all pages.</p><p>At some point I have discovered CSS pre-processors. I was really impressed! Comparing to vanilla CSS pre-processors have much more advantages like variables, mixins, nesting and much more. I don’t remember why I have chosen SASS, but it seemed better than LESS. With SASS I had to rethink my project’s code and file structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o2gibk8QJfsAXh3w6DPYSw.png" /></figure><p>With CSS pre-processors I could better organise my CSS code, split to separate files and much more.</p><h3>Automatisation. Build.</h3><p>When you grow as a developer step by step you understand that you need to develop your workflow as well. That’s why very often developers start to use tools which they can setup for their need. For example at the very beginning you may use tools like CodeKit or something like that, but as soon as you understand importance of manual configuration, which can give better results, you start to use tools like node.js, grunt.js, gulp.js, webpack, jspm, etc. I was using CodeKit for my projects as a server and builder, but I understood that I need something that will give me more control over my code and optimisation. I switched to node.js and gulp.js.</p><h3>Alternatives.</h3><p>I understood that SASS is not the best tool, so I was always searching for some alternatives. It was really hard to find some.</p><p>But about a year ago I have discovered PostCSS:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F73dl5dk9z4Q%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D73dl5dk9z4Q&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F73dl5dk9z4Q%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/45c5455c47a04b5d7f48b68c24e6b356/href">https://medium.com/media/45c5455c47a04b5d7f48b68c24e6b356/href</a></iframe><p>I was impressed once again. PostCSS was something weird and great at the same time. <br>One of the most exciting about PostCSS was that it transforms CSS with JavaScript Plugins. Another exciting PostCSS feature was ability to use css variables from external js file. This gave me new better way to organise my projects.<br>But before that I didn’t know how it would be better to integrate PostCSS into my projects. The simplest way was to use it with gulp, but I didn’t like that idea. So I decided to find a better way for me.</p><h3>Development Environment.</h3><p>It was little bit challenging. I have heard about Harp.js, in spite of some of it’s disadvantages it could be good starting point, but it didn’t support PostCSS. I have opened issue ticket on github <a href="https://github.com/sintaxi/harp/issues/451">https://github.com/sintaxi/harp/issues/451</a>, but unfortunately harp maintainers have another vision. <br>Searchings for other alternatives were without success until I have spoken with Andrey Sitnik (PostCSS founder). He advised me to try webpack.</p><h3>OMG, Webpack.</h3><p>Webpack was another weird tool. At first it was really hard to understand how it works and how to set it up. It had not the best documentation and I didn’t understand how to set up webpack for a long time. But using PostCSS in my projects was very important for me so I kept trying to setup webpack. I have found some articles about webpack, some examples and some boilerplates. After few days I finally had some environment where I can use PostCSS.</p><h3>Inspiration.</h3><p>While trying to make webpack to work I have noticed that mostly in every webpack boilerplate was something that was called react.js. React.js seemed very attractive. First thing I liked about it was it’s way of component driven development. Component with all it’s css and js dependencies were at one place:</p><pre>hello-world<br> |- hello-world.pug<br> |- hello-world.js<br> |- hello-world.css</pre><p>This kind of development had big impact on my consciousness. But the problem was that webpack bundles html, js and css into one big js file and react has html and css in js. I don’t want to say that it’s bad or good, I would rather say that it has it’s advantages and disadvantages. As for me I don’t like that everything is in js and than bundled into one file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m7M_4qzEuwzq4Z-GEMOTOg.png" /></figure><p>Bundling everything to one file is great for SPA (single page application) like instagram or some dashboard.</p><p>PostCSS, Webpack and React had big impact on me. But I wasn’t satisfied with this kind of development environment and html, css bundled into js. So I started to search for another way, but this time I wanted to keep this new for me and great component drive development. Unfortunately I didn’t find anything that could satisfy my needs.</p><p>PostCSS made me to search for better tools, inspired me to better organise my CSS, make it more simple. Webpack and React.js gave me new vision of component driven development. All together it inspired me to create my own tool.</p><h3>ADM-DEV-KIT 1.0.0</h3><p>Main goal was to develop a tool that will have the same or similar approach to component driven development but bundle html, js and css separately.<br>One of the first biggest challenge was to find a way how to import all component’s dependencies in component itself like for example webpack can do:</p><pre>const pug = require(“./hello-world.pug”);<br>const js = require(“./hello-world.js”);<br>const css = require(“./hello-world.css”);</pre><p>After some researches I have understood that it can be done like this:</p><pre>link(href=”hello-world.css” type=”text/css” rel=”stylesheet”)<br>.hello-world<br> h1 Hello, World!<br>script(src=”hello-world.js” type=”text/javascript”)</pre><p>Next challenge was to find a way to extract all those css and js files from html and than remove unnecessary html tags. Fortunately I have found gulp plugin that could help me with that. I decided that there will be some main pages/sections (index page, about page, etc.) which will include all their components, and based on those main pages/sections js and css will be extracted, concatenated to the file related to page/section and then minified. So every main page/section will have it’s separate js and css in production.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gxzs3NmEkoMisGehMxXExw.png" /></figure><p>Usually to use variables, they should be imported somewhere to be inherited by all css files. But from now on all my css files were separated from each other, they couldn’t inherit variables from each other but I still wanted to use them. To solve this problem, instead of using PostCSS existing plugins, I decided to create PostCSS Plugin — <a href="https://github.com/admdh/postcss-inject">PostCSS Inject</a>, that can inject any css file into another css file. I’m using it for injecting variables only.</p><p>Gulp was used for development and building project for production.<br>Thanks to ADM-DEV-KIT 1.0.0 I had true components, components that are independent from each other. There was no need to keep pug, js and css separately from each other.</p><h3>ADM-DEV-KIT 2.0.0</h3><p>But the problem with first version was that it was really slow. As page got more css and js, gulp task was getting slower and slower, because it had to extract more and compile more. It might be not a problem for bundling but it is a problem while developing. It was ruining experience of using ADM-DEV-KIT. It had to be changed.</p><p>To solve performance issue I decided to try express.js. So now I had express for development and gulp for building for production.</p><p>But the problem was that there were a lot of link and script tags inside the body tag. As it turned out it is not a problem while developing. Yes, it seems a little bit strange at first but not so strange like html or css in js. Of course they are removed for production.</p><p>To compile CSS there is PostCSS Middleware for express, so there were no problems with CSS. But there were some issues with JS. First of all I had to find a better way use third party libraries like angular, jquery or any other. To solve this problem I decided to use JSPM. It solves this problem very well, it also gives ability to use ES6 and some other advantages. Import of js file with JSPM looks like this:</p><pre>link(href=”hello-world.css” type=”text/css” rel=”stylesheet”)<br>.hello-world<br> h1 Hello, World!<br>script. System.import(‘hello-world.js’)</pre><p>It worked while developing but for production it didn’t work because gulp couldn’t extract js from jspm’s “System.import”. To solve this issue I developed PostHTML plugin — <a href="https://github.com/admdh/posthtml-jspm-config-generator">PostHTML JSPM Config Generator</a>, that will create separate jspm file for each main page/section that will import all it’s js dependencies:</p><pre>‘use strict’<br>import ‘hello-world/hello-world.js’</pre><p>ADM-DEV-KIT 2.0.0 comparing to 1.0.0 has speed improvements and JSPM for bundling JavaScript and some other features.</p><h3>ADM-DEV-KIT 2.5.0</h3><p>ADM-DEV-KIT is much faster and better, but the problem was while starting new project I had to copy all server and gulp files over and over again. And I thought there should be a better way to do that. So I decided to create npm package. The only problem was that as ADM-DEV-KIT turned into npm package it was a little bit harder to setup development environment, so I created <a href="https://github.com/admdh/adm-dev-kit-init-project">ADM DEV KIT INIT PROJECT</a>. ADM DEV KIT INIT PROJECT is kind of command line tool focused to help init ADM DEV KIT project:</p><p><a href="https://raw.githubusercontent.com/admdh/adm-dev-kit-init-project/master/images/adm-dev-kit-auto-project-init.gif">https://raw.githubusercontent.com/admdh/adm-dev-kit-init-project/master/images/adm-dev-kit-auto-project-init.gif</a></p><p>It should be installed globally:</p><pre>npm i -g adm-dev-kit-init-project</pre><p>And then all you have to do is to run:</p><pre>adm // init project</pre><pre>npm i // install dependencies</pre><pre>npm start // to run server<br>gulp // to build for production</pre><h3>Links</h3><p><a href="https://github.com/iamfrntdv/adm-dev-kit">ADM-DEV-KIT</a></p><h3>The End.</h3><p>Searching for something better is very important especially if you want to be better no matter what you do. There is always something better. ADM-DEV-KIT doesn’t claim to be better than Webpack or similar tools, I just tried to solve those problems I have faced. ADM-DEV-KIT is my step in search of something better.</p><p>PostCSS, Webpack and React inspired me to create ADM-DEV-KIT.<br>Thanks to PostCSS I’ve got this unforgettable journey.<br>I hope ADM-DEV-KIT will get better and better.</p><h3>P.S.</h3><p>Article about how to setup and how to use ADM-DEV-KIT is coming up.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ecf29abaff0e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/front-end-weekly/how-postcss-made-me-to-create-my-own-components-ecf29abaff0e">How PostCSS Made Me To Create My Own Components</a> was originally published in <a href="https://medium.com/front-end-weekly">Frontend Weekly</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>