<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Dojo</title>
  
  
  <link href="/atom.xml" rel="self"/>
  
  <link href="https://dojo.io/"/>
  <updated>2019-03-22T14:47:35.838Z</updated>
  <id>https://dojo.io/</id>
  
  <author>
    <name>SitePen</name>
    
  </author>
  
  <generator uri="http://hexo.io/">Hexo</generator>
  
  <entry>
    <title>Announcing Dojo 5.0.0</title>
    <link href="https://dojo.io/blog/2019/01/29/2019-01-29-Version-5-Dojo/"/>
    <id>https://dojo.io/blog/2019/01/29/2019-01-29-Version-5-Dojo/</id>
    <published>2019-01-29T08:00:00.000Z</published>
    <updated>2019-03-22T14:47:35.838Z</updated>
    
    <content type="html"><![CDATA[<h2 id="Dojo-version-5-has-arrived"><a href="#Dojo-version-5-has-arrived" class="headerlink" title="Dojo version 5 has arrived!"></a>Dojo version 5 has arrived!</h2><p>We’re excited to announce the 5.0.0 release of Dojo. This version builds on previous releases with a vast array of bug fixes and improvements throughout the framework.</p><img src="/blog/2019/01/29/2019-01-29-Version-5-Dojo/featured.png" title="feature-full"><a id="more"></a><h3 id="Conditional-Polyfills-Serving-Less-JavaScript"><a href="#Conditional-Polyfills-Serving-Less-JavaScript" class="headerlink" title="Conditional Polyfills - Serving Less JavaScript"></a>Conditional Polyfills - Serving Less JavaScript</h3><p>One of our primary goals for modern Dojo is to improve performance by serving minimal JavaScript bundles by default. For version 5, we’re happy to announce an out of the box solution to optimize the user experience for dealing with bundling and loading polyfills in Dojo applications.</p><p>The Dojo build produces separate platform bundles that will be <strong>only</strong> be loaded based on two key conditions:</p><p>1) The shim module is imported somewhere in an application.<br>1) A users browser does not natively support the browser feature.</p><p>In short, if your application does not use the browser feature or you use a browser with native support, the polyfill will not be loaded! This change means serving less JavaScript and improving your application performance without compromising on features.</p><h3 id="New-Polyfills-Added-to-Shim"><a href="#New-Polyfills-Added-to-Shim" class="headerlink" title="New Polyfills Added to Shim"></a>New Polyfills Added to Shim</h3><p>We’ve added additional third party polyfills to <code>@dojo/framework/shim</code>:</p><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API" target="_blank" rel="noopener"><code>@dojo/framework/shim/fetch</code></a> - The Fetch API provides an interface for fetching resources (including across the network).</li><li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API" target="_blank" rel="noopener"><code>@dojo/framework/shim/IntersectionObserver</code></a> - The Intersection Observer API provides a way to asynchronously observe changes in the intersection of a target element with an ancestor element or with a top-level document’s viewport.</li><li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API" target="_blank" rel="noopener"><code>@dojo/framework/shim/WebAnimations</code></a> - The Web Animations API allows for synchronizing and timing changes to the presentation of a Web page, i.e. animation of DOM elements.</li><li><a href="https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver" target="_blank" rel="noopener"><code>@dojo/framework/shim/ResizeObserver</code></a> - The ResizeObserver interface reports changes to the content rectangle of an Element or the bounding box of an SVGElement. The content rectangle is the box in which content can be placed, meaning the border box minus the padding.</li></ul><p>To use these additional polyfills they should be imported like any other ponyfill provided by <code>@dojo/framework/shim</code> and they no longer need to be explicitly added/imported to your Dojo application.</p><h3 id="Better-Build-Time-Rendering-BTR"><a href="#Better-Build-Time-Rendering-BTR" class="headerlink" title="Better Build Time Rendering (BTR)"></a>Better Build Time Rendering (BTR)</h3><p>Build time rendering provides the rendering of your application to HTML during the build and in-lines critical CSS. BTR allows an application to render static HTML pages and offer some advantages of server-side rendering (SSR) such as performance and search engine optimization without the complexities of running a server to support full SSR. Build time rendering has been available via the Dojo <a href="https://github.com/dojo/cli-build-app#build-time-render-object" target="_blank" rel="noopener">cli-build-app</a>  command since our initial 2.0.0 release.</p><p>There are a number of stability and feature enhancements in the 5.0.0 release thanks to the BTR process now running your application in a real browser environment. New features include:</p><ul><li><a href="#introducing-dojo-blocks">Dojo Blocks</a></li><li>Support for <code>StateHistory</code> API (see below)</li><li>Multiple page HTML generation</li><li>Screenshots of pages visited during Build Time Rendering</li><li>Better error messaging</li></ul><p>Routing support has been extended to support a <code>HistoryManager</code> using the browser <a href="https://developer.mozilla.org/en-US/docs/Web/API/History" target="_blank" rel="noopener">history API</a> via the <code>@dojo/framework/routing/history/StateHistory</code>. For <code>StateHistory</code> BTR produces a static HTML file for each of the paths defined in the build time rendering configuration.</p><p>To configure build time rendering to create static pages for the BTR paths, ensure you are using the <code>StateHistory</code> in your application and update your BTR config to specify paths without a <code>#</code> prefix.</p><pre class=" language-json"><code class="language-json"><span class="token property">"build-app"</span><span class="token operator">:</span> <span class="token punctuation">{</span>    <span class="token property">"build-time-render"</span><span class="token operator">:</span> <span class="token punctuation">{</span>        <span class="token property">"root"</span><span class="token operator">:</span> <span class="token string">"app"</span><span class="token punctuation">,</span>        <span class="token property">"paths"</span><span class="token operator">:</span> <span class="token punctuation">[</span>            <span class="token string">"home"</span><span class="token punctuation">,</span>            <span class="token string">"about"</span><span class="token punctuation">,</span>        <span class="token punctuation">]</span>    <span class="token punctuation">}</span><span class="token punctuation">}</span></code></pre><h3 id="Introducing-Dojo-Blocks"><a href="#Introducing-Dojo-Blocks" class="headerlink" title="Introducing Dojo Blocks"></a>Introducing Dojo Blocks</h3><p>Dojo Blocks is a new mechanism leveraging Build Time Rendering that allows executing code in Node.js as part of the build. The results from the execution are written to a cache that can then be transparently used in the same way at runtime in the browser. This opens up new opportunities for performing operations that might be not possible or unperformant in a browser.</p><p>For example, a Dojo Block module could read a group of markdown files, transform them into VNodes, and make them available to render in the application, all at build time. The result of this Dojo Block module is then cached into the application bundle for use at runtime in the browser.</p><p>A Dojo Block module gets used like any other <a href="https://github.com/dojo/framework/blob/master/src/widget-core/README.md#meta-configuration" target="_blank" rel="noopener">meta</a> in any Dojo widget. As a result there is no extensive configuration or alternative authoring patterns needed.</p><p>For example, a block module could read a text file and return the content to the application:</p><pre class=" language-ts"><code class="language-ts"><span class="token comment" spellcheck="true">// src/read-file.block.ts</span><span class="token keyword">import</span> <span class="token operator">*</span> as fs <span class="token keyword">from</span> <span class="token string">'fs'</span><span class="token punctuation">;</span><span class="token keyword">import</span> <span class="token punctuation">{</span> resolve <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'path'</span><span class="token punctuation">;</span><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">(</span>path<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">)</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token punctuation">{</span>    path <span class="token operator">=</span> <span class="token function">resolve</span><span class="token punctuation">(</span>__dirname<span class="token punctuation">,</span> path<span class="token punctuation">)</span><span class="token punctuation">;</span>    <span class="token keyword">return</span> fs<span class="token punctuation">.</span><span class="token function">readFileSync</span><span class="token punctuation">(</span>path<span class="token punctuation">,</span> <span class="token string">'utf8'</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token punctuation">}</span></code></pre><p>Using the <code>text.block.ts</code> module in your application with the <a href="https://github.com/dojo/framework/blob/master/src/widget-core/meta/Block.ts" target="_blank" rel="noopener"><code>Block</code> meta</a>:</p><pre class=" language-ts"><code class="language-ts"><span class="token comment" spellcheck="true">// src/MyBlockWidget.ts</span><span class="token keyword">import</span> Block <span class="token keyword">from</span> <span class="token string">'@dojo/framework/widget-core/meta/Block'</span><span class="token punctuation">;</span><span class="token keyword">import</span> WidgetBase <span class="token keyword">from</span> <span class="token string">'@dojo/framework/widget-core/WidgetBase'</span><span class="token punctuation">;</span><span class="token keyword">import</span> <span class="token punctuation">{</span> v <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@dojo/framework/widget-core/d'</span><span class="token punctuation">;</span><span class="token keyword">import</span> readFile <span class="token keyword">from</span> <span class="token string">'./read-file.block'</span><span class="token punctuation">;</span><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token keyword">class</span> <span class="token class-name">MyBlockWidget</span> <span class="token keyword">extends</span> <span class="token class-name">WidgetBase</span> <span class="token punctuation">{</span>    <span class="token keyword">protected</span> <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>        <span class="token keyword">const</span> message <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">meta</span><span class="token punctuation">(</span>Block<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">run</span><span class="token punctuation">(</span>readFile<span class="token punctuation">)</span><span class="token punctuation">(</span><span class="token string">'../content/hello-dojo-blocks.txt'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>        <span class="token keyword">return</span> <span class="token function">v</span><span class="token punctuation">(</span><span class="token string">'div'</span><span class="token punctuation">,</span> <span class="token punctuation">[</span> message <span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>    <span class="token punctuation">}</span><span class="token punctuation">}</span></code></pre><p>This widget runs the <code>read-file.block.ts</code> module at build time, loading the file path passed which gets used as the children in the widget. The rendered application’s HTML and CSS get written to the built <code>index.html</code>:</p><pre class=" language-html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>html</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>head</span><span class="token punctuation">></span></span>    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>title</span><span class="token punctuation">></span></span>Dojo Blocks<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>title</span><span class="token punctuation">></span></span>    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>theme-color<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>#222127<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>meta</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>viewport<span class="token punctuation">"</span></span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>width<span class="token punctuation">=</span>device-width, initial-scale<span class="token punctuation">=</span>1<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>head</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>body</span><span class="token punctuation">></span></span>    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>root<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">></span></span>Hello Dojo Block World!<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>text/javascript<span class="token punctuation">"</span></span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>bootstrap.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script language-javascript"></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>body</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>html</span><span class="token punctuation">></span></span></code></pre><h3 id="Simplifying-Testing-with-Assertion-Templates"><a href="#Simplifying-Testing-with-Assertion-Templates" class="headerlink" title="Simplifying Testing with Assertion Templates"></a>Simplifying Testing with Assertion Templates</h3><p>Assertion Templates make testing widgets with the testing harness even easier. Instead of needing to manually curate each <code>expectedRender</code> result per test, you can now use the Assertion Template primitive to easily modify and layer outputs for the expected render.</p><p>Assertion Templates allow you to build expected render functions to pass to <code>h.expect()</code>. Assertion Templates always assert against the entire render output, modifying portions of the assertion itself as needed.</p><p>To use Assertion Templates, first import the module:</p><pre class=" language-ts"><code class="language-ts"><span class="token keyword">import</span> assertionTemplate <span class="token keyword">from</span> <span class="token string">'@dojo/framework/testing/assertionTemplate'</span><span class="token punctuation">;</span></code></pre><p>In your tests, you can then write a base assertion which would be the default render state of your widget.</p><p>Given the following widget:</p><pre class=" language-ts"><code class="language-ts"><span class="token keyword">class</span> <span class="token class-name">NumberWidget</span> <span class="token keyword">extends</span> <span class="token class-name">WidgetBase</span><span class="token operator">&lt;</span><span class="token punctuation">{</span> num<span class="token operator">?</span><span class="token punctuation">:</span> <span class="token keyword">number</span> <span class="token punctuation">}</span><span class="token operator">></span> <span class="token punctuation">{</span>    <span class="token keyword">protected</span> <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>        <span class="token keyword">const</span> <span class="token punctuation">{</span> num <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>properties<span class="token punctuation">;</span>        <span class="token keyword">const</span> message <span class="token operator">=</span> num <span class="token operator">===</span> undefined <span class="token operator">?</span> <span class="token string">'no number passed'</span> <span class="token punctuation">:</span> <span class="token template-string"><span class="token string">`the number </span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>num<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">`</span></span><span class="token punctuation">;</span>        <span class="token keyword">return</span> <span class="token function">v</span><span class="token punctuation">(</span><span class="token string">'div'</span><span class="token punctuation">,</span> <span class="token punctuation">[</span>            <span class="token function">v</span><span class="token punctuation">(</span><span class="token string">'span'</span><span class="token punctuation">,</span> <span class="token punctuation">[</span> message <span class="token punctuation">]</span><span class="token punctuation">)</span>        <span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>    <span class="token punctuation">}</span><span class="token punctuation">}</span></code></pre><p>The base assertion might look like:</p><pre class=" language-ts"><code class="language-ts"><span class="token keyword">const</span> baseAssertion <span class="token operator">=</span> <span class="token function">assertionTemplate</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token punctuation">{</span>    <span class="token keyword">return</span> <span class="token function">v</span><span class="token punctuation">(</span><span class="token string">'div'</span><span class="token punctuation">,</span> <span class="token punctuation">[</span>        <span class="token function">v</span><span class="token punctuation">(</span><span class="token string">'span'</span><span class="token punctuation">,</span> <span class="token punctuation">{</span> <span class="token string">'~key'</span><span class="token punctuation">:</span> <span class="token string">'message'</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">[</span> <span class="token string">'no number passed'</span> <span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>    <span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre><p>and in a test would look like:</p><pre class=" language-ts"><code class="language-ts"><span class="token function">it</span><span class="token punctuation">(</span><span class="token string">'should render no number passed when no number is passed as a property'</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token punctuation">{</span>    <span class="token keyword">const</span> h <span class="token operator">=</span> <span class="token function">harness</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token function">w</span><span class="token punctuation">(</span>NumberWidget<span class="token punctuation">,</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>    h<span class="token punctuation">.</span><span class="token function">expect</span><span class="token punctuation">(</span>baseAssertion<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre><p>Now let’s see how we would test the output when the <code>num</code> property gets passed to the <code>NumberWidget</code>:</p><pre class=" language-ts"><code class="language-ts"><span class="token function">it</span><span class="token punctuation">(</span><span class="token string">'should render the number when a number is passed as a property'</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token punctuation">{</span>    <span class="token keyword">const</span> numberAssertion <span class="token operator">=</span> baseAssertion<span class="token punctuation">.</span><span class="token function">setChildren</span><span class="token punctuation">(</span><span class="token string">'~message'</span><span class="token punctuation">,</span> <span class="token punctuation">[</span> <span class="token string">'the number 5'</span> <span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>    <span class="token keyword">const</span> h <span class="token operator">=</span> <span class="token function">harness</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token function">w</span><span class="token punctuation">(</span>NumberWidget<span class="token punctuation">,</span> <span class="token punctuation">{</span> num<span class="token punctuation">:</span> <span class="token number">5</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>    h<span class="token punctuation">.</span><span class="token function">expect</span><span class="token punctuation">(</span>numberAssertion<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre><p>Here we’re using the <code>setChildren()</code> API on the <code>baseAssertion</code>, and we’re using a special <code>~</code> selector to find a node with a key of <code>~message</code>. The <code>~key</code> property is a special property on Assertion Templates and will get erased at assertion time, so it doesn’t show up when matching the renders. This approach allows you to decorate the Assertion Templates to easily select nodes, without having to augment the actual widgets render function.</p><p>Once we have the <code>message</code> node we then set the children to the expected <code>the number 5</code>, and use the resulting template in <code>h.expect</code>. It’s important to note Assertion Templates always return a new Assertion Template when setting a value, this ensures you don’t accidentally mutate an existing template (potentially causing other tests to fail), and allows you to compose layered Templates incrementally building on each other.</p><h3 id="Improved-Stores-Middleware"><a href="#Improved-Stores-Middleware" class="headerlink" title="Improved Stores Middleware"></a>Improved Stores Middleware</h3><p>Middleware for Dojo stores has always gotten executed after a process has completed or throws an error, enabling users to make decisions based on the result and perform some additional actions. However, this was limiting middleware from running before or effectively wrapping a process. Version 5 of Dojo introduces <code>before</code> and <code>after</code> middleware to perform such actions around processes completely. <a href="https://github.com/dojo/framework/blob/master/src/stores/README.md#middleware" target="_blank" rel="noopener">Read more on the <code>@dojo/framework/stores</code> readme</a>.</p><p>This addition of <code>before</code> and <code>after</code> middleware is a breaking change. However, if your application was already using <code>createCallbackDecorator</code> to create your middleware, then your application should continue to work with your application in version 5 of Dojo application as the <code>createCallbackDecorator</code> function has been adapted to transform existing middleware API to the new API.</p><h3 id="Improvements-for-serve-and-watch-options-in-dojo-cli-build-app"><a href="#Improvements-for-serve-and-watch-options-in-dojo-cli-build-app" class="headerlink" title="Improvements for serve and watch options in @dojo/cli-build-app"></a>Improvements for <code>serve</code> and <code>watch</code> options in <code>@dojo/cli-build-app</code></h3><p>The <code>@dojo/cli-build-app</code> command includes a number improvements for running a development server:</p><ul><li>The previous <code>watch</code> modes, <code>memory</code> and <code>file</code> have been consolidated into a unified <code>watch</code> option</li><li>Rebuilds your application when you make any changes within the project directory, not limited to <code>src</code> and <code>test</code> directories.</li><li>Live reload when the application is rebuilt during <code>watch</code> and running the development server using <code>serve</code></li><li>Customized live reload <code>client</code> that does not affect your built application bundles</li><li>Conditionally loads the live reload <code>client</code> only when using the <code>serve</code> option</li><li>Fallback to default <code>index.html</code> and rewrite resources when using the <code>StateHistory</code> history manager with <code>@dojo/framework/routing</code></li></ul><h3 id="Extended-TypeScript-Support"><a href="#Extended-TypeScript-Support" class="headerlink" title="Extended TypeScript Support"></a>Extended TypeScript Support</h3><p>Dojo now supports TypeScript versions from 2.6.x to 3.2.x, please see our <a href="https://github.com/dojo/framework#typescript-and-dojo-compatibility-matrix" target="_blank" rel="noopener">TypeScript and Dojo compatibility matrix</a> for more information.</p><h3 id="Update-to-Dojo-5-0-0"><a href="#Update-to-Dojo-5-0-0" class="headerlink" title="Update to Dojo 5.0.0"></a>Update to Dojo 5.0.0</h3><p>Visit the <a href="https://github.com/dojo/framework/blob/master/docs/V5-Migration-Guide.md" target="_blank" rel="noopener">Dojo version 5 migration guide</a> for detailed information and guidance on updating your application. Updgrading from 4.0.x to 5.0.0 should require running one command for most users.</p><p>After installing the latest version of the <code>@dojo/cli-upgrade-app</code>, run the following command:</p><pre class=" language-sh"><code class="language-sh">dojo upgrade app</code></pre><h3 id="Beyond-version-5"><a href="#Beyond-version-5" class="headerlink" title="Beyond version 5"></a>Beyond version 5</h3><p>We are working on a detailed roadmap for the next major release, however, in the meantime check out our <a href="https://github.com/dojo/meta/wiki/Roadmap#future-ideas" target="_blank" rel="noopener">future roadmap</a> for ideas we want to investigate over the next 12 months.</p><h3 id="Support"><a href="#Support" class="headerlink" title="Support"></a>Support</h3><p>See the <a href="https://github.com/dojo/framework/releases/tag/v5.0.0" target="_blank" rel="noopener">release notes</a> for more details on version 5 of Dojo.</p><p>Love what we’re doing or having a problem? We ❤️ our community. Reach out to us on <a href="https://discord.gg/M7yRngE" target="_blank" rel="noopener">Discord</a>, check out our <a href="https://dojo.io/community/">roadmap</a> and see where we are heading with Dojo,, and try out the new <a href="https://codesandbox.io/s/github/dojo/dojo-codesandbox-template" target="_blank" rel="noopener">Dojo on CodeSandbox</a>. We look forward to your feedback.</p>]]></content>
    
    <summary type="html">
    
      &lt;h2 id=&quot;Dojo-version-5-has-arrived&quot;&gt;&lt;a href=&quot;#Dojo-version-5-has-arrived&quot; class=&quot;headerlink&quot; title=&quot;Dojo version 5 has arrived!&quot;&gt;&lt;/a&gt;Dojo version 5 has arrived!&lt;/h2&gt;&lt;p&gt;We’re excited to announce the 5.0.0 release of Dojo. This version builds on previous releases with a vast array of bug fixes and improvements throughout the framework.&lt;/p&gt;
