<?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 Donald Pipowitch on Medium]]></title>
        <description><![CDATA[Stories by Donald Pipowitch on Medium]]></description>
        <link>https://medium.com/@pipopeperoni?source=rss-7c83dc3857c0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*-IJ-qzlgM8HWggfs.jpg</url>
            <title>Stories by Donald Pipowitch on Medium</title>
            <link>https://medium.com/@pipopeperoni?source=rss-7c83dc3857c0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 10:25:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pipopeperoni/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[The Maybe Future of Frontend Tooling]]></title>
            <link>https://medium.com/@pipopeperoni/the-maybe-future-of-frontend-tooling-80e6d96f8125?source=rss-7c83dc3857c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/80e6d96f8125</guid>
            <category><![CDATA[tooling]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[webpack]]></category>
            <category><![CDATA[web]]></category>
            <dc:creator><![CDATA[Donald Pipowitch]]></dc:creator>
            <pubDate>Fri, 14 Apr 2017 19:21:48 GMT</pubDate>
            <atom:updated>2017-04-14T19:32:22.357Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Disclaimer: I wrote this quite hastily in a little bit of spare time between the holidays. I hope you get the gist out of it. If not I’ll try to illustrate my idea with a more practical example in the future. Thank you! 👋</blockquote><p>One thing which can be said for sure about JavaScript is that it has a rapidly evolving ecosystem and a diverse community. A big part of the JavaScript universe is dedicated to tooling. In the last year this topic got a little bit of bad publicity being <em>too</em> overwhelming. Remind yourself that you don’t need to keep track of every change and every new idea. Learn when you have time to learn and use what is useful for you, not for others. ✌️ I personally like this ecosystem a lot, because the people behind it are so creative — even if not every idea is worthwhile in practice. With this article I’d like to put my own vision of the future of JavaScript tooling into the ocean of ideas about frontend tooling.</p><h3>Some History</h3><p>First things first some background about me: I started following JavaScript and Frontend tooling since the introduction of Grunt. Grunt helped me a lot to learn Node and the terminal and it helped me taking my frontend project to the next level. It was not without failures so I kept track of every popular solution which came after that: Gulp, “npm scripts”, Broccoli and so on. We used a CSS preprocessor quite early and also adopted Babel when it was “quite” new. Currently we are happy users of TypeScript and Webpack. At our company we use <a href="https://github.com/Mercateo/ws">a wrapper around all these tools</a> so we can change the frameworks in the background without changing a lot of our interface to use them. Most changes aren’t noticed by our users. Ignoring <em>building</em> our projects for a moment the other parts of our tooling story focused around linters, tests and managing documentation and the project in general (changelogs, deploying, …).</p><p>The biggest impact in the JavaScript tooling world in the last years probably was the introduction of Babel. (For very good reasons!) Being a little bit “controversial” (because of its complexity at first glance) I really like Webpack and its loaders concept, because it allows me to solve problems I couldn’t solve before. But there is one thing which is lesser known which I think will have the biggest impact around tooling in general in the long run: the <a href="https://github.com/Microsoft/language-server-protocol">language server protocol</a>. This protocol was developed by MicroSoft for TypeScript. It powers several features you know and love from advanced IDEs like refactoring, code completion and so on, but in an abstract way so that it can be easily adopted by other languages and so that it can be easily integrated in many different editors.</p><h3>The Maybe Future</h3><h4>Linters</h4><p>MicroSoft developed several language services implementing the language server protocol for VS Code (e.g. for <a href="https://github.com/Microsoft/vscode-html-languageservice">HTML</a> and <a href="https://github.com/Microsoft/vscode-css-languageservice">CSS</a>) and others do the same (e.g. for <a href="https://github.com/rust-lang-nursery/rls">Rust</a> and <a href="https://github.com/eclipse/eclipse.jdt.ls">Java</a>). Interestingly it seems that even support for linters in VS Code is implemented <a href="https://github.com/Microsoft/vscode-tslint/tree/master/tslint-server">as a language service</a>. IMHO this is an interesting idea! Think about that: You’re a library author which wants to move to a new major version and you want to deprecate a function. Currently a library author usually puts a console.warn into this function and if someone <em>uses</em> this function the developer sees this warning in the console. But you know this can be easily overlooked when this happens at runtime. That’s why we want to analyse our code statically and use linters or something like flow or TypeScript in the first place. However currently we would need to install a different dependency for that and configure it manually (like <a href="https://github.com/palantir/tslint-react">tslint-react</a> which is not maintained by the React developers themselves).</p><p>Imagine that: TypeScript can easily pick up typings published either by the original library authors when they reference declarations inside the package.json in the typings field or by <a href="https://github.com/DefinitelyTyped/DefinitelyTyped">community maintained packages</a> or in several other (more manual) ways. Wouldn’t it be nice if library authors could add custom linter rules and reference them in the package.json so they are automatically picked up by our linter language service? In the same way the TypeScript compiler picks up type declarations?<br>Or think about that: Most linter have auto-fix features nowadays. Wouldn’t it be nice if we could auto-fix our deprecation warning? E.g. because our function is renamed from foo to bar or because our import { foo } from ‘some-lib/foo’ is now published as a standalone package like import { foo } from ‘some-lib-foo’? This wouldn’t be possible with just a console.warn. This is similar to a <a href="https://github.com/facebook/codemod">codemod</a>, but IMHO more friendlier to use. Besides deprecation warnings we could use a framework specific language service for helping the user follow best practices (warn if they use the API in a “wrong” way) or custom knowledge which can’t be covered by a generic language service.</p><p>Look for example into the source code of <a href="https://github.com/Microsoft/vscode-html-languageservice">vscode-html-languageservice</a>. It contains <a href="https://github.com/Microsoft/vscode-html-languageservice/blob/e477a37194532bee648eaeff8cda9fa186fc91bd/src/parser/htmlTags.ts#L496">hard coded knowledge about Angular directives</a>. It would be nicer if this would be a standalone language service. There even <em>is</em> a <a href="https://github.com/angular/vscode-ng-language-service">standalone language service for Angular</a> developed by the Angular team. But you need to install it separately. Again… it would be nicer if this could be just picked up by a more generic language service just because you have Angular as a dependency and imported it in your project.</p><h4>Compiler Plugins and Macros</h4><p>Custom linter rules and IDE features like refactoring for specific libraries aside there is another “thing” which is currently maintained decoupled from the libraries themselves. These “things” I have in mind are compiler plugins like Babel plugins. The most popular probably is the <a href="https://www.npmjs.com/package/babel-plugin-transform-react-jsx">JSX syntax for React</a>. But many libs have Babel plugins to improve themselves. Two examples: there is a <a href="https://github.com/threepointone/glamor">glamor</a> specific Babel plugin to hoist styles for performance improvements and there is a Babel plugin for <a href="https://github.com/styled-components/babel-plugin-styled-components">styled-components</a> to add server side rendering and better debugging experiences. Wouldn’t it be nice if these could be just published with its original libraries? It would be nice if that could also be just referenced in your package.json so it can be easily picked up, if you import glamor or styled-components. We probably need to solve some more challenges to get so far. E.g. we don’t want conflicts between plugins. A solution to that can be <a href="http://sweetjs.org/">sweet.js macros</a> which can be imported locally and also allow the extension of our JavaScript syntax. It is possible to <a href="https://github.com/jlongster/jsx-reader">write JSX as a macro</a> for example.</p><p>Two more problems come to my mind. First: I want <a href="https://github.com/prettier/prettier">prettier</a> everywhere. If I write my own syntax extension like JSX I want to be responsible for pretty printing my syntax, too. prettier currently supports JSX and flow and soon TypeScript which is great, but it would be even nicer, if it can be extended. Second: I want static typing everywhere. Depending on your syntax extension this can be quite hard. TypeScript supports JSX, but again this is backed in support in TypeScript and only possible, because JSX is so popular. It wouldn’t be so easy to add TypeScript support to <em>your</em> syntax extension.</p><h4>Loaders</h4><p>Writing this another piece of my build pipeline comes to my mind which I’d like to support with static typing natively: <a href="https://webpack.js.org/concepts/loaders/">WebPack loaders</a>. If I use the url-loader for loading images I currently need to add this declaration somewhere, so TypeScript knows about the return type.</p><pre>declare module ‘*.jpg’ {<br>  const content: string;<br>  export default content;<br>}</pre><p>However this becomes troublesome when you have dynamic return values or interfaces. For example we use translations formatted in <a href="https://github.com/yahoo/intl-messageformat">message format</a> saved in .properties files like this:</p><pre>hello.world=Say hello to &quot;{label}&quot;!</pre><p>Currently we precompile these files to JavaScript and to TypeScript declarations which look like this:</p><pre>/**<br> * `en_US`: Say hello to &quot;{label}&quot;!<br> * `de_DE`: Sag hallo zu &quot;{label}&quot;!<br> */<br>export function helloWorld(data: { label: string }): string;</pre><p>This is awesome. We can now just import helloWorld from our precompiled file and have code completion, proper type checking and we even see the translations if we hover over helloWorld in VS Code. But… we have to create intermediate files to solve this. We cannot just write a loader for WebPack and load our translations directly.</p><p>It would be nice if our loaders could speak to the TypeScript compiler directly.</p><h3>Conclusion</h3><p>I think language server will help us bring more IDE features to editors around us. I could imagine embedding language servers into our browser dev tools or in web editors like JSFiddle. You can even get some IntelliSense into GitHub today with the help of <a href="https://github.com/pd4d10/intelli-octo">a Chrome extension</a>!</p><p>In the beginning I said that WebPack is a little bit inconvenient for beginners, because of its complexity in the configuration step. That’s way frameworks like <a href="https://github.com/zeit/next.js/">next.js</a> are so popular. They avoid a lot of the configuration by using the file system as the API. When we can do the same for linters, compiler plugins, macros and language servers we will help library authors and consumers to get the best out of our web technologies.</p><p>I hope we can bring the different worlds of loaders, type systems, syntax extensions and pretty printers more closely to each others by finding the right low level APIs in the future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80e6d96f8125" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bringing CSS to the Next Level]]></title>
            <link>https://medium.com/@pipopeperoni/bringing-css-to-the-next-level-9ef887202ce4?source=rss-7c83dc3857c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ef887202ce4</guid>
            <dc:creator><![CDATA[Donald Pipowitch]]></dc:creator>
            <pubDate>Tue, 22 Apr 2014 16:48:28 GMT</pubDate>
            <atom:updated>2014-05-06T07:43:55.190Z</atom:updated>
            <content:encoded><![CDATA[<h4>Should we control markup and logic with CSS…? Provoking article incoming!</h4><p>Recently I read an interesting article by <a href="http://acko.net/">acko.net</a> about HTML and CSS and <a href="http://acko.net/blog/shadow-dom/">why he thinks that the DOM is broken</a>. Besides an interesting alternative to the current usage of the <em>&lt;math&gt;</em> element he made this very interesting statement:</p><blockquote>[W]hy should a table have a font size? Only the <em>text </em>inside the table can have a font size, the table is just a box with layout that contains other <em>boxes. </em>Why don’t we write <em>table text { size: 16px; }</em> instead of <em>table { font-size: 16px; }</em>? Text nodes exist today.</blockquote><blockquote>Well because that’s how HTML’s <em>&lt;font&gt;</em> tag worked. Instead of just making a selector for text nodes, they gave all the other elements font properties. They didn’t <em>get rid </em>of font tags, they made them invisible and put one inside each DOM node.</blockquote><p>And he uses this example to illustrate his statement:</p><pre>&lt;html&gt;&lt;font&gt;<br>  &lt;body&gt;&lt;font&gt;<br>    &lt;h1&gt;&lt;font&gt;Hello World&lt;/font&gt;&lt;/h1&gt;<br>    &lt;p&gt;&lt;font&gt;Welcome to the future.&lt;/font&gt;&lt;/p&gt;<br>  &lt;/font&gt;&lt;/body&gt;<br>&lt;/font&gt;&lt;/html&gt;</pre><p>Let this sink for a while… I don’t know if this is perfectly correct from a technical point of view, but it <em>sounds </em>very logical and helps to understand how CSS works. But what does that mean? Well, it means that CSS alters the DOM behind the scenes. At least it <em>adds </em>new content to the existing DOM. That shouldn’t sound very new as we do this on a daily basis with <em>:before</em> and <em>:after</em>, but you wouldn’t expect it here.</p><p>I searched for another example and stopped at the CSS properties <em>counter-reset</em> and <em>counter-numbering</em>:</p><pre>body {<br>  counter-reset: chapter; /* Create a chapter counter scope */<br>}</pre><pre>h1:before {<br> content: “Chapter “ counter(chapter) “. “;<br> counter-increment: chapter; /* Add 1 to chapter */<br>}</pre><pre>h1 {<br> counter-reset: section; /* Set section to 0 */<br>}</pre><pre>h2:before {<br> content: counter(chapter) “.” counter(section) “ “;<br> counter-increment: section;<br>}</pre><p>(<a href="http://www.w3.org/TR/CSS21/generate.html#counters">Source</a>)</p><p>What happens here? We aren’t only altering the DOM, we are also using some obscure logic via CSS. This is what happens behind the scenes:</p><pre>                    &lt;!-- ”chapter” counter|”section” counter --&gt;<br>&lt;body&gt;              &lt;!-- {chapter=0       |                  --&gt;<br> &lt;h1&gt;About CSS&lt;/h1&gt; &lt;!-- chapter++ (=1)   | {section=0       --&gt;<br> &lt;h2&gt;CSS 2&lt;/h2&gt;     &lt;!--                  | section++ (=1)   --&gt;<br> &lt;h2&gt;CSS 2.1&lt;/h2&gt;   &lt;!--                  | section++ (=2)   --&gt;<br> &lt;h1&gt;Style&lt;/h1&gt;     &lt;!-- chapter++ (=2)   |}{ section=0      --&gt;<br>&lt;/body&gt;             &lt;!--                  | }                --&gt;</pre><p>(<a href="http://www.w3.org/TR/CSS21/generate.html#counters">Source</a>)</p><p>If we control some markup and logic with CSS, that means we are using HTML and JavaScript through CSS, right? <em>Nearly.<br></em>Think about this: If <em>table { font-size: 16px; }</em> puts a hidden <em>&lt;font&gt;</em> element inside every <em>&lt;table&gt;</em> element, maybe <em>counter-increment</em> appends a hidden jQuery plugin called <em>counter</em> to your <em>&lt;body&gt;</em> element! (But please don’t take this literally.)<br>It could look like this:</p><pre>&lt;body&gt;<br> &lt;script&gt;<br>  // counter prepends some template before h1 and h2<br>  jQuery(‘h1&#39;).counter({<br>    content: &#39;Chapter {{ counter(chapter) }}. &#39;,<br>    increment: ‘chapter’,<br>    reset: ‘body’<br>  });</pre><pre>  jQuery(‘h2&#39;).counter({<br>    content: &#39;{{ counter(chapter) }}.{{ counter(section) }} &#39;,<br>    increment: ‘section’,<br>    reset: ‘h1&#39;<br>  });<br> &lt;/script&gt;<br>&lt;/body&gt;</pre><p>Some questions arise:</p><ol><li>Why is this even allowed? Isn’t CSS just for styles?</li><li>Why am I allowed to inspect <em>:after</em>/<em>:before</em> elements (or Shadow DOM), but not the logic behind this?</li><li>Any why can’t I use this API for my own jQuery plugins?!</li></ol><p>Haven’t we all written jQuery plugins using some passed configuration objects before? Why can’t we use CSS for configuration like CSS counters?<br>I don’t say that this is good or bad, but we as web developers should be allowed to do the same as browser vendors. You can decide yourself, if this is good or not. (Probably not.) But I definitely say, that I would <em>at least want to try that out</em> for myself! At least we are the web developers who want to <a href="http://movethewebforward.org/">move the web forward</a>. Who want an <a href="http://extensiblewebmanifesto.org/">extensible web</a> with Web Components all over the place!<br>Even if you would never use such code in production, it would be very useful for web developers to test future specs and create <em>polyfills</em> for these.</p><p>Lets forget that CSS is for styles for a moment. Lets <strong>treat CSS as a YAML-like configuration file with knowledge about the DOM</strong> and selectors. Would that even be used by anyone? Sure!<br>Not just browser vendors use this, but <a href="https://atom.io/docs/v0.90.0/advanced/keymaps">look into GitHubs Atom editor and how the configure keymaps</a>. They use“<a href="https://github.com/atom/atom-keymap/blob/master/README.md">DOM-aware</a>” “CSON or JSON files”. That would certainly work with CSS syntax which are DOM-aware by default. Why did they have to use CSON for this? Because we don’t have the APIs to read and write custom CSS properties (<em>yet</em>)!</p><p>Maybe this wasn’t the best example, so let us move forward and switch from jQuery examples to Angular examples. This is a timepicker from <a href="http://mgcrea.github.io/angular-strap/">AngularStrap</a>:</p><pre>&lt;input type=”text”<br>       ng-model=”selectedTimeAsNumber”<br>       data-time-format=”HH:mm”<br>       bs-timepicker&gt;</pre><p>Why can’t we remove the <em>data-time-format</em> attribute from the <em>&lt;input&gt;</em> element and put it into our CSS?</p><pre>input[bs-timepicker] {<br> data-time-format: ‘HH:mm’;<br>}</pre><p>We could configure <em>all </em>our timepickers in this way with a single line of code instead of using an attribute on <em>every</em> single timepicker element. (Maybe our timepicker directive lets us set default values, but what if not? Or if we would like to use a more complicated selector like <em>.special-page input[bs-timepicker]</em>?)</p><p>Another example: This time we don’t use a timepicker, but a simple <em>&lt;current-date&gt;</em> directive which does nothing but display current date. Than we could do this:</p><pre>custom-time {<br> /* 9/3/10 */<br> data-time-format: ‘M/d/yy’; <br>}</pre><pre>@media (min-width: 480px) {<br> custom-time {<br>   /* Friday, September 3, 2010 */<br>   data-time-format: ‘EEEE, MMMM d,y’;<br> }<br>}</pre><p><em>Boom!</em> We get <strong>responsive configuration</strong> for directives <strong>for free</strong> just by utilizing the conventions which already exist. Isn’t that great? And it shouldn’t look to unfamiliar to place configuration like this into the CSS. What’s the difference in using</p><pre>custom-time {<br> data-time-format: ‘M/d/yy’;<br>}</pre><p>or</p><pre>ol {<br> list-style-type: decimal;<br>}</pre><p>? We just set some formatting option…</p><p>And if we would write<em> &lt;current-date data-time-format=”MMM d, y”&gt;</em> somewhere in our markup, it would override the settings inside the CSS just like inline declared styles would.</p><p>I said <em>“Lets forget that CSS is for styles for a moment.”</em> before. We could basically do that already. Ever heard of the CSS property <em>pointer-events</em>? It has <em>almost </em>nothing to do with styles. It basically converts something like</p><pre>/* CSS */<br>p {<br> pointer-events: none; <br>}</pre><p>to something like</p><pre>// JavaScript, pseudo code<br>jQuery(‘p’).on(‘click touch mousemove’, function(e) {<br> e.preventDefault();<br>}); </pre><p>So, what do you think? Does this look useful? Maybe not attractive at the first glance, but definitely useful.</p><p>So please browser vendors:</p><ul><li>Let me use <strong>custom CSS properties</strong>.</li><li>Let me <strong>inspect the <em>logic</em></strong><em> </em>behind custom and builtin CSS properties.</li></ul><p>And dear frameworks like Angular, jQuery or Polymer:</p><ul><li>Let me <strong>configure</strong> your <strong>directives, plugins or Web Components via CSS</strong> properties.</li></ul><p>And now I await angry comments for these blasphemous thoughts…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ef887202ce4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>