Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/en/i18n/basic-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Starting off with a single default language (English).

```ts
import { WidgetBase } from '@dojo/framework/core/WidgetBase';
import { v } from '@dojo/framework/core/d';
import { v } from '@dojo/framework/core/vdom';

import I18nMixin from '@dojo/framework/core/mixins/I18n';
import myWidgetMessageBundle from '../nls/MyI18nWidget.en.ts';
Expand Down Expand Up @@ -89,7 +89,7 @@ Using the [i18n injector function](#providing-locale-data-to-i18n-aware-widgets)

```ts
import renderer from '@dojo/framework/core/vdom';
import { w } from '@dojo/framework/core/d';
import { w } from '@dojo/framework/core/vdom';
import Registry from '@dojo/framework/core/Registry';
import { registerI18nInjector } from '@dojo/framework/core/mixins/I18n';

Expand Down
10 changes: 5 additions & 5 deletions docs/en/i18n/supplemental.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ This can be imported and referenced within a widget such as:

```ts
import WidgetBase from '@dojo/framework/core/WidgetBase';
import { v } from '@dojo/framework/core/d';
import { v } from '@dojo/framework/core/vdom';
import I18nMixin from '@dojo/framework/core/mixins/I18n';

import myWidgetMessageBundle from '../nls/MyI18nWidget.en.ts';
Expand Down Expand Up @@ -196,7 +196,7 @@ export default {

```ts
import WidgetBase from '@dojo/framework/core/WidgetBase';
import { v, w } from '@dojo/framework/core/d';
import { v, w } from '@dojo/framework/core/vdom';
import I18nMixin from '@dojo/framework/core/mixins/I18n';
import Label from '@dojo/widgets/label';
import Button from '@dojo/widgets/button';
Expand Down Expand Up @@ -243,7 +243,7 @@ This mechanism is enabled through `registerI18nInjector`, a convenience method p

```ts
import renderer from '@dojo/framework/core/vdom';
import { w } from '@dojo/framework/core/d';
import { w } from '@dojo/framework/core/vdom';
import Registry from '@dojo/framework/core/Registry';
import { registerI18nInjector } from '@dojo/framework/core/mixins/I18n';

Expand Down Expand Up @@ -485,7 +485,7 @@ The `guestInfo` message can be rendered directly via `format`:

```ts
import WidgetBase from '@dojo/framework/core/WidgetBase';
import { v } from '@dojo/framework/core/d';
import { v } from '@dojo/framework/core/vdom';
import I18nMixin from '@dojo/framework/core/mixins/I18n';

import nlsBundle from '../nls/main';
Expand Down Expand Up @@ -586,7 +586,7 @@ The ICU-formatted `guestInfo` message can then be rendered as:

```ts
import WidgetBase from '@dojo/framework/core/WidgetBase';
import { v } from '@dojo/framework/core/d';
import { v } from '@dojo/framework/core/vdom';
import I18nMixin from '@dojo/framework/core/mixins/I18n';

import nlsBundle from '../nls/main';
Expand Down
2 changes: 1 addition & 1 deletion docs/en/ref-guide-template/basic-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ One line description of what this sample accomplishes, likely also [linking to m
```tsx
// fully working & copy/paste-able sample code content...
import WidgetBase from '@dojo/framework/core/WidgetBase';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';