&lt;img src=&quot;/blog/2019/01/29/2019-01-29-Version-5-Dojo/featured.png&quot; title=&quot;feature-full&quot;&gt;
    
    </summary>
    
    
  </entry>
  
  <entry>
    <title>Announcing Version 4 of Dojo</title>
    <link href="https://dojo.io/blog/2018/10/15/2018-10-15-Version-4-Dojo/"/>
    <id>https://dojo.io/blog/2018/10/15/2018-10-15-Version-4-Dojo/</id>
    <published>2018-10-15T12:00:00.000Z</published>
    <updated>2019-03-22T14:47:35.838Z</updated>
    
    <content type="html"><![CDATA[<h2 id="Being-a-Better-Dojo"><a href="#Being-a-Better-Dojo" class="headerlink" title="Being a Better Dojo"></a>Being a Better Dojo</h2><p>Developer ergonomics, efficient source code, consistent and flexible architecture, interoperability and alignment with modern standards, and strong community support are fundamental reasons for choosing a framework. We’re constantly looking for ways to improve Dojo and provide the community with the best possible modern framework.</p><img src="/blog/2018/10/15/2018-10-15-Version-4-Dojo/featured.png" title="feature-full"><a id="more"></a><h2 id="Dojo-CLI-Tooling"><a href="#Dojo-CLI-Tooling" class="headerlink" title="Dojo CLI Tooling"></a>Dojo CLI Tooling</h2><p>The main focus of version 4 of Dojo is improving application optimization and analyzing, focusing on tooling that can enable these features by default. Separating a Dojo application into bundles (often referred to as code splitting) has been possible since the initial Dojo release. Although this did not require you to change your source code, it did require adding some configuration to specify how your application should be bundled. We wanted to do better by default and in version 4, the <a href="https://github.com/dojo/cli-build-app#code-splitting-by-route" target="_blank" rel="noopener">Dojo build tooling will automatically split an application based on its top-level routes</a>!</p><p>The application template used by <code>cli-build-app</code> provides this functionality out of the box. In addition to this a bundle analyzer is automatically generated when running a build in production mode, providing even more insight into you bundles.</p><p><img src="./bundleAnalyzer.png" alt="Dojo Bundle Analyzer" height="500" width="334"></p><p>This is provided by the template app generated with <code>@dojo/cli-create-app</code>.</p><p>Even with version 4 of Dojo being a step in the right direction, there’s much more we can and are planning to do including critical path bundling, bundle size analysis and budgets, lighthouse reports, and more.</p><p>Enabling you to create applications that perform better for your end users is very important to us, however, we also want to ensure that the development experience remains streamlined. As a result, we’ve made a number of changes to our build tooling to enable features such as HTTPS and proxy configuration support.</p><p>Other CLI improvements include the <a href="https://github.com/dojo/cli-build-app#externals-object" target="_blank" rel="noopener">support for externals</a>, allowing non-modular libraries or standalone applications that cannot be bundled normally to be included in a Dojo application.</p><p>The automatic parsing, hashing and bundling of resources from index.html, and inclusion of assets from the catch-all <code>assets</code> directory. These changes support the creation of more complex applications.</p><h2 id="Performance-First"><a href="#Performance-First" class="headerlink" title="Performance First"></a>Performance First</h2><p>To keep applications as small as possible, the CLI follows a few key principles:<br>Evergreen builds by default, with support for older browsers back to IE11 by explicit opt-in. This reverses behavior in the past of supporting all browsers by default, so that newer browsers get smaller and faster applications as they add support for features natively.</p><p>As part of our support for Progressive Web Apps (PWA), we optimize for the the <a href="https://developers.google.com/web/fundamentals/performance/prpl-pattern/" target="_blank" rel="noopener">PRPL pattern</a>:</p><ul><li>Push critical resources for the initial URL route.</li><li>Render initial route.</li><li>Pre-cache remaining routes.</li><li>Lazy-load and create remaining routes on demand.</li></ul><p>The <a href="https://dojo-2-hnpwa-d668d.firebaseapp.com/" target="_blank" rel="noopener">HNPWA reference Dojo example</a> is less than 20KB gzipped and is among the fastest performance of any client-side JavaScript application framework!</p><p>The CLI tooling has three main pathways for the creation and building of apps, themes, and widgets.</p><h2 id="Dojo-Framework"><a href="#Dojo-Framework" class="headerlink" title="Dojo Framework"></a>Dojo Framework</h2><p>It has been a busy release for <code>@dojo/framework</code> also, which adds a range of new features plus a few changes to existing concepts and patterns. The focus has been cleaning up the existing codebase and creating better ergonomics for a few concepts.</p><p>The Virtual DOM engine has been redesigned and rewritten from the ground up. This was a large undertaking which identified and resolved a number of bugs in the old engine, enabled a number of new features, improved rendering performance and finally reduced the overall size of the framework!</p><p>The are a few improvements when using the <code>w()</code> and <code>v()</code> pragmas, including better composition of nodes, rendering a dynamic import directly using <code>w()</code> and enabling the use of <code>meta</code> for nodes that are passed as children to a widget.</p><p>The routing system within the framework received an improved route matching algorithm for this release. Additionally a <a href="https://github.com/dojo/framework/pull/63" target="_blank" rel="noopener">more flexible <code>Outlet</code></a> works via a render property. The <code>ActiveLink</code> widget also applies classes when an item is considered active.</p><p>dojo/stores adds middleware support for Local storage in this release, and a new <a href="https://github.com/dojo/framework/issues/76" target="_blank" rel="noopener"><code>StoreProvider</code></a> eases the injection of application state.</p><h2 id="Widgets"><a href="#Widgets" class="headerlink" title="Widgets"></a>Widgets</h2><p>With the concentration on the CLI tooling and <code>@dojo/framework</code> itself, it has not left much time for <code>@dojo/widgets</code>. But…. yes but, as part of Dojo 4 there is a new data grid available, it’s currently very basic in terms of features, but over the next few months we will be working on improving, with a focus on feedback from our users. This feedback will help us decide which features to work on next.</p><p>If our <code>@dojo/widgets</code> grid does not work for you yet, a new dgrid wrapper has been added to <code>@dojo/interop</code>. The wrapper can be used in combination with the CLI build externals to support using dgrid with Dojo version 4 and includes support with some of the most populate dgrid mixins.</p><p>The existing widgets received many accessibility, keyboard, and focus refinements.</p><h2 id="Migration"><a href="#Migration" class="headerlink" title="Migration"></a>Migration</h2><p>All of the breaking changes in Dojo 4, were carefully considered beforehand as we understand the impact that they can have on your decision to upgrade. To assist with the transition we have updated the CLI upgrade command, which will automatically upgrade your Dojo dependencies, upgrade your application code where possible and highlight areas in the application that require manual intervention. For more information on what has changed in Dojo 4, please see the <a href="https://github.com/dojo/framework/blob/master/docs/V4-Migration-Guide.md" target="_blank" rel="noopener">migration guide</a>.</p><p>TypeScript forwards-compatibility was updated from 2.7 to 3.0.</p><h2 id="Support"><a href="#Support" class="headerlink" title="Support"></a>Support</h2><p>See the <a href="https://github.com/dojo/framework/releases/tag/v4.0.0" target="_blank" rel="noopener">release notes</a> for more details on version 4.0.0 of Dojo!</p><p>Love what we’re doing or having a problem? We ❤️ our community. Reach out to us on <a href="https://discord.gg/M7yRngE" target="_blank" rel="noopener">Discord</a>, check out our <a href="https://dojo.io/community/">roadmap</a> and see where Dojo is headed, and try out the new Dojo on <a href="https://codesandbox.io/s/github/dojo/dojo-codesandbox-template" target="_blank" rel="noopener">CodeSandbox</a>. We look forward to your feedback!</p>]]></content>
    
    <summary type="html">
    
      &lt;h2 id=&quot;Being-a-Better-Dojo&quot;&gt;&lt;a href=&quot;#Being-a-Better-Dojo&quot; class=&quot;headerlink&quot; title=&quot;Being a Better Dojo&quot;&gt;&lt;/a&gt;Being a Better Dojo&lt;/h2&gt;&lt;p&gt;Developer ergonomics, efficient source code, consistent and flexible architecture, interoperability and alignment with modern standards, and strong community support are fundamental reasons for choosing a framework. We’re constantly looking for ways to improve Dojo and provide the community with the best possible modern framework.&lt;/p&gt;
