Dojo
Docs Tutorials Cookbook Blog

modern web apps

  • Access drag information
  • Manage state in your application
  • Use built-in Dojo ponyfills

performance

  • Visualize your bundle contents

rendering

  • Access a raw DOM node
  • Get the rendered dimensions of an element
  • Use JSX templating

routing

  • Generate dynamic hyperlinks
  • Render URL aware widgets
  • Get the dynamic components of a URL from within a widget

styling

  • Style a built-in widget using themes
  • Create a themeable widget
  • Style a virtual DOM node with simple CSS classes

testing

  • Test and mock the imports of a widget

widgets

  • Discover all built-in Dojo 2 widgets
  • Handle string localization within a widget
  • Lazy load a widget
  • Pass and receive properties with widgets
  • Render a list from an array
  • Render a built-in Dojo 2 widget
  • Build an SVG chart
  • Force a widget to re-render itself
  • Allow a widget to receive additional properties in TypeScript

Objective

This recipe demonstrates how to use built-in Dojo ponyfills within your app. This recipe will focus on the Array.from ponyfill.

Procedure

  1. Import the Array.from function:
import { from } from '@dojo/shim/array';
  1. Use the imported function:
from('hello'); // ["h", "e", "l", "l", "o"]

Additional resources

  • Explanation on what a ponyfill is
  • Dojo Shim GitHub project
© 2018 JS Foundation, All Rights Reserved.