<?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[Vincent Ogloblinsky - Medium]]></title>
        <description><![CDATA[Articles about the “big” world of web frontend technologies. - Medium]]></description>
        <link>https://medium.com/vincent-ogloblinsky?source=rss----534b9068f7e---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Vincent Ogloblinsky - Medium</title>
            <link>https://medium.com/vincent-ogloblinsky?source=rss----534b9068f7e---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 21:21:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/vincent-ogloblinsky" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Cross Browser Testing your Stencil Web Component like a boss]]></title>
            <link>https://medium.com/vincent-ogloblinsky/cross-browser-testing-your-stencil-web-component-like-a-boss-93c1b154bfd9?source=rss----534b9068f7e---4</link>
            <guid isPermaLink="false">https://medium.com/p/93c1b154bfd9</guid>
            <category><![CDATA[web-components]]></category>
            <category><![CDATA[karma]]></category>
            <category><![CDATA[stencil]]></category>
            <category><![CDATA[stenciljs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Vincent Ogloblinsky]]></dc:creator>
            <pubDate>Fri, 15 Feb 2019 15:31:01 GMT</pubDate>
            <atom:updated>2019-02-15T15:31:01.253Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*67fHwt9WyjJTRy5c" /><figcaption>Photo by <a href="https://unsplash.com/@christianfregnan?utm_source=medium&amp;utm_medium=referral">Christian Fregnan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><a href="https://stenciljs.com/">Stencil</a> is a really great piece of software. For those who are not familiar with it, it is a “ Compiler for Web Components ”.</p><p>Stencil comes by default with tools for testing your Web Component : <a href="https://jestjs.io/">Jest</a> for the testing framework, and <a href="https://pptr.dev/">Puppeteer</a> for “ End-to-end ”(e2e) tests.</p><p><a href="https://pptr.dev/">Puppeteer</a> is a robust solution for driving a Chrome Headless instance, but it only works with Chrome.</p><p>If you want to support or test your Web Component in more browsers, you have two strategies :</p><ul><li>using a solution that drives a browser using <a href="https://www.w3.org/TR/webdriver/">W3C WebDriver API</a> : <a href="https://webdriver.io/">WebdriverIO</a>, <a href="http://nightwatchjs.org/">Nightwatch.js</a> are two great solutions. The main drawback is that querying Shadow DOM is a bit tricky with these solutions, due to <a href="https://github.com/SeleniumHQ/selenium/issues/5869">bad support of Shadow DOM</a> in WebDriver APIs.</li><li>using a solution that runs your test inside a browser : <a href="https://github.com/Polymer/tools/tree/master/packages/web-component-tester">Web Component Tester</a> from the Polymer team or <a href="https://open-wc.org/testing/">@open-wc/testing</a> are two great solutions.</li></ul><p>I have tested the first strategy with no success for “all browsers” supporting Web Components (with some polyfills). IE11 was the bad guy in the story…</p><p>This is the second approach I will explain in details in this blog post.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ia288m2UEvaWMsSf4ZV5pQ.png" /></figure><p><a href="https://open-wc.org/">Open-wc</a> is a mix of recommendations and tools for many developer’s use cases : developing, linting, testing, building, demoing, publishing. Some boilerplates are very opinionated, but for my use-case about testing, it just works ! Have a look at <a href="https://open-wc.org/about/#our-philosophy">their philosophy</a>.</p><p>For this tutorial, Iwill explain in details the setup for the “ Component ” boilerplate of Stencil CLI :</p><h3><strong>STEP 1 : generate the project</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RYC4c5olX6QbR5ObF-XfRA.png" /></figure><p>You should got these folders and files structure :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/269/1*VOBSu_-ql2W2t2_ZwWFzkw.png" /></figure><h3>STEP 2 : install <a href="https://open-wc.org/">Open-wc</a> testing tools</h3><p>After installing Yeoman and <a href="https://open-wc.org/">Open-wc</a> generator, you can run it inside your Stencil project :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4esGCda5rzo_Ltr0mpq3MQ.png" /></figure><h3><strong>STEP 3 : edit test file</strong></h3><p>The generated test file has to be updated to work with your Stencil web component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Li1JZJOySjdJR1Cc5Mh5lw.png" /></figure><ol><li>We import the <strong>defineCustomElements</strong> on line 6 exported by Stencil, and call it with window context on line 7 to register the component inside the <a href="https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry"><strong>CustomElementsRegistry</strong></a>.</li><li>We can start testing our Web component. <a href="https://open-wc.org/">Open-wc</a> comes with very cool helpers like <strong>“ fixture ”</strong>. It helps you generate for each test suit an isolated component, so if each test suit is running in parallel, you don’t have side effects from one to another.</li><li><strong>Important :</strong> Before trying querying and testing with assertions your Web Component, it has to be rendered inside the DO and you have to wait a certain amount of time. Fixture helpers has internal bindings using the powerful async/await to call a public API from Stencil, <a href="https://stenciljs.com/docs/methods/"><strong>componentOnReady()</strong></a><strong>.</strong></li></ol><h3>STEP 4 : run your test locally</h3><p>After running <strong>npm install</strong> to install all the devDependencies, build your Web Component with Stencil and launch the test, everything should be fine except for code coverage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*yE_BUEUn_iTbUssf-i6irQ.png" /></figure><p>The default code coverage configuration of thresholds of <a href="https://github.com/open-wc/open-wc/blob/master/packages/testing-karma/default-settings.js#L48">open-wc/testing are at 90%</a>. You can change that by editing the <strong>karma.conf.js</strong> file, and configuring thresholds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oDILaAebV0tXJCrKvi0OpQ.png" /></figure><p>This is not enough for our use-case, because <a href="https://istanbul.js.org/">Istanbul</a>, the code coverage tool used by Karma, calculates the coverage of all the files generated by Stencil compiler inside the <strong>dist</strong> folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*vR061nKlZAFOedo0zbg1WA.jpeg" /></figure><p>The <strong>es2017</strong> folder contains files used to bootstrap our Web Component, and also the Stencil runtime. Excluding these files from code coverage requires adding the following regular expressions inside <strong>karma.conf.js</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t_hkNbWh3pxr0sPUwheVsA.png" /></figure><h3>STEP 5 : run your test in BrowserStack</h3><p><a href="https://open-wc.org/">Open-wc</a> has a package for that, <strong>testing-karma-bs</strong>. It was installed during step 2. Edit the <strong>karma.es5.bs.config.js</strong> to edit the <strong>name</strong> of your project inside <strong>BrowserStack</strong>.</p><p>Next step, you have to setup a <strong>.travis.yml</strong> file to configure your CI. (You can also do the same thing with <a href="https://circleci.com/">CircleCI</a>, <a href="https://www.jetbrains.com/teamcity/">TeamCity</a> or <a href="https://about.gitlab.com/product/continuous-integration/">Gitlab</a>.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pDrloE0SQYqDjp60teiYDA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/1*ZVvyK-nAVmI_nquZKukCtg.png" /></figure><p>Nest step is to add two <strong>Environment Variables</strong> inside the setting of your Travis repository, <strong>BROWSER_STACK_ACCESS_KEY</strong> and <strong>BROWSER_STACK_USERNAME</strong>. You can find them at the top left corner of BrowserStack dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-fm8LsY_QD_0HpA2_sUspA.png" /></figure><p>Last step is to launch a build and wait for results :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*HhefYswjPCfCRjr3W9ScmQ.png" /></figure><p>The default list of browsers running inside <strong>BrowserStack</strong> are configured inside default settings of <strong>open-wc/testing-karma-bs/bs-settings.js</strong> : latest stable version of Chrome, Firefox, Safari, Edge and IE11.</p><p>You can add more browsers by adding custom launchers inside <a href="https://github.com/vogloblinsky/open-wc-stencil/blob/master/karma.es5.bs.config.js"><strong>karma.es5.bs.config.js</strong></a><strong>.</strong></p><h3>Real use-case : Nutrition Web Components</h3><p>If you want, you can also see another implementation of <a href="https://open-wc.org/">open-wc</a> testing tools inside a recent open-source project i created : <a href="https://github.com/vogloblinsky/nutrition-web-components">Nutrition Web Components</a>. It is a collection of two Web Components for displaying Nova and Nutri-score nutritional badges. I will use them inside a nutritional open-source project which will be online soon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*mJH7gUFX6YgYef7O0wrK7g.png" /><figcaption>Nova &amp; Nutri-score badges</figcaption></figure><h3>Thank you !</h3><p>That’s it! I hope you enjoyed reading this post as much as I enjoyed writing it, don’t hesitate to add some claps and let me know how much you like it.</p><p>The final source code is available on Github :</p><p><a href="https://github.com/vogloblinsky/open-wc-stencil">vogloblinsky/open-wc-stencil</a></p><p><em>Follow me on Twitter </em><a href="https://twitter.com/vogloblinsky"><em>@vogloblinsky</em></a><em> for news about Web Components.</em></p><p><em>Thanks </em><a href="https://medium.com/u/d44026c69d50"><em>Wassim Chegham</em></a><em> and </em><a href="https://twitter.com/daKmoR"><em>Thomas Allmer</em></a><em> for the review.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93c1b154bfd9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vincent-ogloblinsky/cross-browser-testing-your-stencil-web-component-like-a-boss-93c1b154bfd9">Cross Browser Testing your Stencil Web Component like a boss</a> was originally published in <a href="https://medium.com/vincent-ogloblinsky">Vincent Ogloblinsky</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Thanks ]]></title>
            <link>https://medium.com/vincent-ogloblinsky/thanks-25953a875961?source=rss----534b9068f7e---4</link>
            <guid isPermaLink="false">https://medium.com/p/25953a875961</guid>
            <dc:creator><![CDATA[Vincent Ogloblinsky]]></dc:creator>
            <pubDate>Mon, 11 Dec 2017 08:08:59 GMT</pubDate>
            <atom:updated>2017-12-11T08:08:59.489Z</atom:updated>
            <content:encoded><![CDATA[<p>Thanks 😉</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25953a875961" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vincent-ogloblinsky/thanks-25953a875961">Thanks 😉</a> was originally published in <a href="https://medium.com/vincent-ogloblinsky">Vincent Ogloblinsky</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Yes ]]></title>
            <link>https://medium.com/vincent-ogloblinsky/yes-4236a0d4b332?source=rss----534b9068f7e---4</link>
            <guid isPermaLink="false">https://medium.com/p/4236a0d4b332</guid>
            <dc:creator><![CDATA[Vincent Ogloblinsky]]></dc:creator>
            <pubDate>Mon, 04 Dec 2017 10:46:22 GMT</pubDate>
            <atom:updated>2017-12-04T10:46:22.209Z</atom:updated>
            <content:encoded><![CDATA[<p>Yes 😩</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4236a0d4b332" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vincent-ogloblinsky/yes-4236a0d4b332">Yes 😩</a> was originally published in <a href="https://medium.com/vincent-ogloblinsky">Vincent Ogloblinsky</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Export Angular components as Custom Elements with “Angular Elements”]]></title>
            <link>https://medium.com/vincent-ogloblinsky/export-angular-components-as-custom-elements-with-angular-elements-a2a0bfcd7f8a?source=rss----534b9068f7e---4</link>
            <guid isPermaLink="false">https://medium.com/p/a2a0bfcd7f8a</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[web-components]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Vincent Ogloblinsky]]></dc:creator>
            <pubDate>Sun, 26 Nov 2017 16:31:01 GMT</pubDate>
            <atom:updated>2017-12-17T19:50:53.473Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*THwLoeqaLjU3IRE83n8TAA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/GJCWj-n3h4E?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Sanwal Deen</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p><strong><em>Disclaimer</em></strong><em> : the main subject of this post, </em><strong><em>Angular Elements</em></strong><em> project, is an </em><strong><em>alpha</em></strong><em> project, and APIs explained here could have changed since the release of this blog post. I will try to keep it up-to-date.</em></p><p><strong><em>Update 20171217</em></strong><em> : github repository demo has been updated to Angular 5.1.1, and AOT generation has been added. Final bundle is now around 200 ko with gzip compression. Thanks Boyan Barakov for the PR.</em></p><p>If you have heard the last news in the Angular community, the first major news was the release of <strong>Angular 5.0</strong>, see the blog post from <a href="https://medium.com/u/a1fba6cea10f">Stephen Fluin</a> for more details : <a href="https://blog.angular.io/version-5-0-0-of-angular-now-available-37e414935ced">https://blog.angular.io/version-5-0-0-of-angular-now-available-37e414935ced</a></p><p>One month ago, the Angular team announced at the <strong>Angular Mix</strong> conference in Orlando a new idea : <strong>Angular Labs</strong>. The idea is to communicate with the community about internal projects and get feedback more quickly.</p><p>There were 4 Angular labs projects announced : <strong>Schematics, Component Dev Kit, ABC, </strong>and the last<strong> Angular Elements.</strong> You can find more informations about the three first projects here : <a href="https://blog.angular.io/the-angular-team-at-angularmix-2d56fd7fde65">https://blog.angular.io/the-angular-team-at-angularmix-2d56fd7fde65</a></p><p>I will focus on the last one which is for me a big deal for Angular developers.</p><h3>Web components</h3><p>We all knew web components since their first announcement in 2011 by <a href="https://medium.com/u/fa63e1e8071">Alex Russell</a> during Fronteers conference.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F33430613%3Fapp_id%3D122963&amp;dntp=1&amp;display_name=Vimeo&amp;url=https%3A%2F%2Fvimeo.com%2F33430613&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F226910586-81efbfeac1eb1f26f8dc543f0c05c910046f81ae12169187c8de42a36d6995e8-d_1280&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="1280" height="720" frameborder="0" scrolling="no"><a href="https://medium.com/media/e45fa7e4579eeeb934d3efe26e660751/href">https://medium.com/media/e45fa7e4579eeeb934d3efe26e660751/href</a></iframe><p>This standard that is supported by more and more browser natively, or with flags and polyfills is split into 4 specifications :</p><ul><li>HTML templates</li><li>Shadow DOM</li><li>HTML imports</li><li>custom elements</li></ul><p>Have a look at the official website for more informations about these 4 specs : <a href="https://www.webcomponents.org/specs">https://www.webcomponents.org/specs</a></p><p>The last one is the most interesting for us.</p><h3>Custom elements</h3><p>Since the beginning of Angular, the goal was to follow the philosophy behinds these standards. Using one web component inside an Angular application is not a problem. This talk from I/O 2017 with <a href="https://medium.com/u/d712d6fb229b">Rob Dodson</a> and <a href="https://medium.com/u/a1fba6cea10f">Stephen Fluin</a> explain it very well.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FUcq9F-7Xp8I%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DUcq9F-7Xp8I&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FUcq9F-7Xp8I%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/043385b93c60ae45514d77ee149a48f0/href">https://medium.com/media/043385b93c60ae45514d77ee149a48f0/href</a></iframe><p>Sometimes, Angular developers share very powerful <strong>UI libraries</strong> as Angular libraries, but they are all linked deeply with Angular, and opening them to other technologies is a bit complicated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TAF00Lu6NNQHnaCWMrOwmg.png" /><figcaption>Powerful UI libraries for Angular</figcaption></figure><p>Sharing just one or a set of Angular components to the outside world was not supported until now, and <strong>Angular Elements</strong> project will help us a lot in that situation.</p><h3>Angular Elements</h3><p>I will quote <a href="https://medium.com/u/d265c7f819df">Rob Wormald</a> Angular Connect talk for his clean marketing sentence about them :</p><blockquote><strong>Angular elements are Angular components packaged as Custom elements.</strong></blockquote><p>With that in mind, you understand that it will create a bridge between your Angular component and the outside world, and use it outside an Angular application.</p><p>The main features of Angular Elements are :</p><ul><li><strong>self-bootstrapping</strong>, just paste it in your page and it works !</li><li>hosts an <strong>Angular Component</strong> inside a <strong>Custom Element</strong></li><li>bridge between <strong>DOM APIs</strong> and <strong>Angular Components APIs</strong> : @Inputs for properties, @Outputs for events, @HostBinding/Listener for observed attributes.</li></ul><h3>How to create an Angular Element ?</h3><ol><li><strong>Simply create a normal Angular component with inputs and outputs.</strong></li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/381415ca0a0bcba8a864f5fd02b83506/href">https://medium.com/media/381415ca0a0bcba8a864f5fd02b83506/href</a></iframe><p><strong>2. Include it inside a simple module.</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cdc836c6e47322e7491add483509055e/href">https://medium.com/media/cdc836c6e47322e7491add483509055e/href</a></iframe><p>This simple module has just referencing <em>HelloComponent</em>, and we add it also inside <em>entryComponents</em> metadatas. As a reminder, an <em>entry Component</em> is a component that Angular loads imperatively by type, in combination with ngDoBootstrap function. (<a href="https://angular.io/guide/ngmodule-faq#what-is-an-entry-component">https://angular.io/guide/ngmodule-faq#what-is-an-entry-component</a>)</p><p><strong>3. Register the component using the </strong><a href="http://twitter.com/angular/elements"><strong>@angular/elements</strong></a><strong> APIs.</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0c063c5e9b5591189027d89e7abd69e5/href">https://medium.com/media/0c063c5e9b5591189027d89e7abd69e5/href</a></iframe><p><strong>4. Build it.</strong></p><p>For this last part, i will simply use Webpack &amp; Angular Compiler Plugin from @ngtools/webpack.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b5595f2249ba0632ff40fcc671007982/href">https://medium.com/media/b5595f2249ba0632ff40fcc671007982/href</a></iframe><p>Have a look at this article for more details : <a href="https://www.ag-grid.com/ag-grid-webpack-ngtools/">https://www.ag-grid.com/ag-grid-webpack-ngtools/</a></p><p><strong>5. Use it inside a simple html page.</strong></p><p>Here we are using the element inside our page, and writing some vanilla js code to play with it. I just change the name attribute, and listen to events coming from the element.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cc5a3d1230cad1f596ba529bea558787/href">https://medium.com/media/cc5a3d1230cad1f596ba529bea558787/href</a></iframe><p><strong>6. Watch the result</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*RSeBOGDYZ1e7A__S_vCLCg.gif" /></figure><p>We can see that the Angular element registered as a custom element is available inside <em>window.customElements</em> global registry (<a href="https://www.w3.org/TR/custom-elements/#custom-elements-api">https://www.w3.org/TR/custom-elements/#custom-elements-api</a>).</p><p>You can find all these files inside this github repository : <a href="https://github.com/vogloblinsky/angular-elements-demo">https://github.com/vogloblinsky/angular-elements-demo</a></p><h3>How it works ?</h3><p>If you have a look at the source code of <strong>@angular/elements</strong>, the function <strong><em>registerAsCustomElements</em></strong> used above starts by calling the bootstrapping code, and after register the components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*fFEYuAbTPEQjSoSmJtV9sg.png" /></figure><p>As expected, the <strong>NgElement</strong> class used to register all the components as custom elements extends HTMLElement class like a vanillajs custom element should do.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*M96d6n7VNtXoVQ_6ya-y0w.png" /></figure><h3>What’s next ?</h3><p>I will post an advanced article in the next weeks about more advanced feedbacks about this project.</p><p>Meanwhile<a href="https://medium.com/u/32a0d1331713"> Pascal Precht ʕ•̫͡•ʔ</a> had a great talk about this subject during NG-BE conference :</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FHi2lRWUDuHA%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DHi2lRWUDuHA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FHi2lRWUDuHA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0bc141fe2470a2bc9ee7d5386ee64340/href">https://medium.com/media/0bc141fe2470a2bc9ee7d5386ee64340/href</a></iframe><h3>Conclusion</h3><p>The first drawback of this proof of concept is that the <em>main.bundle.js</em> file is around 1<strong>Mb or 200kb gzipped</strong>. The compiled JavaScript file just for the component and his module is around <strong>2 Ko</strong>. We are shipping many Angular codebase with our element.</p><p>We are just at the beginning of this labs project. The APIs are very young and they could change (so don’t use them in production), but i’m very excited about the cool stuff which will come next months.</p><p>I recommend watching the branch <strong>labs/elements</strong> on github for having the latest news about this project, and also following <a href="https://medium.com/u/d265c7f819df">Rob Wormald</a> (<a href="https://twitter.com/robwormald">https://twitter.com/robwormald</a>) and <a href="https://medium.com/u/5feb79ad7844">George Kalpakas</a> (<a href="https://twitter.com/gkalpakas">https://twitter.com/gkalpakas</a>) on Twitter.</p><p>Thanks <a href="https://medium.com/u/d44026c69d50">Wassim Chegham</a> for the review.</p><h3>Resources</h3><ul><li><a href="https://docs.google.com/presentation/d/1jiXHYwfe1iSUiVLdKLFhSPRHLI_FmIvrI60QTpP6KLk/edit">Angular Elements @ AngularConnect - Public</a></li><li><a href="http://www.andrewconnell.com/blog/solve-the-sharepoint-framework-angular-challenge-with-angular-5-0-elements">AC&#39;s Blog: Solve the SharePoint Framework + Angular Challenge with Angular 5.0 Elements</a></li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fstackblitz.com%2Fedit%2Fangular-ce-poc-wip%3Fembed%3D1&amp;url=https%3A%2F%2Fstackblitz.com%2Fedit%2Fangular-ce-poc-wip&amp;image=https%3A%2F%2Fa.staticblitz.com%2Fassets%2Ficon-664493542621427cc8adae5e8f50d632f87aaa6ea1ce5b01e9a3d05b57940a9f.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=stackblitz" width="745" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/a85636d669102e244c57ae4af37660b8/href">https://medium.com/media/a85636d669102e244c57ae4af37660b8/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2a0bfcd7f8a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vincent-ogloblinsky/export-angular-components-as-custom-elements-with-angular-elements-a2a0bfcd7f8a">Export Angular components as Custom Elements with “Angular Elements”</a> was originally published in <a href="https://medium.com/vincent-ogloblinsky">Vincent Ogloblinsky</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What’s new in Compodoc v1.0.0]]></title>
            <link>https://medium.com/vincent-ogloblinsky/whats-new-in-compodoc-v1-0-0-8356b7cfe691?source=rss----534b9068f7e---4</link>
            <guid isPermaLink="false">https://medium.com/p/8356b7cfe691</guid>
            <category><![CDATA[components]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[documentation]]></category>
            <category><![CDATA[angular2]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Vincent Ogloblinsky]]></dc:creator>
            <pubDate>Wed, 05 Apr 2017 16:42:00 GMT</pubDate>
            <atom:updated>2017-04-05T16:42:00.701Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NCUsAPSbmBsSTVakZhKvgA.jpeg" /><figcaption><a href="http://www.copyright01.com/%C2%A9-symbole-copyright">©</a> <a href="https://unsplash.com/@glennoble">Glen Noble</a> — Unsplash.com</figcaption></figure><p>I started and release a few months ago my first big open-source project, a documentation tool for Angular applications (<a href="https://medium.com/vincent-ogloblinsky/compodoc-documentation-tool-for-angular-2-applications-44ec650e01a8">https://medium.com/vincent-ogloblinsky/compodoc-documentation-tool-for-angular-2-applications-44ec650e01a8</a>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*vaaVsk5hcBwN9cjQVQLYXw.png" /></figure><p>The feedbacks were very good, and ideas of improvement or bugs come very quickly on the <a href="https://github.com/compodoc/compodoc">Github repository</a>.</p><p>I have working on several enhancements during the last months that make now Compodoc a very interesting alternative to TypeDoc for Angular projects.</p><p>Here are some details of most of them :</p><h3>Routing graph</h3><p>Compodoc now support default Angular routing configurations with “routing modules” and “lazy loading” for example.</p><p>The routing demo project has for example one lazy-module and others modules that are directly loaded during the bootstrap of the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fB75kyzCgtc7EKTL5AsBGA.png" /><figcaption>Routing graph with lazy-module and routing module definition.</figcaption></figure><p>It helps to understand very quickly which component is routed, how many routes are availables, which one is lazy loaded etc.</p><p>The limitations are for now support of variables in routes array definitions. This will be fixed soon.</p><pre>const APP_ROUTES: Routes = [...ROUTES];</pre><h3>Watch flag</h3><p>During documentation of a project, it is far useful to have a dynamic documentation updated with last details written by the developer.</p><p>Compodoc has now a <strong>“watch”</strong> feature. Just launch the tool with <strong>-w</strong> flag and let the magic happen.</p><h3><strong>Additional</strong> <strong>documentation</strong></h3><p>Extending the generated documentation is also interesting for providing additional informations about the main features of the application.</p><p>With version 1, you can supply markdown files located in a separate directory, and a special entry in the menu will appear.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y6Yrb52SjLx4aiDNztSAZA.png" /></figure><h3>compodoc to @compodoc/compodoc</h3><p>I have moved compodoc to a scoped package, with also others related projects like <a href="https://github.com/compodoc/ngd">ngd</a> from <a href="https://medium.com/u/d44026c69d50">Wassim Chegham</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XmskfJTvjna-qPckNFiBUw.png" /></figure><p>So now for the installation, you just need to use the scope @compodoc :</p><pre>npm i @compodoc/compodoc --save-dev or -g</pre><h3>Website</h3><p>I also create a dedicated website for hosting the documentation in a easiest way than a simple README file on github.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*MOOYhVTom8jaYbXwDalBiw.png" /></figure><h3>What’s next ?</h3><p>The roadmap for the newt months is dedicated to :</p><ul><li>handle AngularJS 1.6.x projects with TypeScript</li><li>move “Modules graph” from a static image to a svg graph, may be using <a href="http://visjs.org/">vis.js</a></li><li>support of more general TypeScript/ES6 syntax</li></ul><p>We appreciate your feedbacks. Please open any issue you may encounters and pull-requests are more than welcome.</p><p>Follow <a href="https://medium.com/u/508fb9ac5685">Vincent Ogloblinsky</a> / <a href="https://twitter.com/vogloblinsky"><strong>@vogloblinsky</strong></a> for getting updates.</p><h3>Resources</h3><ul><li><a href="https://github.com/compodoc/website">https://github.com/compodoc/website</a></li><li><a href="https://compodoc.github.io/compodoc-demo-todomvc-angular">https://compodoc.github.io/compodoc-demo-todomvc-angular</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8356b7cfe691" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vincent-ogloblinsky/whats-new-in-compodoc-v1-0-0-8356b7cfe691">What’s new in Compodoc v1.0.0</a> was originally published in <a href="https://medium.com/vincent-ogloblinsky">Vincent Ogloblinsky</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Compodoc — Documentation tool for Angular applications]]></title>
            <link>https://medium.com/vincent-ogloblinsky/compodoc-documentation-tool-for-angular-2-applications-44ec650e01a8?source=rss----534b9068f7e---4</link>
            <guid isPermaLink="false">https://medium.com/p/44ec650e01a8</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[angular2]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[documentation]]></category>
            <category><![CDATA[components]]></category>
            <dc:creator><![CDATA[Vincent Ogloblinsky]]></dc:creator>
            <pubDate>Wed, 08 Feb 2017 13:03:43 GMT</pubDate>
            <atom:updated>2017-04-03T08:28:02.997Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2pz2usDj_CkUuk1S9zV-_g.jpeg" /><figcaption><a href="http://www.copyright01.com/%C2%A9-symbole-copyright">©</a> Eli Francis — Unsplash.com</figcaption></figure><p>Documentation is always a boring task for developers who write softwares. When we have to write documentation for other developers, it is most of the time a source of frustration, and we rather prefer coding.</p><p>I work at a French IT services company, and we have to provide such documentation for our customers. We usually deal with two scenarios :</p><ul><li>Documentation written using Microsoft Word, with a “functional” look, and sometimes API inside. The targets are people who are not developers, but managers.</li><li>Generated documentation, like API documentation, for backend and/or frontend softwares.</li></ul><p>Since we are developers, we are by nature, “ lazy ” people, trying most of the time to code a task, rather than executing it. And “generated” documentation is a good solution.</p><p>The other advantage, is “ living ” documentation. As software grows, and code is being documented, the documentation automatically syncs with the last updates.</p><p>For AngularJS developers, the de-facto solution for generating documentation is a tool called “ <a href="https://github.com/angular/dgeni">Dgeni</a> ”, created by the AngularJS team. It is a very low level tool, and works fine with a little of configuration and a couple of scripts.</p><p>We started the switch to Angular a few months ago in my company, and the question about “ Documentation ” tooling came up exactly last month.</p><p>After some researches on the Web, I found out that there were no tools available, so the conclusion was straightforward : “ Let’s code one ”.</p><p>It was the start of the <a href="https://github.com/compodoc/compodoc">Compodoc</a> project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*vaaVsk5hcBwN9cjQVQLYXw.png" /><figcaption>Compodoc logo — <a href="http://www.copyright01.com/%C2%A9-symbole-copyright">©</a> Vincent Ogloblinsky</figcaption></figure><h3><strong>What’s is Compodoc ?</strong></h3><p><a href="https://github.com/compodoc/compodoc">Compodoc</a> is a documentation tool for your Angular application.</p><p>The goal of the tool is to generate a documentation for all the common APIs of Angular : modules, components, injectables, routes, directives, pipes and classical classes.</p><h3><strong>Give me an example</strong></h3><p>The workflow is easy. I am using this <a href="https://github.com/compodoc/compodoc-demo-todomvc-angular">Angular demo project</a> for the screenshots below :</p><ul><li>install it with npm :</li></ul><pre>npm i -g @compodoc/compodoc</pre><ul><li>run it inside the folder of your Angular 2 application</li></ul><pre>compodoc -p src/tsconfig.json</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gixClrkIx1IEylbTJbyZxQ.png" /></figure><p>After some logs in the console, you got the generated documentation in the <strong>./documentation/</strong> folder at the root of your project folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*Ytej7cvomQLzflT2WE99KQ.png" /></figure><p>You can then run an HTTP server in that folder, or launch the previous command with the <strong>-s</strong> flag, and the tool will serve you the documentation, by default on <strong>http://localhost:8080</strong></p><p>The home page is generated using the README.md file if detected, and instead the overview page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BAwtIVMzCOAdEEbxLGbmRw.png" /><figcaption>Homepage generated by compodoc</figcaption></figure><p>The overview page uses a great graph tool developped by <a href="https://medium.com/@wassimchegham">Wassim Chegham</a> called <a href="https://github.com/manekinekko/angular2-dependencies-graph"><strong>angular2-dependencies-graph</strong></a>; and give a brief overview of how many modules and components you have in your application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Rv3OU78rLN3qp1Y57HbLQ.png" /><figcaption>Overview page generated by compodoc</figcaption></figure><p>Now let’s see a page for one module, the <strong>TodoModule</strong> for example. You will have the local dependencies graph for this one, and the list of declarations, imports, exports, etc of your module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UENiaVnQwpDegN3zEFr19Q.png" /><figcaption>Module page generated by compodoc</figcaption></figure><p>Let’s go even further with a component page, the <strong>HeaderComponent</strong>. As in the module page, you have all the “@component” decorator options listed, if available for this component. The @inputs and @outputs are also available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MFpFFVp1BuqVM8D8SVbw4Q.png" /><figcaption>Component page generated by compodoc</figcaption></figure><p>And it is the same thing for classes, directives, pipes and services. The TodoStore is a good example :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qApRDs3QkJJja3JoXo-14Q.png" /><figcaption>Injectable page generated by compodoc</figcaption></figure><h3><strong>Which comments did i have to write for getting these results ?</strong></h3><p>Just normal comments. We have added support of markdown syntax with a npm package called “<a href="https://github.com/chjj/marked"><strong>marked</strong></a>”. We are thinking about a feature for linking comments like normal markdown links. Stay tuned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aeRFXGgWW4nGJ8CwKSN3WA.png" /><figcaption>Injectable service commented</figcaption></figure><h3>What’s next ?</h3><p>The tool is just a few days old, so we will try to test it on as many projects as we can in order to improve it and optimize it.</p><p>We plan to add an option to provide external “functional documentation”, like markdown files in a folder, and add them to the generated documentation, in a dedicated entry in the left-side menu bar.</p><p>We will also try to do the same stuff for AngularJS 1.5+ projects, build using Typescript.</p><p>We appreciate your feedbacks. Please open any issue you may encounters and pull-requests are more than welcome.</p><p>Follow <a href="https://medium.com/u/508fb9ac5685">Vincent Ogloblinsky</a> / <a href="https://twitter.com/vogloblinsky"><strong>@vogloblinsky</strong></a> for getting updates.</p><h3>Resources</h3><ul><li><a href="https://github.com/compodoc/compodoc">https://github.com/compodoc/compodoc</a></li><li><a href="https://github.com/compodoc/compodoc-demo-todomvc-angular2">https://github.com/compodoc/compodoc-demo-todomvc-angular2</a></li><li><a href="https://github.com/manekinekko/angular2-dependencies-graph">https://github.com/manekinekko/angular2-dependencies-graph</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44ec650e01a8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vincent-ogloblinsky/compodoc-documentation-tool-for-angular-2-applications-44ec650e01a8">Compodoc — Documentation tool for Angular applications</a> was originally published in <a href="https://medium.com/vincent-ogloblinsky">Vincent Ogloblinsky</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>