&lt;img src=&quot;/blog/2018/10/15/2018-10-15-Version-4-Dojo/featured.png&quot; title=&quot;feature-full&quot;&gt;
    
    </summary>
    
    
  </entry>
  
  <entry>
    <title>Building Progressive Web Apps With Dojo</title>
    <link href="https://dojo.io/blog/2018/09/13/2018-09-13-Building-PWA-Dojo/"/>
    <id>https://dojo.io/blog/2018/09/13/2018-09-13-Building-PWA-Dojo/</id>
    <published>2018-09-13T08:00:00.000Z</published>
    <updated>2019-03-22T14:47:35.838Z</updated>
    
    <content type="html"><![CDATA[<img src="/blog/2018/09/13/2018-09-13-Building-PWA-Dojo/featured.jpg" title="feature-full"><p>Within the past few years, new features get added to browsers at breakneck speed. The time between proposal and standardization has dropped from years to months, and browser vendors are eager to maintain similar turnaround times for implementing new standards. In many ways, it has never been a better time to be a web developer.</p><p>Networks, on the other hand, are neither universally reliable nor universally performant. As developers, we have a responsibility to ensure our users do not suffer from our technical decisions. One step we can take against this is by delivering our application using Progressive Web Applications (PWA) technologies which are resilient to network issues.</p><a id="more"></a><p>At its most basic definition, “Progressive Web  App” (or “PWA”) is an umbrella term for a web application that applies a set of techniques and technologies to mimic the responsiveness and feel of a native application. Since progressive web apps at their heart are regular web pages, they run in the browser and bypass any native app store.</p><p>Network resilience that we see in native apps is provided in PWAs by a technology called Service Workers. A Service Worker is a worker that sits as a proxy between the page and the server. They can intercept requests and cache results. We also get the ‘install to homescreen’ experience courtesy of what is called the web manifest file (manifest.json). This manifest instructs the browser that the page is a PWA that is installable and provides things like application colors and icons.</p><p>Dojo makes it easy to deliver an app-like, offline-first experience to your users using only configuration settings supplied in the application’s <code>.dojorc</code>. Suppose we are developing an application for rock climbers that delivers information on climbing routes within the U.S. National Parks. The application allows users to view and rate routes, add their routes, and track those routes they have climbed. Further, the application contains an admin area and a user preferences screen. Finally, since there is a good chance that users do not get reliable wireless access while climbing, we need to ensure they can view route details offline.</p><p>Before delving into PWA features, we lay out a basic <code>.dojorc</code>  that instructs the Dojo build to separate the user preference and admin areas into separate bundles that get loaded on-demand.</p><pre class=" language-json"><code class="language-json"><span class="token punctuation">{</span>    <span class="token property">"build-app"</span><span class="token operator">:</span> <span class="token punctuation">{</span>        <span class="token property">"bundles"</span><span class="token operator">:</span> <span class="token punctuation">{</span>            <span class="token property">"settings"</span><span class="token operator">:</span> <span class="token punctuation">[</span> ... <span class="token punctuation">]</span><span class="token punctuation">,</span>            <span class="token property">"admin"</span><span class="token operator">:</span> <span class="token punctuation">[</span> ... <span class="token punctuation">]</span>        <span class="token punctuation">}</span>    <span class="token punctuation">}</span><span class="token punctuation">}</span></code></pre><h2 id="Adding-a-Web-App-Manifest"><a href="#Adding-a-Web-App-Manifest" class="headerlink" title="Adding a Web App Manifest"></a>Adding a Web App Manifest</h2><p>The next step is to add a <a href="https://developer.mozilla.org/en-US/docs/Web/Manifest" target="_blank" rel="noopener">web app manifest</a> that provides information about the application like a name and available icons to display on the users’ home screens. The manifest for our application contains a set of icons that can be displayed on the home screen, the name to display alongside the icon, a brief description, and the background color to display while the app is loading:</p><pre class=" language-json"><code class="language-json"><span class="token punctuation">{</span>    <span class="token property">"build-app"</span><span class="token operator">:</span> <span class="token punctuation">{</span>        <span class="token property">"bundles"</span><span class="token operator">:</span> <span class="token punctuation">{</span> ... <span class="token punctuation">}</span><span class="token punctuation">,</span>        <span class="token property">"pwa"</span><span class="token operator">:</span> <span class="token punctuation">{</span>            <span class="token property">"manifest"</span><span class="token operator">:</span> <span class="token punctuation">{</span>                <span class="token property">"background_color"</span><span class="token operator">:</span> <span class="token string">"#212329"</span><span class="token punctuation">,</span>                <span class="token property">"name"</span><span class="token operator">:</span> <span class="token string">"National Parks Climbing"</span><span class="token punctuation">,</span>                <span class="token property">"short_name"</span><span class="token operator">:</span> <span class="token string">"Climbing"</span><span class="token punctuation">,</span>                <span class="token property">"description"</span><span class="token operator">:</span> <span class="token string">"A guide to climbing routes in the U.S. National Parks"</span><span class="token punctuation">,</span>                <span class="token property">"icons"</span><span class="token operator">:</span> <span class="token punctuation">[</span>                    <span class="token punctuation">{</span> <span class="token property">"src"</span><span class="token operator">:</span> <span class="token string">"./icon-48x48.png"</span><span class="token punctuation">,</span> <span class="token property">"sizes"</span><span class="token operator">:</span> <span class="token string">"48x48"</span><span class="token punctuation">,</span> <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"image/png"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>                    <span class="token punctuation">{</span> <span class="token property">"src"</span><span class="token operator">:</span> <span class="token string">"./icon-96x96.png"</span><span class="token punctuation">,</span> <span class="token property">"sizes"</span><span class="token operator">:</span> <span class="token string">"96x96"</span><span class="token punctuation">,</span> <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"image/png"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>                    <span class="token punctuation">{</span> <span class="token property">"src"</span><span class="token operator">:</span> <span class="token string">"./icon-256x256.png"</span><span class="token punctuation">,</span> <span class="token property">"sizes"</span><span class="token operator">:</span> <span class="token string">"256x256"</span><span class="token punctuation">,</span> <span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"image/png"</span> <span class="token punctuation">}</span>                <span class="token punctuation">]</span>            <span class="token punctuation">}</span>        <span class="token punctuation">}</span>    <span class="token punctuation">}</span><span class="token punctuation">}</span></code></pre><p>With the above configuration, the Dojo build generates a JSON file and inline it within the <code>&lt;head&gt;</code> tag of the <code>index.html</code>. Since iOS devices do not currently use PWA manifests to read app data, <a href="https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html" target="_blank" rel="noopener">iOS-specific tags</a> get inlined as well. When the user adds the app to their home screen, either the name or the short name gets displayed (depending upon available space), along with one of the provided icons. We provide multiple sizes so that the user’s device can choose the most appropriate one to display.</p><blockquote><p>If you are as internationalization-minded as we are, you should notice that there is no mechanism to localize the web app manifest. So your app uses the same icon, name, description, etc., regardless of the user’s preferred language. As a result, you need a server-side solution to localize your manifest.</p></blockquote><p>Our application can now get installed on users home screens like a native app, but we still need a way to display content even when offline. That is where service workers come into play.</p><h2 id="Adding-a-Service-Worker"><a href="#Adding-a-Service-Worker" class="headerlink" title="Adding a Service Worker"></a>Adding a Service Worker</h2><p>A service worker is essentially a proxy between the network and the application. It is a single JavaScript file that runs in a separate thread from the application itself, and it can intercept and modify network requests, cache responses, and control how the browser responds to those requests.</p><p>As with the PWA manifest, the application’s service worker gets generated entirely from options specified in the <code>.dojorc</code>, this time housed beneath the <a href="https://github.com/dojo/cli-build-app#pwaserviceworker-object" target="_blank" rel="noopener"><code>pwa.serviceWorker</code></a> namespace. When Dojo builds the application, it generates both the service worker file and ensures it is registered when the application starts. At this point, the service worker gets registered, but by default, it does not control the application until the next refresh. This default may get overridden by setting <code>&quot;clientsClaim&quot;: true</code> , which causes the service worker to take control immediately. That said, in most cases, this override is not necessary, and we recommend not setting it until you have proven you need it.</p><p>Once the service worker gets successfully installed, it can begin intercepting requests and caching responses. There are two types of caches involved: the precache that is populated when the service worker gets installed with the static assets required to render the application shell and the runtime caches that gets populated with responses from network requests sent while using the application. By default, all assets in the build pipeline get added to the precache, but this can be limited to a subset of bundles. Alternatively, specific bundles may deliberately get excluded from the precache as well.</p><p>Since we are only concerned with making climbing routes available offline, we exclude the admin and preferences bundles from the precache:</p><pre class=" language-json"><code class="language-json"><span class="token punctuation">{</span>    <span class="token property">"build-app"</span><span class="token operator">:</span> <span class="token punctuation">{</span>        "bundles<span class="token operator">:</span> <span class="token punctuation">{</span> ... <span class="token punctuation">}</span><span class="token punctuation">,</span>        <span class="token property">"pwa"</span><span class="token operator">:</span> <span class="token punctuation">{</span>            <span class="token property">"manifest"</span><span class="token operator">:</span> <span class="token punctuation">{</span> ... <span class="token punctuation">}</span><span class="token punctuation">,</span>            <span class="token property">"serviceWorker"</span><span class="token operator">:</span> <span class="token punctuation">{</span>                <span class="token property">"excludeBundles"</span><span class="token operator">:</span> <span class="token punctuation">[</span> <span class="token string">"admin"</span><span class="token punctuation">,</span> <span class="token string">"settings"</span> <span class="token punctuation">]</span>            <span class="token punctuation">}</span>        <span class="token punctuation">}</span>    <span class="token punctuation">}</span><span class="token punctuation">}</span></code></pre><p>While setting the precache is rather straightforward, controlling the runtime caches requires a little consideration. There are four strategies when determining how network requests should get handled:</p><ul><li><code>networkFirst</code> instructs the service worker to attempt to load the resource over the network, falling back to the cache if the network is unavailable.</li><li><code>cacheFirst</code> instructs the service worker to deliver the resource from the cache, sending a network request only when the resource does not exist in the cache.</li><li><code>networkOnly</code> prevents the resource from ever being loaded from the cache.</li><li><code>staleWhileRevalidate</code> loads the resource from the cache while it gets simultaneously fetched over the network. This strategy is useful when a resource is updated frequently, but having the latest version is not crucial to the user experience.</li></ul><p>Choosing the right strategy depends on the type of resource as well as on how the user needs to use that resource. For example, we know that the climbers using our application need the most up-to-date information on unexpected park closures or dangers like mountain lion sightings or lightning storms. We also know they want accurate data on route locations, access, difficulty levels, and that they also want any maps that depict those routes. At the same time, we recognize that loading maps or images over a poor network connection are not an option, so we want to limit any network requests to fetching the lower-cost text descriptions.</p><p>Armed with that knowledge, we can add sensible route handling to our config:</p><pre class=" language-json"><code class="language-json"><span class="token punctuation">{</span>    <span class="token property">"build-app"</span><span class="token operator">:</span> <span class="token punctuation">{</span>        <span class="token property">"bundles"</span><span class="token operator">:</span> <span class="token punctuation">{</span> ... <span class="token punctuation">}</span><span class="token punctuation">,</span>        <span class="token property">"pwa"</span><span class="token operator">:</span> <span class="token punctuation">{</span>            "manifest<span class="token operator">:</span> <span class="token punctuation">{</span> ... <span class="token punctuation">}</span><span class="token punctuation">,</span>            <span class="token property">"serviceWorker"</span><span class="token operator">:</span> <span class="token punctuation">{</span>                <span class="token property">"excludeBundles"</span><span class="token operator">:</span> <span class="token punctuation">[</span> ... <span class="token punctuation">]</span><span class="token punctuation">,</span>                <span class="token property">"routes"</span><span class="token operator">:</span> <span class="token punctuation">[</span>                    <span class="token punctuation">{</span>                        <span class="token property">"urlPattern"</span><span class="token operator">:</span> <span class="token string">"\/parks"</span><span class="token punctuation">,</span>                        <span class="token property">"strategy"</span><span class="token operator">:</span> <span class="token string">"networkFirst"</span><span class="token punctuation">,</span>                        <span class="token property">"expiration"</span><span class="token operator">:</span> <span class="token punctuation">{</span>                            <span class="token property">"maxEntries"</span><span class="token operator">:</span> <span class="token number">25</span><span class="token punctuation">,</span>                            <span class="token property">"maxAgeSeconds"</span><span class="token operator">:</span> <span class="token number">604800</span>                        <span class="token punctuation">}</span>                    <span class="token punctuation">}</span><span class="token punctuation">,</span>                    <span class="token punctuation">{</span>                        <span class="token property">"urlPattern"</span><span class="token operator">:</span> <span class="token string">"images\/route-maps"</span><span class="token punctuation">,</span>                        <span class="token property">"strategy"</span><span class="token operator">:</span> <span class="token string">"cacheFirst"</span><span class="token punctuation">,</span>                        <span class="token property">"expiration"</span><span class="token operator">:</span> <span class="token punctuation">{</span>                            <span class="token property">"maxEntries"</span><span class="token operator">:</span> <span class="token number">25</span><span class="token punctuation">,</span>                            <span class="token property">"maxAgeSeconds"</span><span class="token operator">:</span> <span class="token number">2592000</span>                        <span class="token punctuation">}</span>                    <span class="token punctuation">}</span>                <span class="token punctuation">]</span>            <span class="token punctuation">}</span>        <span class="token punctuation">}</span>    <span class="token punctuation">}</span><span class="token punctuation">}</span></code></pre><p>Let’s break this down. Runtime strategies get specified at the route level under the <code>pwa.serviceWorker.routes</code> array. Each route includes a <code>”urlPattern”</code> that is converted internally to a regular expression and matches specific request URLs. Since users need to have the latest text information on parks and routes, we use the <code>networkFirst</code> strategy to ensure that users can get the latest data whenever the network is available. We then limit that cache to 25 pages, each cached for seven days before being removed. Finally, we instruct the service worker to load the route maps from the cache whenever possible and limit that cache to 25 maps with each expiring thirty days out. Of course, in a real application, you want to adjust the expirations according to what users access and how often.</p><p>With that, you are ready to begin upgrading your Dojo application to a PWA! There are of course several additional configuration options for both the <a href="https://developer.mozilla.org/en-US/docs/Web/Manifest" target="_blank" rel="noopener">manifest</a> and the <a href="https://github.com/dojo/webpack-contrib/#service-worker-plugin" target="_blank" rel="noopener">service worker</a>, and you can even provide your service worker if the generated service worker does not meet your needs. Finally, if you want to get further background knowledge on  PWAs, both Jake Archibald’s <a href="https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle" target="_blank" rel="noopener">The Service Worker Lifecycle</a> and MDN’s <a href="https://developer.mozilla.org/en-US/Apps/Progressive/Introduction" target="_blank" rel="noopener">Introduction to progressive web apps</a> are excellent places to start.</p>]]></content>
    
    <summary type="html">
    
      &lt;img src=&quot;/blog/2018/09/13/2018-09-13-Building-PWA-Dojo/featured.jpg&quot; title=&quot;feature-full&quot;&gt;
&lt;p&gt;Within the past few years, new features get added to browsers at breakneck speed. The time between proposal and standardization has dropped from years to months, and browser vendors are eager to maintain similar turnaround times for implementing new standards. In many ways, it has never been a better time to be a web developer.&lt;/p&gt;
&lt;p&gt;Networks, on the other hand, are neither universally reliable nor universally performant. As developers, we have a responsibility to ensure our users do not suffer from our technical decisions. One step we can take against this is by delivering our application using Progressive Web Applications (PWA) technologies which are resilient to network issues.&lt;/p&gt;
    
    </summary>
    
    
  </entry>
  
  <entry>
    <title>Dojo Version 3.0</title>
    <link href="https://dojo.io/blog/2018/07/27/2018-07-27-Dojo-version-3-release/"/>
    <id>https://dojo.io/blog/2018/07/27/2018-07-27-Dojo-version-3-release/</id>
    <published>2018-07-27T08:00:00.000Z</published>
    <updated>2019-03-22T14:47:35.834Z</updated>
    
    <content type="html"><![CDATA[<img src="/blog/2018/07/27/2018-07-27-Dojo-version-3-release/featured.jpg" title="feature-full"><h2 id="Building-on-Success"><a href="#Building-on-Success" class="headerlink" title="Building on Success"></a>Building on Success</h2><p>Some changes are happening with Dojo. As the project continues to stabilize around a set of modules and APIs, we are continually evaluating feedback from the community as well as our processes.</p><a id="more"></a><p>First things first, when we released the next generation of Dojo, we wanted to strongly disambiguate between the legacy Dojo toolkit by naming it Dojo 2. Now that we have released Dojo 2 and are moving on with further releases we are going to drop the version number, and from now on we refer to it as Dojo.</p><p>Also of note during the Dojo 2 cycle, we identified that pain points were going to become bottlenecks and affect the momentum of the project. Central to these issues was the complexity of managing the eight projects that make up the basis of the dojo framework: core, has, i18n, routing, shim, stores, test-extras, and widget-core. We found that managing these projects individually required a great deal of coordination when publishing and working with their inter-dependencies.</p><h2 id="So-We-Made-a-Change"><a href="#So-We-Made-a-Change" class="headerlink" title="So We Made a Change"></a>So We Made a Change</h2><p>Now that the core Dojo packages are stable, we decided to consolidate these packages into a single one with <a href="https://github.com/dojo/framework" target="_blank" rel="noopener">@dojo/framework</a>. In doing this, we have hopefully improved the Dojo project in a few ways:</p><ul><li>End users no longer have to worry about the current working set of package versions, there is just one package and version.</li><li><a href="https://github.com/dojo/framework/issues" target="_blank" rel="noopener">A single place to raise issues and feature requests</a>.</li><li>A stronger focus on how dojo as a framework fits together to provide the best possible experience, over the old siloed packages approach.</li><li>Simplifying our management and release process allowing us to iterate quicker</li></ul><h2 id="Migration"><a href="#Migration" class="headerlink" title="Migration"></a>Migration</h2><p>The new @dojo/cli-upgrade-app package aims to provide users with a friction-free upgrade path between major Dojo versions starting at 2.x. For more information see the <a href="https://github.com/dojo/framework/blob/55042dfbb8b7c9b46012be3351fd7fa064e0fa5a/docs/V3-Migration-Guide.md" target="_blank" rel="noopener">v3 migration guide</a>.</p><h2 id="Support"><a href="#Support" class="headerlink" title="Support"></a>Support</h2><p>In other news, our official chat support is now on Discord, so head on over to the <a href="https://discord.gg/M7yRngE" target="_blank" rel="noopener">Dojo Discord channel</a> and also check out updated examples on <a href="https://codesandbox.io/s/github/dojo/dojo-codesandbox-template" target="_blank" rel="noopener">CodeSandbox</a>.</p>]]></content>
    
    <summary type="html">
    
      &lt;img src=&quot;/blog/2018/07/27/2018-07-27-Dojo-version-3-release/featured.jpg&quot; title=&quot;feature-full&quot;&gt;
&lt;h2 id=&quot;Building-on-Success&quot;&gt;&lt;a href=&quot;#Building-on-Success&quot; class=&quot;headerlink&quot; title=&quot;Building on Success&quot;&gt;&lt;/a&gt;Building on Success&lt;/h2&gt;&lt;p&gt;Some changes are happening with Dojo. As the project continues to stabilize around a set of modules and APIs, we are continually evaluating feedback from the community as well as our processes.&lt;/p&gt;
    
    </summary>
    
    
  </entry>
  
  <entry>
    <title>Introducing Dojo 2.0!</title>
    <link href="https://dojo.io/blog/2018/05/02/2018-05-02-Dojo2-0-0-release/"/>
    <id>https://dojo.io/blog/2018/05/02/2018-05-02-Dojo2-0-0-release/</id>
    <published>2018-05-02T17:00:00.000Z</published>
    <updated>2019-03-22T14:47:35.834Z</updated>
    
    <content type="html"><![CDATA[<h2 id="Intro"><a href="#Intro" class="headerlink" title="Intro"></a>Intro</h2><p>As the earliest, most comprehensive JavaScript framework, the Dojo Toolkit offered up intelligent building blocks for serious web developers. For example, Dojo’s very early work on deferreds and async patterns, widgets, modules, i18n, and a11y led to the standardization of promises, fetch, web components, ES modules and other best practices and mainstays of modern web development.  Dojo was the first open source JavaScript framework that treated JavaScript and the browser as a platform for building robust software applications. Its focus on pushing the limits of the open web with diligent consistency means that applications authored in 2007 with Dojo still work today!</p><img src="/blog/2018/05/02/2018-05-02-Dojo2-0-0-release/featured.jpg" title="feature-full"><a id="more"></a><p>The web has come a long way, and with many Dojo solutions finding their way into the browser (success!) as well as inspiring even better tools, our team’s focus has moved beyond providing the building blocks and onto helping developers put it all together.</p><h2 id="Dojo-2-0"><a href="#Dojo-2-0" class="headerlink" title="Dojo 2.0"></a>Dojo 2.0</h2><p>Dojo 2 dedicates itself to creating an incredibly ergonomic and efficient way to build modern web apps.</p><p>Leveraging ES2015+, TypeScript, and many modern and emerging standards, best practices, and quality open source dependencies, Dojo 2 focuses on interoperability preventing you from being locked into the specifics of any one framework. Dojo 2 gives you the flexibility to reap the benefits of choosing your preferred micro-libraries to create a custom framework but most notably gives you a robust set of out-of-the-box options, so you don’t need to decide everything up front before you can be productive.</p><h2 id="Let’s-hear-more-about-what’s-Out-of-the-Box"><a href="#Let’s-hear-more-about-what’s-Out-of-the-Box" class="headerlink" title="Let’s hear more about what’s Out-of-the-Box"></a>Let’s hear more about what’s Out-of-the-Box</h2><p>Dojo 2 wants developers to be productive as quickly as possible – like in under a minute! With an eye on creating the best out-of-the-box experience, Dojo 2 makes it easy to get started.  Some of these out-of-the-box features include:</p><ul><li>Reactive, Virtual DOM-based widget system including meta providers to preserve reactivity for things like animations, focus, and resize events and an intuitive CSS.Next-based theming system</li><li>Streamlined support for Web Components including full support for importing and exporting Custom Elements for use within Dojo 2 and other frameworks</li><li>Application-level declarative routing system focused on patterns for building applications from UI widgets</li><li>A predictable, consistent state container for JavaScript applications, drawing inspiration from Redux and Flux architectures, with built-in support for common patterns, asynchronous behaviors, and undo.</li><li>CLI tooling to create optimized applications with code splitting and build time rendering provided automatically</li><li>An efficient test harness for efficiently testing your apps and widgets</li></ul><p>To be a modern framework, we want to make it easy to leverage features like web components, and emerging web standards such as Intersection Observers, Resize Observers and Web Animations while preserving an efficient, reactive architecture. Consistently aligning with modern standards is our best option for extending the longevity of applications you create.</p><h2 id="For-the-enterprise"><a href="#For-the-enterprise" class="headerlink" title="For the enterprise"></a>For the enterprise</h2><p>With a long history of building mission-critical applications for Fortune 500 companies, Dojo 2 engineers know the pain felt by enterprise development organizations. Dedicated to solutions that promote scalability and complex application development, Dojo 2 adds to its out-of-the-box deliverables with features like accessibility and internationalization - because these should be part of the plan and not a clunky extension or costly afterthought.</p><p>An efficient and intuitive framework is about doing a million things right in a consistent manner whenever possible and leveraging ES2015+, TypeScript, and other patterns allow Dojo 2 to deliver a consistently ergonomic approach.</p><h2 id="See-Dojo-2"><a href="#See-Dojo-2" class="headerlink" title="See Dojo 2"></a>See Dojo 2</h2><p>Dojo 2 does not sacrifice performance to deliver solid ergonomics. See the <a href="https://medium.freecodecamp.org/a-real-world-comparison-of-front-end-frameworks-with-benchmarks-2018-update-e5760fb4a962" target="_blank" rel="noopener">RealWorld comparison</a> to see how Dojo 2 measures up!</p><p>View the <a href="https://dojo.github.io/examples/" target="_blank" rel="noopener">Dojo 2 reference examples</a> including RealWorld, HNPWA, and ToDoMVC, and <a href="https://github.com/dojo/examples/" target="_blank" rel="noopener">check out the source code</a>. To learn more about using Dojo 2, start with the <a href="https://dojo.io/tutorials/">Dojo 2 tutorial series</a>.</p><h2 id="Dojo-2-promises-to-do-community-right-and-do-right-by-its-community"><a href="#Dojo-2-promises-to-do-community-right-and-do-right-by-its-community" class="headerlink" title="Dojo 2 promises to do community right and do right by its community"></a>Dojo 2 promises to do community right and do right by its community</h2><p>The Dojo 2 team is excited about the opportunity to build a healthy, diverse and inclusive community to ensure that we are creating an intuitive and flexible framework that meets the needs of the enterprise developer.</p><p>We look forward to your ideas, input, and feedback to make Dojo 2 useful for the greater JavaScript and TypeScript community and we welcome your contributions!<br>You can participate in our community on <a href="https://gitter.im/dojo/dojo2" target="_blank" rel="noopener">Gitter</a>, share information on <a href="https://twitter.com/dojo/" target="_blank" rel="noopener">Twitter</a>.</p>]]></content>
    
    <summary type="html">
    
      &lt;h2 id=&quot;Intro&quot;&gt;&lt;a href=&quot;#Intro&quot; class=&quot;headerlink&quot; title=&quot;Intro&quot;&gt;&lt;/a&gt;Intro&lt;/h2&gt;&lt;p&gt;As the earliest, most comprehensive JavaScript framework, the Dojo Toolkit offered up intelligent building blocks for serious web developers. For example, Dojo’s very early work on deferreds and async patterns, widgets, modules, i18n, and a11y led to the standardization of promises, fetch, web components, ES modules and other best practices and mainstays of modern web development.  Dojo was the first open source JavaScript framework that treated JavaScript and the browser as a platform for building robust software applications. Its focus on pushing the limits of the open web with diligent consistency means that applications authored in 2007 with Dojo still work today!&lt;/p&gt;
&lt;img src=&quot;/blog/2018/05/02/2018-05-02-Dojo2-0-0-release/featured.jpg&quot; title=&quot;feature-full&quot;&gt;
    
    </summary>
    
    
  </entry>
  
  <entry>
    <title>Dojo 2 Release Candidate 1 is now available!</title>
    <link href="https://dojo.io/blog/2018/03/11/2018-03-11-Dojo-2-rc1/"/>
    <id>https://dojo.io/blog/2018/03/11/2018-03-11-Dojo-2-rc1/</id>
    <published>2018-03-11T09:00:00.000Z</published>
    <updated>2019-03-22T14:47:35.830Z</updated>
    
    <content type="html"><![CDATA[<p>We’re pleased to announce Dojo 2 release candidate 1 is now available!</p><p>We first started brainstorming ideas for Dojo 2 back in 2010. While development of Dojo 2 did not take quite as long as Diablo 3 or Duke Nukem Forever, we followed a very deliberate journey. Conceived initially as a modern clean-up for Dojo 1.x, with the introduction of ES6, TypeScript, web components, and an array of other features, we realized we wanted to take a different path and create an approach to building modern apps that would not just be a slight clean-up of Dojo 1 or a clone of other current frameworks, but a productive and efficient development experience and front-end architecture.</p><img src="/blog/2018/03/11/2018-03-11-Dojo-2-rc1/featured.png" title="feature-full"><a id="more"></a><p>The result of these years of rewriting and rethinking is something we believe offers a compelling way to build modern applications with TypeScript, leveraging a dizzying array of modern standards and best practices including but not limited to ES2015+, TypeScript, custom elements (web components), Progressive Web Apps (PWA), reactive virtual DOM, Intersection Observers, routing, accessibility (a11y), internationalization (i18n), CSS modules, data stores, and much more.</p><p>When Dojo began in 2004, there was no significant JavaScript ecosystem, and the standards process was not evolving rapidly. Much has changed in 14 years!</p><p>As such, if a viable foundational approach exists that we can leverage or extend beyond the core of Dojo 2, we will choose this route rather than creating our own. By leveraging tools like webpack for building and optimizations, various shims for custom elements and Intersection Observers, Globalize and cldr.js for internationalization and more. On top of this foundation, we have built a reliable and consistent out of the box approach making it easy to get started building applications. Dojo 2 does not require each developer to make every architectural choice up front, but still provides easy ways to override our suggested approach when you prefer an alternative.</p><p>There are plenty of <a href="https://www.sitepen.com/blog/2017/06/13/if-we-chose-our-javascript-framework-like-we-chose-our-music/" target="_blank" rel="noopener">articles comparing frameworks</a>, but needless to say, we took a long look at everything else because we want Dojo 2 to be part of the ecosystem rather than its own silo. By leveraging ES modules, TypeScript interfaces, and custom elements, we provide a robust level of interoperability with other frameworks and libraries.</p><p>So what are Dojo’s primary focus and advantages? It is an ergonomic way to build reactive enterprise web apps with TypeScript and numerous modern web standards and best practices, with an easy to use widget system and widget library, and other vital architectural components including routing, data stores, and much more.</p><h2 id="Author-widgets-with-dojo-widget-core"><a href="#Author-widgets-with-dojo-widget-core" class="headerlink" title="Author widgets with @dojo/widget-core"></a>Author widgets with @dojo/widget-core</h2><p>Dojo has always emphasized the creation of widgets, and Dojo 2’s <a href="http://github.com/dojo/widget-core" target="_blank" rel="noopener"><code>@dojo/widget-core</code></a> package creates an environment providing developers with simple ergonomics allowing them to build robust applications. Leveraging a modern and reactive, uni-directional approach to data binding with a virtual DOM, <code>@dojo/widget-core</code> streamlines the process of creating widgets and apps.</p><p>There are many scenarios where it is challenging to preserve a reactive architecture when working with properties of DOM nodes, so <code>@dojo/widget-core</code> provides meta abstractions to help deal with DOM nodes without breaking the flexibility of a reactive architecture.</p><p><code>@dojo/widget-core</code> embraces the future of the web platform with out of the box meta implementations for Intersection Observers, and Web Animations. With plans to add support for more existing and upcoming living standards from WIGC via meta in the future.</p><p>The following example renders a list with images. By leveraging the Intersection Observer meta, the image <code>src</code> gets added only when the item is in the viewport, which prevents needlessly downloading images until the user scrolls to them.</p><pre class=" language-typescript"><code class="language-typescript"><span class="token keyword">import</span> <span class="token punctuation">{</span> WidgetBase <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@dojo/widget-core/WidgetBase'</span><span class="token punctuation">;</span><span class="token keyword">import</span> <span class="token punctuation">{</span> v<span class="token punctuation">,</span> w <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@dojo/widget-core/d'</span><span class="token punctuation">;</span><span class="token keyword">import</span> <span class="token punctuation">{</span> Intersection <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@dojo/widget-core/meta/Intersection'</span><span class="token punctuation">;</span><span class="token keyword">interface</span> <span class="token class-name">ImageProperties</span> <span class="token punctuation">{</span>    image<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">;</span><span class="token punctuation">}</span><span class="token keyword">class</span> <span class="token class-name">Image</span> <span class="token keyword">extends</span> <span class="token class-name">WidgetBase</span><span class="token operator">&lt;</span>ImageProperties<span class="token operator">></span> <span class="token punctuation">{</span>    <span class="token keyword">protected</span> <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>        <span class="token keyword">const</span> <span class="token punctuation">{</span> image <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>properties<span class="token punctuation">;</span>        <span class="token keyword">const</span> <span class="token punctuation">{</span> isIntersecting <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">meta</span><span class="token punctuation">(</span>Intersection<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token keyword">get</span><span class="token punctuation">(</span><span class="token string">'root'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>        <span class="token keyword">const</span> properties <span class="token operator">=</span> isIntersecting <span class="token operator">?</span> <span class="token punctuation">{</span> key<span class="token punctuation">:</span> <span class="token string">'root'</span><span class="token punctuation">,</span> src<span class="token punctuation">:</span> image <span class="token punctuation">}</span> <span class="token punctuation">:</span> <span class="token punctuation">{</span> key<span class="token punctuation">:</span> <span class="token string">'root'</span> <span class="token punctuation">}</span><span class="token punctuation">;</span>        <span class="token keyword">return</span> <span class="token function">v</span><span class="token punctuation">(</span><span class="token string">'img'</span><span class="token punctuation">,</span> properties<span class="token punctuation">)</span><span class="token punctuation">;</span>    <span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token keyword">interface</span> <span class="token class-name">ImageListProperties</span> <span class="token punctuation">{</span>    images<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token punctuation">}</span><span class="token keyword">export</span> <span class="token keyword">class</span> <span class="token class-name">ImageList</span> <span class="token keyword">extends</span> <span class="token class-name">WidgetBase</span><span class="token operator">&lt;</span>ImageListProperties<span class="token operator">></span> <span class="token punctuation">{</span>    <span class="token keyword">protected</span> <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>        <span class="token keyword">const</span> <span class="token punctuation">{</span> images <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>properties<span class="token punctuation">;</span>        <span class="token keyword">return</span> <span class="token function">v</span><span class="token punctuation">(</span><span class="token string">'div'</span><span class="token punctuation">,</span> images<span class="token punctuation">.</span><span class="token function">map</span><span class="token punctuation">(</span><span class="token punctuation">(</span>image<span class="token punctuation">)</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token punctuation">{</span>            <span class="token keyword">return</span> <span class="token function">v</span><span class="token punctuation">(</span><span class="token string">'ul'</span><span class="token punctuation">,</span> <span class="token punctuation">{</span> key<span class="token punctuation">:</span> image <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">[</span> <span class="token function">w</span><span class="token punctuation">(</span>Image<span class="token punctuation">,</span> <span class="token punctuation">{</span> image <span class="token punctuation">}</span> <span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>        <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>    <span class="token punctuation">}</span><span class="token punctuation">}</span></code></pre><h2 id="Css-Modules-and-css-next"><a href="#Css-Modules-and-css-next" class="headerlink" title="Css Modules and css-next"></a>Css Modules and css-next</h2><p>Dojo 2 uses <a href="https://github.com/css-modules/css-modules" target="_blank" rel="noopener">css modules</a>, out of the box to provide localized class names as standard. This ensures that your styles do not leak out of your widgets and provides type-ahead capability when importing your css files into your widget.</p><p><a href="http://cssnext.io/" target="_blank" rel="noopener">Css-next</a> enables allows Dojo 2 widgets to use cutting edge css syntax and features immediately, such as <code>calc</code>, <code>css-variables</code> and various color functions. These are all compiled down to browser friendly variants at build time so there’s no need for a post processor such as SCSS or Less.</p><h2 id="Dojo-loves-Custom-Elements"><a href="#Dojo-loves-Custom-Elements" class="headerlink" title="Dojo loves Custom Elements"></a>Dojo loves Custom Elements</h2><p>A top priority for Dojo is interoperability with the web platform, both by utilizing current and emerging standards and providing a mechanism to coexist with other frameworks efficiently. The Custom Elements portion of the Web Components standard is one area to encourage interoperability between UI component libraries and frameworks.</p><p>The <a href="https://custom-elements-everywhere.com/" target="_blank" rel="noopener">Custom Elements Everywhere</a> project was released last year to highlight framework support for using custom elements, and Dojo 2 currently has a perfect score.</p><p>You can do much more than simply use custom elements within a Dojo 2 project, you can compile your Dojo 2 widgets to custom elements via one of our <code>@dojo/cli</code> commands, making it shareable and easy to distribute Dojo 2 widgets across projects and frameworks. So if you are in an organization where some teams use Angular, some use React, some use Vue, and some use Dojo, we provide a future today where you can write a component once and share it across those teams!</p><p>By default, Dojo’s custom elements are built for evergreen browsers to reduce overall bundle size, meaning most basic widgets are &lt;20KB (gzipped) including all of the <code>@dojo</code> runtime needed to support the custom element.</p><p>The <code>customElement</code> decorator annotates the widget class and instructs the cli-build-widget command to convert it to a custom element:</p><pre class=" language-typescript"><code class="language-typescript"><span class="token keyword">interface</span> <span class="token class-name">HelloWorldProperties</span> <span class="token punctuation">{</span>    onClick<span class="token punctuation">:</span> <span class="token punctuation">(</span>event<span class="token punctuation">:</span> Event<span class="token punctuation">)</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token keyword">void</span><span class="token punctuation">;</span>    foo<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">;</span>    bar<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">;</span><span class="token punctuation">}</span>@<span class="token function">customElement</span><span class="token punctuation">(</span><span class="token punctuation">{</span>    tag<span class="token punctuation">:</span> <span class="token string">'hello-world'</span><span class="token punctuation">,</span>    attributes<span class="token punctuation">:</span> <span class="token punctuation">[</span> <span class="token string">'foo'</span><span class="token punctuation">,</span> <span class="token string">'bar'</span> <span class="token punctuation">]</span><span class="token punctuation">,</span>    events<span class="token punctuation">:</span> <span class="token punctuation">[</span> <span class="token string">'onClick'</span> <span class="token punctuation">]</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token keyword">class</span> <span class="token class-name">HelloWorld</span> <span class="token keyword">extends</span> <span class="token class-name">WidgetBase</span><span class="token operator">&lt;</span>HelloWorldProperties<span class="token operator">></span> <span class="token punctuation">{</span><span class="token comment" spellcheck="true">// ...</span><span class="token punctuation">}</span></code></pre><p>To compile a Dojo widget into a web component, run the following command:</p><pre><code>npx @dojo/cli build widget --elements src/HelloWorld</code></pre><p>For ease of use, all <a href="http://github.com/dojo/widgets" target="_blank" rel="noopener"><code>@dojo/widgets</code></a> are compiled to custom elements and published to npm and easily imported into your projects.</p><p>Learn more about creating your first Dojo widgets with the <a href="https://dojo.io/tutorials/001_static_content/">first Dojo 2 application tutorial</a>.</p><h2 id="The-Dojo-CLI"><a href="#The-Dojo-CLI" class="headerlink" title="The Dojo CLI"></a>The Dojo CLI</h2><p>CLI tools provide an easy way to work with frameworks, a trend  popularized in the JS community by Ember. The <a href="http://github.com/dojo/cli" target="_blank" rel="noopener">Dojo CLI</a> is a collection of packages, providing a CLI architecture enabling a modular approach to create and work with commands.</p><p>One of our goals in creating an easy out of the box experience with Dojo is to abstract users away from complex configuration by using intelligent defaults internally.</p><p>To install the Dojo CLI, run the following command: <code>npm install -g @dojo/cli</code></p><p>There are currently six officially supported CLI command modules:</p><h4 id="dojo-cli-create-app"><a href="#dojo-cli-create-app" class="headerlink" title="@dojo/cli-create-app"></a><a href="http://github.com/dojo/cli-create-app" target="_blank" rel="noopener">@dojo/cli-create-app</a></h4><p>Creates a skeleton Dojo 2 application to get started with development and includes all the Dojo 2 dependencies needed.</p><pre class=" language-shell"><code class="language-shell">$ dojo create app --name my-first-dojo-2-app</code></pre><h4 id="dojo-cli-build-app"><a href="#dojo-cli-build-app" class="headerlink" title="@dojo/cli-build-app"></a><a href="http://github.com/dojo/cli-build-app" target="_blank" rel="noopener">@dojo/cli-build-app</a></h4><p>A command to build your Dojo 2 application with basic command line options to specify the target development or production, start the command in watch mode and even create a basic http server to serve the application locally.</p><p>cli-build-app also provides powerful tools to code split dynamically imported widgets automatically and Build Time Rendering.</p><h4 id="dojo-cli-test-intern"><a href="#dojo-cli-test-intern" class="headerlink" title="@dojo/cli-test-intern"></a><a href="http://github.com/dojo/cli-test-intern" target="_blank" rel="noopener">@dojo/cli-test-intern</a></h4><p>A unit and functional testing command for Dojo 2 application using <a href="https://theintern.io/" target="_blank" rel="noopener">Intern</a>, with support to run tests on popular services such as Browserstack, Saucelabs and TestingBot.</p><h4 id="dojo-cli-build-widget"><a href="#dojo-cli-build-widget" class="headerlink" title="@dojo/cli-build-widget"></a><a href="http://github.com/dojo/cli-build-widget" target="_blank" rel="noopener">@dojo/cli-build-widget</a></h4><p>The cli-build-widget command enables consumers to build custom elements from one or more of their Dojo 2 widgets.</p><h4 id="dojo-cli-create-widget"><a href="#dojo-cli-create-widget" class="headerlink" title="@dojo/cli-create-widget"></a><a href="http://github.com/dojo/cli-create-widget" target="_blank" rel="noopener">@dojo/cli-create-widget</a></h4><p>Creates a skeleton Dojo 2 widget module and all associated meta files.</p><h4 id="dojo-cli-create-theme"><a href="#dojo-cli-create-theme" class="headerlink" title="@dojo/cli-create-theme"></a><a href="http://github.com/dojo/cli-create-theme" target="_blank" rel="noopener">@dojo/cli-create-theme</a></h4><p>Creates a skeleton Dojo 2 theme from your chosen project’s dependencies.</p><p>Ultimately, each of the commands require zero configuration to get started, with only some advanced features requiring additional configuration via a project’s <code>.dojorc</code> file.</p><p>To use any of the CLI commands in your Dojo 2 project by adding them as a dev dependency to your project’s <code>package.json</code>.</p><p>Learn more about creating your first Dojo application in the <a href="https://dojo.io/tutorials/000_local_installation/">Dojo local installation tutorial</a>.</p><h2 id="State-management"><a href="#State-management" class="headerlink" title="State management"></a>State management</h2><p>No modern framework would be complete without a recommended approach to state management.</p><p>Managing state can become difficult to coordinate when an application becomes complicated with multiple views, widgets, components, and models. With each of these attempting to update attributes of state at varying points within the application lifecycle things can get confusing. When state changes are difficult to understand or non-deterministic, it becomes increasingly difficult to identify and reproduce bugs or add new features.</p><p><code>@dojo/stores</code> is a predictable, consistent state container for JavaScript applications with inspiration from Redux and Flux architectures. However, the <a href="http://github.com/dojo/stores" target="_blank" rel="noopener"><code>@dojo/stores</code></a> package aims to provide more built-in support for common patterns such as asynchronous behaviors, undo support and more!</p><p>The <code>@dojo/stores</code> package provides a centralized store, designed to be the single source of truth for an application. It operates using uni-directional data flow, so all application data follows the same lifecycle, ensuring the application logic is predictable and easy to understand.</p><p>Key features of <code>@dojo/stores</code> include:</p><ul><li>Application state store designed to work with a reactive component architecture</li><li>Out of the box support for asynchronous commands</li><li>All state operations are recorded per process and undoable via a process callback</li><li>Supports the optimistic pattern with the ability to roll back on a failure</li><li>Fully serializable operations and state</li></ul><p>When managing application state with the <code>@dojo/stores</code> package, there are three core but simple concepts - Operations, Commands, and Processes.</p><ul><li>Operations: Granular instructions to manipulate state based on JSON Patch</li><li>Commands: Simple functions ultimately returning operations needed to perform the required state change</li><li>Processes: A function executing a group of commands usually representing a complete application behavior</li></ul><p>Dojo 2 also makes it easy to support other patterns such as those popularized by Unstated. Less complex applications can simply lift state up to parent widgets and use local state.</p><h2 id="Documentation-and-examples"><a href="#Documentation-and-examples" class="headerlink" title="Documentation and examples"></a>Documentation and examples</h2><p>To get started, we have a <a href="https://dojo.io/tutorials/">series of Dojo tutorials</a> and <a href="https://dojo.io/docs/fundamentals/accessibility/index.html">reference documentation</a> ranging from the very basic to more complicated topics such as lazy loading, web animations and more. In addition to these resources, all Dojo 2 packages have detailed READMEs.</p><p>We’ve created a variety of examples of Dojo 2 usage:</p><ul><li><a href="https://dojo.github.io/examples/todo-mvc/" target="_blank" rel="noopener">TodoMVC</a> - TodoMVC is the canonical example used to demonstrate fundamental web application paradigms</li><li><a href="https://dojo.github.io/examples/todo-mvc-kitchensink/" target="_blank" rel="noopener">TodoMVC kitchen sink</a> - Our extension of TodoMVC used to illustrate a selection of Dojo 2 specific capabilities such as theming and internationalization.</li><li><a href="https://dojo.github.io/examples/realworld/" target="_blank" rel="noopener">RealWorld</a> - A full web application example with authentication, code splitting, state management, routing and more.</li><li><a href="https://dojo-2-hnpwa-d668d.firebaseapp.com/" target="_blank" rel="noopener">HNPWA</a> - The spiritual successor to TodoMVC, Hacker News PWA is designed to demonstrate progressive web app capabilities with a focus on providing a fast, reliable experience with rich offline support</li><li><a href="https://dojo.github.io/examples/custom-element-menu/" target="_blank" rel="noopener">Custom element menus</a> - Demonstrates using Dojo 2 widgets both natively and as a custom element without needing to adapt the authoring pattern.</li></ul><p>To learn more about Dojo 2 and get started, check out the <a href="https://dojo.io/tutorials/">Dojo 2 tutorial series</a>.</p><h2 id="What’s-next"><a href="#What’s-next" class="headerlink" title="What’s next?"></a>What’s next?</h2><p>In the release candidate stage, we will fix any critical issues reported and then have another release candidate. After a week with no critical blocking issues, we will announce 2.0.0!</p><p>We also hope to have Dojo 2 available on CodeSandbox in time for the 2.0.0 release as well.</p><h3 id="Versions"><a href="#Versions" class="headerlink" title="Versions"></a>Versions</h3><p>After, we will be following semantic versioning for subsequent releases. 2.0.y will include bug fixes, 2.x.0 will provide additions, and 3.0.0 will be the next release with any breaking changes. When we are ready for 3.0.0, all packages will be updated to this version to keep them synchronized. As such, expect 3.0.0 to arrive within a few months rather than 10 years!</p><h3 id="Feedback-and-help-wanted"><a href="#Feedback-and-help-wanted" class="headerlink" title="Feedback and help wanted"></a>Feedback and help wanted</h3><p>We still have quite a bit of work to do to update and refine our examples and documentation, so if you see an issue, please let us know, or better yet, create a pull request!<br>There is still much we want to complete after 2.0.0, but we are ready for you to start using Dojo, give us feedback, and let us know where we should prioritize our efforts.</p><p>Let us know what you think either on <a href="https://gitter.im/dojo/dojo2" target="_blank" rel="noopener">Gitter</a>, <a href="https://twitter.com/dojo/" target="_blank" rel="noopener">Twitter</a> or <a href="https://discourse.dojo.io/" target="_blank" rel="noopener">Discourse</a>.</p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;We’re pleased to announce Dojo 2 release candidate 1 is now available!&lt;/p&gt;
&lt;p&gt;We first started brainstorming ideas for Dojo 2 back in 2010. While development of Dojo 2 did not take quite as long as Diablo 3 or Duke Nukem Forever, we followed a very deliberate journey. Conceived initially as a modern clean-up for Dojo 1.x, with the introduction of ES6, TypeScript, web components, and an array of other features, we realized we wanted to take a different path and create an approach to building modern apps that would not just be a slight clean-up of Dojo 1 or a clone of other current frameworks, but a productive and efficient development experience and front-end architecture.&lt;/p&gt;
&lt;img src=&quot;/blog/2018/03/11/2018-03-11-Dojo-2-rc1/featured.png&quot; title=&quot;feature-full&quot;&gt;
    
    </summary>
    
    
  </entry>
  
  <entry>
    <title>Announcing Dojo 2 beta 5!</title>
    <link href="https://dojo.io/blog/2018/01/23/Announcing-Dojo-2-beta-5/"/>
    <id>https://dojo.io/blog/2018/01/23/Announcing-Dojo-2-beta-5/</id>
    <published>2018-01-23T09:00:00.000Z</published>
    <updated>2019-03-22T14:47:35.830Z</updated>
    
    <content type="html"><![CDATA[<p>Dojo is a modern, reactive framework authored with ES2017 and TypeScript, and optimized with the needs of enterprise application development in mind.</p><p>If you’re learning about Dojo 2 for the first time, please read our overview about the <a href="https://dojo.io/blog/2017/12/04/Announcing-Dojo-2-beta-4/">Dojo 2 beta 4 release</a>.</p><img src="/blog/2018/01/23/Announcing-Dojo-2-beta-5/featured.png" title="feature-full"><a id="more"></a><h2 id="Getting-beta-5"><a href="#Getting-beta-5" class="headerlink" title="Getting beta 5"></a>Getting beta 5</h2><p>Beta 5 is currently tagged as <code>latest</code> in npm, so simply updating to the latest version will provide you with the Beta 5 release.  We also have a release tag of <code>beta5</code> in npm if you want to focus just on using Beta 5.</p><p>This will be the final beta release for Dojo 2! As we make releases of packages in anticipation of Release Candidate 1, we will not publish those packages to <code>latest</code> until Release Candidate 1 is available.</p><h2 id="Just-getting-started"><a href="#Just-getting-started" class="headerlink" title="Just getting started"></a>Just getting started</h2><p>If you want to get started with Dojo 2, the best way is to take a look at our <a href="/tutorials/">tutorials</a> or even take a look at Dojo 2 in action with our <a href="https://dojo.github.io/examples/" target="_blank" rel="noopener">example applications</a> (source on <a href="https://github.com/dojo/examples" target="_blank" rel="noopener">GitHub</a>).  Good starting tutorials are:</p><ul><li><a href="/tutorials/000_local_installation/">Dojo 2 local installation</a></li><li><a href="/tutorials/001_static_content/">Your first Dojo 2 application</a></li><li><a href="/tutorials/003_creating_widgets/">Creating widgets</a></li></ul><h2 id="New-in-beta-5"><a href="#New-in-beta-5" class="headerlink" title="New in beta 5"></a>New in beta 5</h2><p>Since the beta 4 release, we have made a number of improvements. The biggest changes and additions are mentioned here, with a complete list of changes</p><h3 id="Initial-re-architecture-of-the-build-system"><a href="#Initial-re-architecture-of-the-build-system" class="headerlink" title="Initial re-architecture of the build system"></a>Initial re-architecture of the build system</h3><p>Prior to beta5, the structure of the build commands was focused around the tooling and not around the actual creation of applications. So we completed a re-architecture and restructuring of the commands to align more to their use. Specifically, <code>@dojo/cli-build-webpack</code> is deprecated and replaced with:</p><ul><li><a href="https://github.com/dojo/cli-build-app/" target="_blank" rel="noopener"><code>@dojo/cli-build-app</code></a> A command that builds an application</li><li><a href="https://github.com/dojo/cli-build-widget/" target="_blank" rel="noopener"><code>@dojo/cli-build-widget</code></a> A command that build a widget, including support for web components</li><li>Other commands may be planned for the future</li></ul><p>This refactoring is mostly complete for Beta 5, with a few remaining items to complete for release candidate 1.</p><p>Usage of the build system is reflected in updates to the <a href="https://dojo.io/tutorials/">Dojo 2 tutorials</a>.</p><h3 id="Improvements-to-using-Custom-Elements-Web-Components"><a href="#Improvements-to-using-Custom-Elements-Web-Components" class="headerlink" title="Improvements to using Custom Elements/Web Components"></a>Improvements to using Custom Elements/Web Components</h3><p><a href="https://github.com/dojo/widget-core/pull/792" target="_blank" rel="noopener">Added a decorator for the custom element descriptor</a>. There is no longer a requirement for a separate module any more!</p><h3 id="widget-core-changes"><a href="#widget-core-changes" class="headerlink" title="widget-core changes"></a><code>widget-core</code> changes</h3><ul><li><a href="https://github.com/dojo/widget-core/pull/808" target="_blank" rel="noopener">Focus meta</a></li><li><a href="https://github.com/dojo/widget-core/pull/824" target="_blank" rel="noopener">Always render decorator</a></li><li><a href="https://github.com/dojo/widget-core/pull/801" target="_blank" rel="noopener">Registry decorator</a></li></ul><p>The primary breaking change in <code>widget-core</code> is that <a href="https://github.com/dojo/widget-core/pull/806" target="_blank" rel="noopener"><code>HNode</code> was renamed to <code>VNode</code></a></p><h3 id="New-widgets"><a href="#New-widgets" class="headerlink" title="New widgets"></a>New widgets</h3><p>Two new widgets were added in Beta 5:</p><ul><li><a href="https://github.com/dojo/widgets/issues/385" target="_blank" rel="noopener">Progress</a> (<code>@dojo/widgets/progress/Progress</code>)</li><li><a href="https://github.com/dojo/widgets/issues/386" target="_blank" rel="noopener">Toolbar</a> (<code>@dojo/widgets/toolbar/Toolbar</code>)</li></ul><p>These widgets may be viewed in the <a href="https://dojo.github.io/examples/widget-showcase/" target="_blank" rel="noopener">widget showcase</a>.</p><h3 id="Stores"><a href="#Stores" class="headerlink" title="Stores"></a>Stores</h3><p>A number of refinements were made since the initial <code>@dojo/stores</code> release in Beta 4:</p><ul><li><a href="https://github.com/dojo/stores/commit/b6165e6fd670874726e67ab166cb888967785d19" target="_blank" rel="noopener">Add a basic <code>onChange</code> mechanism</a></li><li>Improvements to providing type definitions for <a href="https://github.com/dojo/stores/pull/143" target="_blank" rel="noopener">state</a> and <a href="https://github.com/dojo/stores/pull/152" target="_blank" rel="noopener">payload</a></li></ul><p>See the <a href="https://github.com/dojo/stores" target="_blank" rel="noopener">@dojo/stores readme</a> for more information about this package.</p><h3 id="Updated-examples"><a href="#Updated-examples" class="headerlink" title="Updated examples"></a>Updated examples</h3><p>Our collection of <a href="http://github.com/dojo/examples/" target="_blank" rel="noopener">Dojo 2 examples</a> were updated for beta 5.</p><p>In particular, the <a href="https://github.com/dojo/examples/blob/master/todo-mvc-kitchensink" target="_blank" rel="noopener">kitchen sink version of ToDoMVC</a> now uses <code>@dojo/stores</code>.</p><p>Also the <a href="https://dojo-2-hnpwa-d668d.firebaseapp.com/" target="_blank" rel="noopener">Dojo 2 HNPWA</a> example was accepted and is now available.</p><h3 id="ESM-packages"><a href="#ESM-packages" class="headerlink" title="ESM packages"></a>ESM packages</h3><p>Dojo packages now ship ES modules alongside UMD! In the future we will be leveraging ESM for evergreen browser builds with webpack.</p><h3 id="Theme-creation"><a href="#Theme-creation" class="headerlink" title="Theme creation"></a>Theme creation</h3><p>A new <a href="https://github.com/dojo/cli-create-theme" target="_blank" rel="noopener"><code>cli-create-theme</code></a> package has been added to make it easier to create a custom theme.</p><h3 id="Migrate-to-TypeScript-2-6"><a href="#Migrate-to-TypeScript-2-6" class="headerlink" title="Migrate to TypeScript 2.6"></a>Migrate to TypeScript 2.6</h3><p><a href="https://blogs.msdn.microsoft.com/typescript/2017/10/31/announcing-typescript-2-6/" target="_blank" rel="noopener">TypeScript 2.6</a> was released and introduced a number of significant improvements to the language, in particular the strictness of certain types of typings. These changes helped us further refine the type definitions and find a few bugs along the way. Dojo 2 beta 5 ships all of its packages leveraging TypeScript 2.6, and all packages conform to <code>strict</code> type mode.</p><h2 id="What’s-next"><a href="#What’s-next" class="headerlink" title="What’s next?"></a>What’s next?</h2><p>We are nearly there for the initial 2.0 release. For RC1 in just a few weeks, you can look forward to:</p><ul><li>More end developer tooling improvements<ul><li><code>dojo/cli-build-app</code> Finish re-architecture of the build system</li><li><code>dojo/cli-build-widget</code> Focused build process for Dojo 2 widgets as web components</li></ul></li><li><code>dojo/themes</code> A new package for Dojo 2 themes</li><li><code>dojo/widget-core</code> Finish DOM abstraction</li><li><code>dojo/widgets</code> Standardize widget events</li><li>Additional theme to provide Dojo 1 flat theme style interoperability</li></ul><p>At the moment, we are planning for RC1 in early February.</p><p>We are also working on additional features post Dojo 2.0:</p><ul><li>Development and diagnostic tools</li><li><code>dojo/dgrid</code> Powerful data grid widget</li></ul><h2 id="Getting-involved"><a href="#Getting-involved" class="headerlink" title="Getting involved"></a>Getting involved</h2><p>If you want to get involved, you can see an overview of the parts of Dojo 2 at <a href="https://github.com/dojo/meta" target="_blank" rel="noopener">dojo/meta</a>.  In all of our repositories we use the labels <a href="https://github.com/dojo/meta/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22" target="_blank" rel="noopener"><code>good first issue</code></a> and <a href="https://github.com/dojo/meta/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22" target="_blank" rel="noopener"><code>help wanted</code></a> to help guide you on a good place to get started.</p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;Dojo is a modern, reactive framework authored with ES2017 and TypeScript, and optimized with the needs of enterprise application development in mind.&lt;/p&gt;
&lt;p&gt;If you’re learning about Dojo 2 for the first time, please read our overview about the &lt;a href=&quot;https://dojo.io/blog/2017/12/04/Announcing-Dojo-2-beta-4/&quot;&gt;Dojo 2 beta 4 release&lt;/a&gt;.&lt;/p&gt;
&lt;img src=&quot;/blog/2018/01/23/Announcing-Dojo-2-beta-5/featured.png&quot; title=&quot;feature-full&quot;&gt;
    
    </summary>
    
    
  </entry>
  
  <entry>
    <title>Announcing Dojo 2 beta 4!</title>
    <link href="https://dojo.io/blog/2017/12/04/Announcing-Dojo-2-beta-4/"/>
    <id>https://dojo.io/blog/2017/12/04/Announcing-Dojo-2-beta-4/</id>
    <published>2017-12-04T18:00:00.000Z</published>
    <updated>2019-03-22T14:47:35.826Z</updated>
    
    <content type="html"><![CDATA[<p>Dojo is a modern, reactive framework authored with ES2017 and TypeScript, and optimized with the needs of enterprise application development in mind.</p><p>With a focus on leveraging cutting edge standards such as web components and intersection observers, as well as emerging patterns like CSS modules, progressive web apps, and the virtual DOM, Dojo  provides an excellent experience for engineers and end users.</p><p>Dojo’s out-of-the-box experience takes under a minute to get started  and provides a variety of features including user interface widgets backed by powerful and flexible internationalization and accessibility options.  Intent on avoiding framework lock-in, its robust architectural flexibility and its support for modern standards makes Dojo a strong contender for enterprise development teams.</p><p>The latest beta 4 release has several significant changes and updates from earlier versions. Here we highlight the current state of Dojo 2, as well as emphasize the recent changes and additions in beta 4.</p><img src="/blog/2017/12/04/Announcing-Dojo-2-beta-4/featured.png" title="feature-full"><a id="more"></a><h2 id="Getting-Beta-4"><a href="#Getting-Beta-4" class="headerlink" title="Getting Beta 4"></a>Getting Beta 4</h2><p>Beta 4 is currently tagged as <code>latest</code> in npm, so simply updating to the latest version will provide you with the Beta 4 release.  We also have a release tag of <code>beta4</code> in npm if you want to focus just on using Beta 4.</p><p>With Beta 3, we revised our package versions to make it easier to keep a compatible set of packages.  We are releasing all pre-release versions of Dojo 2 packages under major version <code>0</code>, but are introducing breaking changes in the minor release (e.g. <code>0.2.0</code> has breaking changes from <code>0.1.0</code>).  The versions we publish to npm rely upon a minor range.  You will see that some packages for Beta 4 are <code>0.3.#</code> and some are <code>0.2.#</code>, but all packages depend on a range where compatibility has been verified by the Dojo team.  This means you do not need to reply upon a specific release tag.  If you are managing your dependencies directly, you should ideally depend upon a minor release for packages (e.g. <code>~0.2.0</code>).</p><p>As we make releases of packages in anticipation of Beta 5, we will not publish those packages to <code>latest</code> until we release Beta 5.</p><h2 id="Just-getting-started"><a href="#Just-getting-started" class="headerlink" title="Just getting started"></a>Just getting started</h2><p>If you want to get started with Dojo 2, the best way is to take a look at our <a href="/tutorials/">tutorials</a> or even take a look at Dojo 2 in action with our <a href="https://dojo.github.io/examples/" target="_blank" rel="noopener">example applications</a> (source on <a href="https://github.com/dojo/examples" target="_blank" rel="noopener">GitHub</a>).  Good starting tutorials are:</p><ul><li><a href="/tutorials/000_local_installation/">Dojo 2 local installation</a></li><li><a href="/tutorials/001_static_content/">Your first Dojo 2 application</a></li><li><a href="/tutorials/003_creating_widgets/">Creating widgets</a></li></ul><h2 id="Integrated-virtual-DOM"><a href="#Integrated-virtual-DOM" class="headerlink" title="Integrated virtual DOM"></a>Integrated virtual DOM</h2><p>Directly integrating the virtual DOM is the biggest change for the beta 4 release.  Instead of depending on the <a href="https://maquettejs.org/" target="_blank" rel="noopener">Maquette</a> virtual DOM library, we realized that our specialized requirements and needs are better solved by direct integration.  So in Beta 4 we have replaced Maquette with <code>@dojo/widget-core/vdom</code>.</p><p>This change allows us to directly merge our abstraction of widgets and virtual DOM nodes that get rendered to the DOM.  This increases the performance of the widgeting system, and also led to other performance and memory improvements to the widgeting system.</p><p>This alone would not affect users of Dojo 2, but it allows us to address many features and refactor code that introduces some significant <strong>breaking changes</strong> in the beta 4 release.</p><p>Explore the widgeting system via the <a href="/tutorials/003_creating_widgets/">Creating widgets</a> tutorial.</p><h2 id="Virtual-DOM-classes"><a href="#Virtual-DOM-classes" class="headerlink" title="Virtual DOM classes"></a>Virtual DOM classes</h2><p>One of the biggest usability issues with earlier Dojo 2 beta releases was managing CSS classes.  In Beta 4, we have changed this significantly, and while it is a <strong>breaking change</strong> we think the end result is <em>a lot</em> more usable.</p><p>Previously, <code>classes</code> were actually an object map of keys with a boolean value.  If you were using the Dojo 2 theming system, you would use a function to specify your classes in a more functional way, which would automatically generate a memoized map.  If you were not using the theming system, you would need to memoize classes directly. While this approach might be ok to author, it was really challenging to test. It would look something like this:</p><pre class=" language-typescript"><code class="language-typescript"><span class="token keyword">import</span> <span class="token punctuation">{</span> v <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@dojo/widget-core/d'</span><span class="token punctuation">;</span><span class="token keyword">import</span> WidgetBase <span class="token keyword">from</span> <span class="token string">'@dojo/widget-core/WidgetBase'</span><span class="token punctuation">;</span><span class="token keyword">import</span> ThemeableMixin<span class="token punctuation">,</span> <span class="token punctuation">{</span> theme <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@dojo/widget-core/mixins/Themeable'</span><span class="token punctuation">;</span><span class="token keyword">import</span> <span class="token operator">*</span> as css <span class="token keyword">from</span> <span class="token string">'./styles/mywidget.m.css'</span><span class="token punctuation">;</span><span class="token keyword">const</span> ThemeableBase <span class="token operator">=</span> <span class="token function">ThemeableMixin</span><span class="token punctuation">(</span>WidgetBase<span class="token punctuation">)</span><span class="token punctuation">;</span>@<span class="token function">theme</span><span class="token punctuation">(</span>css<span class="token punctuation">)</span><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token keyword">class</span> <span class="token class-name">MyWidget</span> <span class="token keyword">extends</span> <span class="token class-name">ThemeableBase</span> <span class="token punctuation">{</span>    <span class="token keyword">protected</span> <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>        <span class="token keyword">return</span> <span class="token function">v</span><span class="token punctuation">(</span><span class="token string">'div'</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>            classes<span class="token punctuation">:</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">classes</span><span class="token punctuation">(</span>css<span class="token punctuation">.</span>root<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">fixed</span><span class="token punctuation">(</span>css<span class="token punctuation">.</span>rootFixed<span class="token punctuation">)</span>        <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">[</span> <span class="token string">'Hello world!'</span> <span class="token punctuation">]</span><span class="token punctuation">)</span>    <span class="token punctuation">}</span><span class="token punctuation">}</span></code></pre><p>With the changes in Beta 4, this gets written as:</p><pre class=" language-typescript"><code class="language-typescript"><span class="token keyword">import</span> <span class="token punctuation">{</span> v <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@dojo/widget-core/d'</span><span class="token punctuation">;</span><span class="token keyword">import</span> WidgetBase <span class="token keyword">from</span> <span class="token string">'@dojo/widget-core/WidgetBase'</span><span class="token punctuation">;</span><span class="token keyword">import</span> ThemedMixin<span class="token punctuation">,</span> <span class="token punctuation">{</span> theme <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@dojo/widget-core/mixins/Themed'</span><span class="token punctuation">;</span><span class="token keyword">import</span> <span class="token operator">*</span> as css <span class="token keyword">from</span> <span class="token string">'./styles/mywidget.m.css'</span><span class="token punctuation">;</span><span class="token keyword">const</span> ThemedBase <span class="token operator">=</span> <span class="token function">ThemedMixin</span><span class="token punctuation">(</span>WidgetBase<span class="token punctuation">)</span><span class="token punctuation">;</span>@<span class="token function">theme</span><span class="token punctuation">(</span>css<span class="token punctuation">)</span><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token keyword">class</span> <span class="token class-name">MyWidget</span> <span class="token keyword">extends</span> <span class="token class-name">ThemedBase</span> <span class="token punctuation">{</span>    <span class="token keyword">protected</span> <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>        <span class="token keyword">return</span> <span class="token function">v</span><span class="token punctuation">(</span><span class="token string">'div'</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>            classes<span class="token punctuation">:</span> <span class="token punctuation">[</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">theme</span><span class="token punctuation">(</span>css<span class="token punctuation">.</span>root<span class="token punctuation">)</span><span class="token punctuation">,</span> css<span class="token punctuation">.</span>rootFixed <span class="token punctuation">]</span>        <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">[</span> <span class="token string">'Hello world!'</span> <span class="token punctuation">]</span><span class="token punctuation">)</span>    <span class="token punctuation">}</span><span class="token punctuation">}</span></code></pre><p>The <code>classes</code> property is now just an array of strings.  Also the mixed in <code>.theme()</code> method more clearly express intent over the former <code>.classes()</code> name.  <em>Fixed</em> classes are simply added to the array, instead of being supplied to a chained function.</p><p>The testing tooling (<code>@dojo/test-extras/harness</code>) has been updated to reflect these changes, making it easier to test widgets.  <code>Themeable</code> was renamed to <code>Themed</code> for improved mixin semantics.</p><h2 id="Widget-lifecycle-changes"><a href="#Widget-lifecycle-changes" class="headerlink" title="Widget lifecycle changes"></a>Widget lifecycle changes</h2><p>We have a goal with Dojo 2 to provide straightforward and efficient APIs. One of the biggest lessons we learned with Dojo 2 was that the widget lifecycle was far too complex. The Dojo 2 widget system handles the vast majority of lifecycle changes and updates automatically. There are some scenarios where you many need to know when an item is added or removed from the DOM by the virtual DOM system.</p><p>In Beta 4, we have introduced the <code>onAttach</code> and <code>onDetach</code> lifecycle methods to WidgetBase.  They are designed to allow a widget developer to <em>hook</em> when a widget instance is attached to the DOM or detached from the DOM.</p><p>To use the lifecycle methods, simply override <code>onAttach</code> or <code>onDetach</code>:</p><pre class=" language-typescript"><code class="language-typescript"><span class="token keyword">import</span> <span class="token punctuation">{</span> v <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@dojo/widget-core/d'</span><span class="token punctuation">;</span><span class="token keyword">import</span> WidgetBase <span class="token keyword">from</span> <span class="token string">'@dojo/widget-core/WidgetBase'</span><span class="token punctuation">;</span><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token keyword">class</span> <span class="token class-name">MyWidget</span> <span class="token keyword">extends</span> <span class="token class-name">WidgetBase</span> <span class="token punctuation">{</span>    <span class="token keyword">protected</span> <span class="token function">onAttach</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>        <span class="token comment" spellcheck="true">// perform actions when attached</span>    <span class="token punctuation">}</span>    <span class="token keyword">protected</span> <span class="token function">onDetach</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>        <span class="token comment" spellcheck="true">// perform actions when detached</span>    <span class="token punctuation">}</span>    <span class="token keyword">protected</span> <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>        <span class="token keyword">return</span> <span class="token function">v</span><span class="token punctuation">(</span><span class="token string">'div'</span><span class="token punctuation">,</span> <span class="token punctuation">{</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">[</span> <span class="token string">'Hello world!'</span> <span class="token punctuation">]</span><span class="token punctuation">)</span>    <span class="token punctuation">}</span><span class="token punctuation">}</span></code></pre><p>Earlier, less effective efforts to provide lifecycle methods are deprecated and will be removed in the future.</p><h2 id="Deferred-properties"><a href="#Deferred-properties" class="headerlink" title="Deferred properties"></a>Deferred properties</h2><p>A virtual DOM node may have its property resolution deferred. Instead of providing an object of <code>VirtualDomProperties</code>, you may provide a function which accepts a boolean flag representing whether the virtual DOM node has been inserted into the DOM. This function returns an object of <code>VirtualDomProperties</code>.</p><p>Because these functions will be called during the next <code>requestAnimationFrame</code> (when the projector is running in its default asynchronous mode), this feature can be used to better handle CSS transition states.  For example, you can now do something like this:</p><pre class=" language-typescript"><code class="language-typescript"><span class="token keyword">import</span> <span class="token punctuation">{</span> v <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@dojo/widget-core/d'</span><span class="token punctuation">;</span><span class="token keyword">import</span> WidgetBase <span class="token keyword">from</span> <span class="token string">'@dojo/widget-core/WidgetBase'</span><span class="token punctuation">;</span><span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>    <span class="token keyword">return</span> <span class="token function">v</span><span class="token punctuation">(</span><span class="token string">'div'</span><span class="token punctuation">,</span> <span class="token punctuation">(</span>inserted<span class="token punctuation">)</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token punctuation">{</span>        <span class="token keyword">return</span> <span class="token punctuation">{</span>            classes<span class="token punctuation">:</span> <span class="token string">'fadeInTransition'</span><span class="token punctuation">,</span>            styles<span class="token punctuation">:</span> <span class="token punctuation">{</span>                opacity<span class="token punctuation">:</span> inserted <span class="token operator">?</span> <span class="token string">'1'</span> <span class="token punctuation">:</span> <span class="token string">'0'</span>            <span class="token punctuation">}</span>        <span class="token punctuation">}</span><span class="token punctuation">;</span>    <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">[</span> <span class="token string">'Hello World!'</span> <span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token punctuation">}</span></code></pre><h2 id="Web-animations-meta-provider"><a href="#Web-animations-meta-provider" class="headerlink" title="Web animations meta provider"></a>Web animations meta provider</h2><p>The Dojo 2 widgeting system strives to provide sufficient tools and abstractions to avoid needing to directly manipulate the DOM.  Meta providers offer reactive ways to interact with features that would otherwise require direct DOM interaction.  Dojo 2 includes meta providers for Intersection Observers, dragging on an element, node dimensions, and the matching of a virtual DOM node.</p><p>In this vein, we have added a web animations meta provider in Beta 4.  It provides a way to easily animate DOM nodes in a reactive way, as just part of your widget’s <code>.render()</code> function.  For example:</p><pre class=" language-typescript"><code class="language-typescript"><span class="token keyword">import</span> <span class="token punctuation">{</span> v <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'@dojo/widget-core/d'</span><span class="token punctuation">;</span><span class="token keyword">import</span> WidgetBase <span class="token keyword">from</span> <span class="token string">'@dojo/widget-core/WidgetBase'</span><span class="token punctuation">;</span><span class="token keyword">import</span> WebAnimation <span class="token keyword">from</span> <span class="token string">'@dojo/widget-core/meta/WebAnimation'</span><span class="token punctuation">;</span><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token keyword">class</span> <span class="token class-name">AnimatedWidget</span> <span class="token keyword">extends</span> <span class="token class-name">WidgetBase</span> <span class="token punctuation">{</span>    <span class="token keyword">protected</span> <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>        <span class="token keyword">const</span> animate <span class="token operator">=</span> <span class="token punctuation">{</span>            id<span class="token punctuation">:</span> <span class="token string">'rootAnimation'</span><span class="token punctuation">,</span>            effects<span class="token punctuation">:</span> <span class="token punctuation">[</span>                <span class="token punctuation">{</span> height<span class="token punctuation">:</span> <span class="token string">'10px'</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>                <span class="token punctuation">{</span> height<span class="token punctuation">:</span> <span class="token string">'100px'</span> <span class="token punctuation">}</span>            <span class="token punctuation">]</span><span class="token punctuation">,</span>            controls<span class="token punctuation">:</span> <span class="token punctuation">{</span>                play<span class="token punctuation">:</span> <span class="token keyword">true</span>            <span class="token punctuation">}</span>        <span class="token punctuation">}</span><span class="token punctuation">;</span>        <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">meta</span><span class="token punctuation">(</span>WebAnimation<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">animate</span><span class="token punctuation">(</span><span class="token string">'root'</span><span class="token punctuation">,</span> animate<span class="token punctuation">)</span><span class="token punctuation">;</span>        <span class="token keyword">return</span> <span class="token function">v</span><span class="token punctuation">(</span><span class="token string">'div'</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>            key<span class="token punctuation">:</span> <span class="token string">'root'</span>        <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>    <span class="token punctuation">}</span><span class="token punctuation">}</span></code></pre><h2 id="Custom-Elements-Web-Components"><a href="#Custom-Elements-Web-Components" class="headerlink" title="Custom Elements/Web Components"></a>Custom Elements/Web Components</h2><p>A primary objective for Dojo 2 is to embrace and leverage standards wherever possible to encourage interoperability. One such area is Web Components, where it is possible to both use Web Components within Dojo 2 applications, and also use Dojo 2 widgets as Custom Elements outside the context of a Dojo 2 application.  Beta 4 introduces several changes to the widgeting system to better support Dojo 2 widgets used as Custom Elements.  Earlier, it was challenging to have a Dojo 2 Custom Element efficiently use other Dojo 2 Custom Elements as children.  With Beta 4, this is no longer a problem.</p><p>If you write the following in TypeScript:</p><pre class=" language-typescript"><code class="language-typescript"><span class="token keyword">class</span> <span class="token class-name">Example</span> <span class="token keyword">extends</span> <span class="token class-name">WidgetBase</span> <span class="token punctuation">{</span>  <span class="token keyword">private</span> <span class="token function">_onSelected</span><span class="token punctuation">(</span>data<span class="token punctuation">:</span> <span class="token keyword">any</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>    console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>data<span class="token punctuation">)</span><span class="token punctuation">;</span>  <span class="token punctuation">}</span>  <span class="token keyword">protected</span> <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>    <span class="token keyword">return</span> <span class="token function">w</span><span class="token punctuation">(</span>Menu<span class="token punctuation">,</span> <span class="token punctuation">{</span> onSelected<span class="token punctuation">:</span> <span class="token keyword">this</span><span class="token punctuation">.</span>_onSelected <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">[</span>      <span class="token function">w</span><span class="token punctuation">(</span>MenuItem<span class="token punctuation">,</span> <span class="token punctuation">{</span> key<span class="token punctuation">:</span> <span class="token string">'a'</span><span class="token punctuation">,</span> title<span class="token punctuation">:</span> <span class="token string">'Menu Item A'</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">,</span>      <span class="token function">w</span><span class="token punctuation">(</span>MenuItem<span class="token punctuation">,</span> <span class="token punctuation">{</span> key<span class="token punctuation">:</span> <span class="token string">'b'</span><span class="token punctuation">,</span> title<span class="token punctuation">:</span> <span class="token string">'Menu Item B'</span><span class="token punctuation">,</span> selected<span class="token punctuation">:</span> <span class="token keyword">true</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">,</span>      <span class="token function">w</span><span class="token punctuation">(</span>MenuItem<span class="token punctuation">,</span> <span class="token punctuation">{</span> key<span class="token punctuation">:</span> <span class="token string">'c'</span><span class="token punctuation">,</span> title<span class="token punctuation">:</span> <span class="token string">'Menu Item C'</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>    <span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>  <span class="token punctuation">}</span><span class="token punctuation">}</span></code></pre><p>You could express the same using Custom Elements, independent of a Dojo 2 application:</p><pre class=" language-html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>demo-menu</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>menu<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>demo-menu-item</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>a<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>Menu Item A<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>demo-menu-item</span><span class="token punctuation">></span></span>  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>demo-menu-item</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>b<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>Menu Item B<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>demo-menu-item</span><span class="token punctuation">></span></span>  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>demo-menu-item</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>c<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>Menu Item C<span class="token punctuation">"</span></span> <span class="token attr-name">selected</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>demo-menu-item</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>demo-menu</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span><span class="token punctuation">></span></span><span class="token script language-javascript">  a<span class="token punctuation">.</span>data <span class="token operator">=</span> <span class="token punctuation">{</span> foo<span class="token punctuation">:</span> <span class="token string">'bar'</span> <span class="token punctuation">}</span><span class="token punctuation">;</span>  menu<span class="token punctuation">.</span><span class="token function">addEventListener</span><span class="token punctuation">(</span><span class="token string">'selected'</span><span class="token punctuation">,</span> <span class="token keyword">function</span><span class="token punctuation">(</span>event<span class="token punctuation">)</span> <span class="token punctuation">{</span>    <span class="token keyword">const</span> detail <span class="token operator">=</span> event<span class="token punctuation">.</span>detail<span class="token punctuation">;</span>    console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>detail<span class="token punctuation">)</span><span class="token punctuation">;</span>  <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">></span></span></code></pre><p>We have a <a href="https://dojo.github.io/examples/custom-element-menu/" target="_blank" rel="noopener">live custom elements example</a>, along with the example’s <a href="https://github.com/dojo/examples/tree/master/custom-element-menu" target="_blank" rel="noopener">source code</a>.</p><h2 id="Other-widget-system-improvements"><a href="#Other-widget-system-improvements" class="headerlink" title="Other widget system improvements"></a>Other widget system improvements</h2><p>Additional widget system changes enable features and capabilities to make widgets more robust:</p><ul><li>Event listeners on virtual DOM nodes now allow the listeners to change between renders.</li><li>Options for the <em>root</em> of a <code>Projector</code> are more flexible, including being able to return a widget node, or an array of nodes. Changing the root of the projector after the first render is now supported.</li><li>Several internal performance and memory improvements to the virtual DOM and widgeting system.</li></ul><h2 id="New-widgets"><a href="#New-widgets" class="headerlink" title="New widgets"></a>New widgets</h2><p>We have introduced two new widgets in Beta 4 and are considering more before the release of Dojo 2.  While our focus is providing solid patterns and examples for building widgets, it is very helpful to have <em>out-of-the-box</em> widgets, especially for rapid prototyping.</p><p>We have introduced a new accordion pane widget (<code>@dojo/widgets/accordionpane/AccordionPane</code>):</p><p><img src="./accordion.png" alt="The accordion pane widget" height="465" width="351"></p><p>And we have introduced a tooltip widget (<code>@dojo/widgets/tooltip/Tooltip</code>):</p><p><img src="./tooltip.png" alt="The tooltip widget" height="104" width="415"></p><h2 id="Other-widget-improvements"><a href="#Other-widget-improvements" class="headerlink" title="Other widget improvements"></a>Other widget improvements</h2><p>We are working to standardize conventions in widgets. Some changes have landed for Beta 4, with additional refinements planned for Beta 5. In particular we have been rationalizing our styles, clearly delineating between themeable and structural styles, making it easier to theme existing widgets. We are also investigating approaches to better customize and extend the out of the box widgets.</p><h2 id="Stores-re-architecture"><a href="#Stores-re-architecture" class="headerlink" title="Stores re-architecture"></a>Stores re-architecture</h2><p>The current API in Dojo 1 for managing state focused on a CRUD type API.  Originally in Dojo 2 we directly adapted that API as part of <em>stores</em>.  The concept of state containers has become a primary focus, so we created a solution that aligns to that architecture.</p><p>Instead of a CRUD type API, <code>@dojo/stores</code> focuses on three main concepts:</p><ul><li><em>Operation</em> which is a granular state mutation based on the JSON Patch API</li><li><em>Command</em> a semantically aligned function which returns a set of operations to apply</li><li><em>Process</em> a function that groups commands into a <em>process flow</em> to represent a complete behavior</li></ul><p>You can read more about the new API at <a href="https://github.com/dojo/stores" target="_blank" rel="noopener"><code>dojo/stores</code></a>.</p><h2 id="A-new-approach-to-shims-and-polyfills"><a href="#A-new-approach-to-shims-and-polyfills" class="headerlink" title="A new approach to shims and polyfills"></a>A new approach to shims and polyfills</h2><p>We have rationalized the way we introduce environment compatibility, and improved the build system to further optimize this approach when building an application. We realize that some packages depend upon third-party polyfills, but we did not have a consistent way to introduce them and elide them if not needed.</p><p>Now <code>@dojo/shim/main</code> loads all polyfills needed for the expected base functionality and <code>@dojo/shim/browser</code> will load polyfills for a browser environment.  Most end developers will not need to worry about this as the other Dojo 2 packages will ensure that these modules get loaded.</p><p>If you are building an application targeting only certain platforms, any unneeded polyfills will simply result in a non-operation, but will still be included in the bundle. Beta 4 adds an additional static build optimization feature, where a specially formed pragma will denote the feature that the next import will be polyfilling. If that feature is not required based on the build targets, it will be removed from the build. More information can be found in the <a href="https://github.com/dojo/webpack-contrib#elided-imports" target="_blank" rel="noopener">elided imports documentation</a>.</p><h2 id="Iterators"><a href="#Iterators" class="headerlink" title="Iterators"></a>Iterators</h2><p>Previously we provided a functional replacement for <code>for...of</code> constructs, allowing developers to author code that worked in older environments. We also provided shims for <code>Symbol</code> and the built in ES6 iterators. TypeScript 2.3 added a down level emit for iterators. We have restructured our packages to use <code>for...of</code> instead of the <code>@dojo/shim/iterator.forOf()</code> function and will likely remove <code>forOf()</code> in the future. We recommend users of Dojo 2 also migrate to this syntax.</p><h2 id="TypeScript-helpers"><a href="#TypeScript-helpers" class="headerlink" title="TypeScript helpers"></a>TypeScript helpers</h2><p>When emitting to JavaScript from TypeScript, each run-time module included all TypeScript helpers needed by that module. This increases the bundle size because these helpers would be duplicated many times. In Beta 4, we import helpers from <code>tslib</code> and automatically include these helpers once as part of the CLI build tool, eliminating any duplication of TS helper code.</p><h2 id="What’s-next"><a href="#What’s-next" class="headerlink" title="What’s next?"></a>What’s next?</h2><p>We are planning many things for Beta 5, which will always chop and change a bit. You may look forward to:</p><ul><li>A re-architected build tool, which will include build time rendering to automatically identify critical path resources in the build, providing automatic code splitting and build optimization.</li><li>More performance improvements for the widgeting system.</li><li>More examples and applications of <code>@dojo/stores</code> based on the new architecture.</li><li>Improvements to the tooling around widget themes</li></ul><p>At the moment, we are planning for Beta 5 in December and a release candidate for Dojo 2 in January.</p><h2 id="Getting-involved"><a href="#Getting-involved" class="headerlink" title="Getting involved"></a>Getting involved</h2><p>If you want to get involved, you can see an overview of the parts of Dojo 2 at <a href="https://github.com/dojo/meta" target="_blank" rel="noopener">dojo/meta</a>.  In all of our repositories we use the labels <a href="https://github.com/dojo/meta/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22" target="_blank" rel="noopener"><code>good first issue</code></a> and <a href="https://github.com/dojo/meta/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22" target="_blank" rel="noopener"><code>help wanted</code></a> to help guide you on a good place to get started.</p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;Dojo is a modern, reactive framework authored with ES2017 and TypeScript, and optimized with the needs of enterprise application development in mind.&lt;/p&gt;
&lt;p&gt;With a focus on leveraging cutting edge standards such as web components and intersection observers, as well as emerging patterns like CSS modules, progressive web apps, and the virtual DOM, Dojo  provides an excellent experience for engineers and end users.&lt;/p&gt;
&lt;p&gt;Dojo’s out-of-the-box experience takes under a minute to get started  and provides a variety of features including user interface widgets backed by powerful and flexible internationalization and accessibility options.  Intent on avoiding framework lock-in, its robust architectural flexibility and its support for modern standards makes Dojo a strong contender for enterprise development teams.&lt;/p&gt;
&lt;p&gt;The latest beta 4 release has several significant changes and updates from earlier versions. Here we highlight the current state of Dojo 2, as well as emphasize the recent changes and additions in beta 4.&lt;/p&gt;
&lt;img src=&quot;/blog/2017/12/04/Announcing-Dojo-2-beta-4/featured.png&quot; title=&quot;feature-full&quot;&gt;
    
    </summary>
    
    
  </entry>
  
  <entry>
    <title>Dojo 2 is coming</title>
    <link href="https://dojo.io/blog/2017/03/27/Dojo-2-is-coming/"/>
    <id>https://dojo.io/blog/2017/03/27/Dojo-2-is-coming/</id>
    <published>2017-03-27T14:32:37.000Z</published>
    <updated>2019-03-22T14:47:35.826Z</updated>
    
    <content type="html"><![CDATA[<p>Dojo 2 is the most substantial rethink to the Dojo Toolkit in ten years. As it nears Beta status for the majority of its modules, quite a bit has changed these past few months as it has evolved into a powerful solution for building enterprise applications.</p><img src="/blog/2017/03/27/Dojo-2-is-coming/featured.png" title="feature-full"><h2 id="A-new-generation"><a href="#A-new-generation" class="headerlink" title="A new generation"></a>A new generation</h2><p>Dojo 2 is a next generation framework authored to emphasize:</p><ul><li><p><strong>Efficiency.</strong>  Code structure and developer ergonomics have been challenged at every turn resulting in impeccable code quality.</p></li><li><p><strong>Longevity.</strong>  Sustainable code that will last and adapt as the platform changes is a key consideration for large-scale development projects.</p></li><li><p><strong>Modularity.</strong>  Designed as a collection of packages that may be used independently or cooperatively, allowing for development flexibility.</p></li><li><p><strong>Focus.</strong> The focus is enterprise-driven, highlighting scalability as well as powerful, built-in features including support for large data sets, a11y and i18n.</p></li></ul><a id="more"></a><h2 id="The-Tenets-of-Dojo-2"><a href="#The-Tenets-of-Dojo-2" class="headerlink" title="The Tenets of Dojo 2"></a>The Tenets of Dojo 2</h2><h4 id="Common-Patterns-amp-Standards"><a href="#Common-Patterns-amp-Standards" class="headerlink" title="Common Patterns &amp; Standards"></a>Common Patterns &amp; Standards</h4><p>Dojo 2 strives for an efficient development approach through common patterns and best practices. Refined APIs and consistent paradigms lead to a robust, forward thinking approach.</p><h4 id="Quality"><a href="#Quality" class="headerlink" title="Quality"></a>Quality</h4><p>Dojo 2 focuses on quality, with exhaustive test suites and comprehensive code coverage.  The deliberate architecture joined with a purposeful combination of tools and technology creates a smooth approach to building modern web applications.</p><h4 id="ES6"><a href="#ES6" class="headerlink" title="ES6+"></a>ES6+</h4><p>With a foundation on ES6+ and its annual release cycle, we begin with a solid base feature set and a strategic approach to shimming future features. </p><h4 id="TypeScript"><a href="#TypeScript" class="headerlink" title="TypeScript"></a>TypeScript</h4><p>TypeScript extends ES6+ to support development time types and interfaces, leading to first-class IDE support and powerful tools for understanding your code. Dojo 2 leverages TypeScript’s quarterly updates to help teams deliver code with clearer intent.</p><h4 id="Reactivity"><a href="#Reactivity" class="headerlink" title="Reactivity"></a>Reactivity</h4><p>Dojo 2 embraces functional reactive programming concepts, which have come a long way since Dojo 1’s early get/set methods and virtual scrolling grids. Dojo 2 supports a unidirectional data flow approach, where one can easily react to and/or observe changes to data.</p><h3 id="And-much-more…"><a href="#And-much-more…" class="headerlink" title="And much more…"></a>And much more…</h3><h4 id="Simple-OOTB"><a href="#Simple-OOTB" class="headerlink" title="Simple OOTB"></a>Simple OOTB</h4><p>Dojo 2 was conceptualized with the guiding principle that a developer could have a build up and running in seconds and modifying and deploying real apps in minutes. </p><h4 id="Widgets"><a href="#Widgets" class="headerlink" title="Widgets"></a>Widgets</h4><p>The Dojo 2 UI widget system provides a system for building Reactive, TypeScript Web Components. It leverages a Virtual DOM and HyperScript over templates or JSX and raw CSS and css-next over traditional preprocessors.</p><p>Its widget-scoped CSS classes and autocomplete make it easy to discover those classes for use within our widget code. It also provides a suite of out of the box widgets which are easily extensible including dgrid, charts and more.</p><h4 id="Roadmap"><a href="#Roadmap" class="headerlink" title="Roadmap"></a>Roadmap</h4><p>The <a href="https://github.com/dojo/meta/wiki/Roadmap" target="_blank" rel="noopener">Dojo 2 roadmap</a> highlights many of the details, but at a high level our goal is to release Dojo 2 later this year following 3 Beta releases and a release candidate phase.</p><h4 id="Community"><a href="#Community" class="headerlink" title="Community"></a>Community</h4><p>Though positioned to meet the needs of the enterprise, at its core, Dojo 2 will be focused on building a healthy open-source community that promotes growth, best practices and code stewardship to its users in an environment that embraces respect and inclusivity.</p><h4 id="Evaluate"><a href="#Evaluate" class="headerlink" title="Evaluate"></a>Evaluate</h4><p>Dojo 2’s Beta 1 release is intentional and focused.  We welcome you to explore Dojo 2 through our <a href="/tutorials">initial tutorials</a> and source code via <a href="https://github.com/dojo/meta" target="_blank" rel="noopener">Github</a>.</p>]]></content>
    
    <summary type="html">
    
      &lt;p&gt;Dojo 2 is the most substantial rethink to the Dojo Toolkit in ten years. As it nears Beta status for the majority of its modules, quite a bit has changed these past few months as it has evolved into a powerful solution for building enterprise applications.&lt;/p&gt;
&lt;img src=&quot;/blog/2017/03/27/Dojo-2-is-coming/featured.png&quot; title=&quot;feature-full&quot;&gt;
&lt;h2 id=&quot;A-new-generation&quot;&gt;&lt;a href=&quot;#A-new-generation&quot; class=&quot;headerlink&quot; title=&quot;A new generation&quot;&gt;&lt;/a&gt;A new generation&lt;/h2&gt;&lt;p&gt;Dojo 2 is a next generation framework authored to emphasize:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Efficiency.&lt;/strong&gt;  Code structure and developer ergonomics have been challenged at every turn resulting in impeccable code quality.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Longevity.&lt;/strong&gt;  Sustainable code that will last and adapt as the platform changes is a key consideration for large-scale development projects.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Modularity.&lt;/strong&gt;  Designed as a collection of packages that may be used independently or cooperatively, allowing for development flexibility.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Focus.&lt;/strong&gt; The focus is enterprise-driven, highlighting scalability as well as powerful, built-in features including support for large data sets, a11y and i18n.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
    
    </summary>
    
    
  </entry>
  
</feed>