export default class MyWidget extends WidgetBase {
protected render() {
Expand Down
2 changes: 1 addition & 1 deletion docs/en/ref-guide-template/supplemental.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Further subsections describing particular topics for a given feature. Possibly a
```tsx
// including fully-working embedded code snippets as further illustration
import WidgetBase from '@dojo/framework/core/WidgetBase';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';

export default class MyWidget extends WidgetBase {
protected render() {
Expand Down
14 changes: 7 additions & 7 deletions docs/en/routing/basic-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Then configure the application to be "routing" aware by registering the router w

```tsx
import renderer from '@dojo/framework/core/vdom';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';
import Registry from '@dojo/framework/core/Registry';
import { registerRouterInjector } from '@dojo/framework/routing/RouterInjector';

Expand All @@ -44,7 +44,7 @@ In the routing configuration the `home` route is associated with an outlet ident

```tsx
import WidgetBase from '@dojo/framework/core/WidgetBase';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';
import Outlet from '@dojo/framework/routing/Outlet';

export default class App extends WidgetBase {
Expand Down Expand Up @@ -79,7 +79,7 @@ The parameters values are injected into to matching `Outlets`'s `renderer` prope

```tsx
import WidgetBase from '@dojo/framework/core/WidgetBase';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';
import Outlet from '@dojo/framework/routing/Outlet';

export default class App extends WidgetBase {
Expand Down Expand Up @@ -110,7 +110,7 @@ export default [

```tsx
import WidgetBase from '@dojo/framework/core/WidgetBase';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';
import Outlet from '@dojo/framework/routing/Outlet';

export default class App extends WidgetBase {
Expand Down Expand Up @@ -181,7 +181,7 @@ In addition to the `Link` specific properties, all the standard `VNodeProperties

```tsx
import WidgetBase from '@dojo/framework/core/WidgetBase';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';
import { Link } from '@dojo/framework/routing/Link';

export default class App extends WidgetBase {
Expand All @@ -205,7 +205,7 @@ ActiveLink Properties:

```tsx
import WidgetBase from '@dojo/framework/core/WidgetBase';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';
import { ActiveLink } from '@dojo/framework/routing/ActiveLink';

export default class App extends WidgetBase {
Expand Down Expand Up @@ -267,7 +267,7 @@ With the routing configuration above the following example will generate 4 separ

```tsx
import WidgetBase from '@dojo/framework/core/WidgetBase';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';
import Outlet from '@dojo/framework/routing/Outlet';

import Home from './Home';
Expand Down
6 changes: 3 additions & 3 deletions docs/en/routing/supplemental.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export default [

```tsx
import WidgetBase from '@dojo/framework/core/WidgetBase';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';
import Outlet from '@dojo/framework/routing/Outlet';

export default class App extends WidgetBase {
Expand Down Expand Up @@ -394,7 +394,7 @@ const router = new Router(config, { HistoryManager: MemoryHistory });

```tsx
import renderer from '@dojo/framework/core/vdom';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';
import { registerRouterInjector } from '@dojo/framework/routing/RouterInjector';

import routes from './routes';
Expand All @@ -416,7 +416,7 @@ A special `outlet` called `errorOutlet` is registered for that will match when t

```tsx
import WidgetBase from '@dojo/framework/core/WidgetBase';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';
import Outlet from '@dojo/framework/routing/Outlet';

export default class App extends WidgetBase {
Expand Down
8 changes: 4 additions & 4 deletions docs/en/styling-and-theming/basic-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The application name becomes relevant when specifying [widget theme keys](./supp

```tsx
import WidgetBase from '@dojo/framework/core/WidgetBase';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';

import * as css from '../styles/MyWidget.m.css';

Expand All @@ -53,7 +53,7 @@ export default class MyWidget extends WidgetBase {
```tsx
import WidgetBase from '@dojo/framework/core/WidgetBase';
import ThemedMixin, { theme } from '@dojo/framework/core/mixins/Themed';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';

import * as css from '../styles/MyWidget.m.css';

Expand Down Expand Up @@ -122,7 +122,7 @@ export default {

```tsx
import renderer from '@dojo/framework/core/vdom';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';
import Registry from '@dojo/framework/core/Registry';
import { registerThemeInjector } from '@dojo/framework/core/mixins/Themed';

Expand All @@ -147,7 +147,7 @@ r.mount({ registry });
```tsx
import WidgetBase from '@dojo/framework/core/WidgetBase';
import ThemedMixin, { ThemeSwitcher, theme, UpdateTheme } from '@dojo/framework/core/mixins/Themed';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';

import myTheme from '../themes/MyTheme/theme';
import alternativeTheme from '../themes/MyAlternativeTheme/theme';
Expand Down
16 changes: 8 additions & 8 deletions docs/en/styling-and-theming/supplemental.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ This stylesheet can be used within a corresponding widget as follows:

```ts
import WidgetBase from '@dojo/framework/core/WidgetBase';
import { v } from '@dojo/framework/core/d';
import { v } from '@dojo/framework/core/vdom';

import * as css from '../styles/MyWidget.m.css';

Expand All @@ -66,7 +66,7 @@ Similarly, if using TSX widget syntax:

```tsx
import WidgetBase from '@dojo/framework/core/WidgetBase';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';

import * as css from '../styles/MyWidget.m.css';

Expand Down Expand Up @@ -188,7 +188,7 @@ For example, specifying a primary application theme:

```ts
import renderer from '@dojo/framework/core/vdom';
import { w } from '@dojo/framework/core/d';
import { w } from '@dojo/framework/core/vdom';
import Registry from '@dojo/framework/core/Registry';
import { registerThemeInjector } from '@dojo/framework/core/mixins/Themed';

Expand Down Expand Up @@ -348,7 +348,7 @@ This stylesheet can be used within a corresponding themeable widget as follows:
```ts
import WidgetBase from '@dojo/framework/core/WidgetBase';
import ThemedMixin, { theme } from '@dojo/framework/core/mixins/Themed';
import { v } from '@dojo/framework/core/d';
import { v } from '@dojo/framework/core/vdom';

import * as css from '../styles/MyThemeableWidget.m.css';

Expand Down Expand Up @@ -379,7 +379,7 @@ Similarly, if using TSX widget syntax:
```tsx
import WidgetBase from '@dojo/framework/core/WidgetBase';
import ThemedMixin, { theme } from '@dojo/framework/core/mixins/Themed';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';

import * as css from '../styles/MyThemeableWidget.m.css';

Expand Down Expand Up @@ -424,7 +424,7 @@ Extending the above example:
```tsx
import WidgetBase from '@dojo/framework/core/WidgetBase';
import ThemedMixin, { theme } from '@dojo/framework/core/mixins/Themed';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';

import * as commonCss from '../styles/MyThemeCommonStyles.m.css';
import * as css from '../styles/MyThemeableWidget.m.css';
Expand Down Expand Up @@ -471,7 +471,7 @@ export default {
```tsx
import WidgetBase from '@dojo/framework/core/WidgetBase';
import ThemedMixin, { theme } from '@dojo/framework/core/mixins/Themed';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';

import MyThemeableTsxWidget from './src/widgets/MyThemeableTsxWidget.tsx';

Expand Down Expand Up @@ -533,7 +533,7 @@ As an example of providing extra classes, the following tweaks an instance of a

```tsx
import WidgetBase from '@dojo/framework/core/WidgetBase';
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';

import ComboBox from '@dojo/widgets/combobox';

Expand Down
2 changes: 1 addition & 1 deletion src/core/Container.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { WidgetBase } from './WidgetBase';
import { inject, GetProperties } from './decorators/inject';
import { Constructor, DNode, RegistryLabel } from './interfaces';
import { w } from './d';
import { w } from './vdom';
import { alwaysRender } from './decorators/alwaysRender';

export type Container<T extends WidgetBase> = Constructor<WidgetBase<Partial<T['properties']>>>;
Expand Down
12 changes: 6 additions & 6 deletions src/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ To display your new component in the view you will to use the `renderer` from th

```ts
import renderer from '@dojo/framework/core/vdom';
import { w } from '@dojo/framework/core/d';
import { w } from '@dojo/framework/core/vdom';

const r = renderer(() => w(HelloDojo, {}));
r.mount();
Expand Down Expand Up @@ -109,7 +109,7 @@ You can target this Element:

```ts
import renderer from '@dojo/framework/core/vdom';
import { w } from '@dojo/framework/core/d';
import { w } from '@dojo/framework/core/vdom';

const root = document.getElementById('my-app');
const r = renderer(() => w(HelloDojo, {}));
Expand Down Expand Up @@ -260,7 +260,7 @@ To resolve this, the list item can be extracted into a separate widget:

```ts
import { WidgetBase } from '@dojo/framework/core/WidgetBase';
import { v, w } from '@dojo/framework/core/d';
import { v, w } from '@dojo/framework/core/vdom';

interface ListItemProperties {
id: string;
Expand Down Expand Up @@ -809,7 +809,7 @@ A main registry can be provided to the `renderer`, which will be automatically p

```ts
import { Registry } from '@dojo/framework/core/Registry';
import { w } from '@dojo/framework/core/d';
import { w } from '@dojo/framework/core/vdom';

import MyWidget from './MyWidget';
import MyAppContext from './MyAppContext';
Expand Down Expand Up @@ -1119,7 +1119,7 @@ This example renders a list with images, the image src is only added when the it

```ts
import { WidgetBase } from '@dojo/framework/core/WidgetBase';
import { v, w } from '@dojo/framework/core/d';
import { v, w } from '@dojo/framework/core/vdom';
import { DNode } from '@dojo/framework/core/interfaces';
import { Intersection } from '@dojo/framework/core/meta/Intersection';

Expand Down Expand Up @@ -1457,7 +1457,7 @@ Include `.tsx` files in the project:
Once the project is configured, `tsx` can be used in a widget's `render` function simply by importing the `tsx` function as:

```ts
import { tsx } from '@dojo/framework/core/tsx';
import { tsx } from '@dojo/framework/core/vdom';
```

```tsx
Expand Down
8 changes: 7 additions & 1 deletion src/core/Registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
RenderResult,
WidgetBaseTypes
} from './interfaces';
import { isWNodeFactory } from './d';

export type RegistryItem =
| WidgetBaseConstructor
Expand Down Expand Up @@ -104,6 +103,13 @@ export function isWidgetFunction(item: any): item is Callback<any, any, RenderRe
return Boolean(item && item.isWidget);
}

export function isWNodeFactory<W extends WidgetBaseTypes>(node: any): node is WNodeFactory<W> {
if (typeof node === 'function' && node.isFactory) {
return true;
}
return false;
}

export function isWidget<T extends WidgetBaseInterface = any>(
item: any
): item is Constructor<T> | Callback<any, any, RenderResult> {
Expand Down
3 changes: 1 addition & 2 deletions src/core/WidgetBase.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Map from '../shim/Map';
import WeakMap from '../shim/WeakMap';
import { v } from './d';
import { auto } from './diff';
import {
AfterRender,
Expand All @@ -20,7 +19,7 @@ import NodeHandler from './NodeHandler';
import { WIDGET_BASE_TYPE } from './Registry';
import { Handle } from '../core/Destroyable';
import { Base } from './meta/Base';
import { widgetInstanceMap } from './vdom';
import { widgetInstanceMap, v } from './vdom';

interface ReactionFunctionConfig {
propertyName: string;
Expand Down
Loading