Giter Club home page Giter Club logo

parade's Introduction

@dojo/parade

A library to show off your widget library.

  • Show running demos
  • Syntax highlighted example code
  • Auto documented widget properties
  • Auto documented theme class hooks
  • Run on codesandbox
  • Run unit tests

screenshot

Compatibility

Each major release of Dojo Parade is compatible with a specific major version of the rest of the Dojo framework:

Parade Version Dojo Version
1.*.* 7.*.*

Usage

npm install @dojo/parade

.dojorc

{
	"extends": "./node_modules/@dojo/parade/parade.json"
}

main.tsx

import parade from '@dojo/parade';

// import your parade config
import config from './config';

parade({ config });

Example global config:

config.tsx

import dojoTheme from '@dojo/themes/dojo';
import '@dojo/themes/dojo/index.css';

import BasicAccordion from './widgets/accordion/Basic';
import BasicButton from './widgets/button/Basic';
import DisabledSubmit from './widgets/button/DisabledSubmit';
import ToggleButton from './widgets/button/ToggleButton';

const tests = (require as any).context('./', true, /\.spec\.ts(x)?$/);

export default {
  header: 'My Widget Library',
  codesandbox: {},
  tests,
  themes: [ dojoTheme ]

Example local config:

AccordionBasic.example.tsx

import dojoTheme from '@dojo/themes/dojo';
import '@dojo/themes/dojo/index.css';

import AccordionBasic from './widgets/accordion/Basic';

export default {
	module: AccordionBasic,
	overview: true
};

parade's People

Contributors

bitpshr avatar jameslmilner avatar maier49 avatar matt-gadd avatar rorticus avatar tomdye avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

parade's Issues

Fix the menus on mobile

None of the menu's currently show on mobile, we should pick a pattern such as the horizontal scrolling or hamburger menu and implement

Support configuration-based sidebar groupings

The current Parade configuration generates a left-hand navigation menu based on the configured widget names, but there's no way to group these widget names, e.g. "Layout Widgets", "Form Widgets", etc.

It may be nice to support more advanced menu configuration, especially to-level menu groupings.

Document widget properties to include properties from middleware and mixins

At the moment widget properties are documented using a convention to find the properties interface. This means that expected properties that are decorated by middleware of mixins need to explicitly added to the widget properties by extending the appropriate interfaces.

We need to change parade to be able to determine the "complete" widget properties interface without needing to use extends each or the interfaces.

Support grouping examples

It would be nice for things such as form widgets or other types of widgets to be able to group them in the menu. this could be done in the config physically or by some kind of tag.

Add support for description to examples

It would be nice to be able to include a description with each example. A simple solution could be a description property alongside filename and module on the example config object. A more robust solution could be a descriptionFilename property that renders the named markdown file.

z-index on title is set to 1000!important

The title bar is set to z-index: 1000!important which causes the SidePane widget to be underlayed beneath it. Is there a reason this is set so high? The class is also call z-100 which leads me to think maybe this was a typo?

line in question:

z-index: 1000 !important;

Screenshot_20200110_183308

Routes should set page title

The routes should define page titles so the tab title and browser history don't say "examples" on every page.

Browser history list

Search by widget name

In projects with many widgets (even Dojo itself right now) it can be tedious to quickly find a specific widget. It would be nice to support search (maybe an input above the menu items) that is auto-focused on page load.

Tailwind's Reset-Css is effecting styling of examples

When creating examples using parade, the css-reset loading by tailwind is leaking into the examples and effecting their appearance. For example; buttons have their borders etc removed by the reset-css so any buttons within an example will have no borders.

Support GitHub linking

I feel like it's common for the widgets developed within a Parade-like environment to also live within GitHub for most consumers. It would be nice to support linking between a GitHub repository and a given Parade instance. This would allow users to click "edit" buttons on examples, for instance, which would take the user to GitHub to fork the repository, etc. This could most likely be driven through configuration.

Help discoverability of `theme.compose` usage with prefix

When theme.compose (@dojo/widgets/middleware/theme NOT in framework) is used to compose themes together with a prefix these classes are not added to the widget classes list in parade.
It would be useful if parade could detail the widgets that can be targeted within a widget via a prefix.
For example, the @dojo/widgets/typeahead uses a menu prefix for the List that it renders but this is not very discoverable unless you look at the code itself.

Consider using local, per-widget configuration files

Parade is currently configured using a single configuration file. This configuration object can get complex, and issues are open to potentially expand the support configuration schema. For reference, the current widgets Parade configuration is over 2100 lines long for 68 widgets.

It would be nice to support local configuration files using a .example.ts suffix, similarly to how test files use an auto-detected .spec.ts extension. This would reduce the size of the global configuration file (which may still be required for settings that are actually global), would increase maintainability, and would be symmetrical with how we currently handle testing.

Add documentation of i18n keys

It would be useful if parade documented the i18n keys used within a widget as it does with properties and children.
This would aid discovery and make it easier for users to pass a different i18nBundle to a widget.

Refreshing parade when deep linked throws error

When serving parade examples in watch / serve mode and refreshing the page after a build when on a deep link ie. http://localhost:9999/#widget/date-input/overview the following error can often been seen:

Example.tsx:73 Uncaught TypeError: Cannot destructure property 'properties' of 'widgetProperties[widgetName]' as it is undefined.
    at Example (Example.tsx:73)
    at _createWidget (vdom.ts:2107)
    at _processOne (vdom.ts:1979)
    at _process (vdom.ts:1953)
    at _runProcessQueue (vdom.ts:1747)
    at _runInvalidationQueue (vdom.ts:1719)
    at vdom.ts:1655

Run the examples themselves in an iframe

At the moment it's possible for an example to a) error and break the entirety of parade b) render things unusually outside of where you'd expect ie the example box (for example a snackbar, slidepane etc). We should try and render the example itself in an iframe, like we already do for the tests

Fix key warnings

A number of repeated elements and widgets are not keyed which throws warnings in the console

Support collapsible code panes

The examples are very useful right now, but there's no way to collapse the code pane for what you're currently viewing. Especially if we implement "fullscreen mode" #79, which would further make Parade a development platform as opposed to just a showcase, collapsible panes would also allow the user to "hide" example code they don't care about (especially if they're already working on it locally.)

Support preselected screen sizes

I find myself opening dev tools when using Parade to imitate various screen sizes, especially when using Parade as a development platform. It would be nice to allow examples to be "resized" instantly by clicking on a predetermined "size", e.g. "phone", "tablet", etc. This would only resize the example frame to a predetermined dimension.

Feature Request : Keys

Hello,

a quick feature request for this fantastic thing.

User story :
People want to extend widgets with own CSS declarations.
They need to know which keys for which nodes are present for "extra classes" โ€ฆ

Currently parade shows tables for e.g. Properties, Children, Theme โ€“
how about "Keys" ?

Custom Elements support

It would be nice if we could show widgets being used as Custom Elements in the documentation. I'm not sure how possible this would be for the actual examples, beyond "basic" but even having them work as basic would be nice.

Enhance menu navigation

Currently, Parade uses a two-menu navigation approach in which the left navigation menu renders example widget names, and the right navigation menu renders example names and theme variations. As a result, we're losing out on ~400 pixels of screen real estate that's mostly blank on the right side of examples.

It may be nice to improve how Parade lays out its navigation menus:

  • Expand widget names on-click to show example names as accordion children to the widget name.
  • Move theme selection into the header.
  • Remove the right navigation menu altogether.

Add locale switcher

It would be nice to be able to demonstrate i18n locale switching in the widgets.

Make section/widget menu vertical on desktop

Current menu for sections/widgets does not scroll very easily on desktop as the headers overflow off the screen. For desktop size screens the menu should be shifted to a left side menu to help with navigation.

Based on changes made in dojo/site#183

Improve property interface rendering

Parade renders property interfaces (which is awesome) but we do not get code highlighting, which can make them difficult to grok. It would be nice to highlight these too.

Codesandbox link is not configurable

The codesandbox link is currently non configurable (it's hardcoded to dojo/widgets). We should provide support for specifying this in the config and disable/remove it if not configured.

Support full screen mode

In order for Parade to better serve as a drop-in widget development frontend (outside the scope of a given application, which can be tedious to get running), it may be nice to support full-screen mode for each example. This would allow developers to hide all unnecessary chrome and to focus solely on the UI they are tweaking.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.