Browse Source

Merge pull request #2178 from blink1073/vdomwidget-rename

Rename VDomWidget -> VDomRenderer
Brian E. Granger 8 years ago
parent
commit
92df389f04

+ 2 - 2
packages/about-extension/src/widget.ts

@@ -10,7 +10,7 @@ import {
 } from '@phosphor/virtualdom';
 
 import {
-  VDomModel, VDomWidget
+  VDomModel, VDomRenderer
 } from '@jupyterlab/apputils';
 
 
@@ -298,7 +298,7 @@ namespace AboutModel {
  * A virtual-DOM-based widget for the About plugin.
  */
 export
-class AboutWidget extends VDomWidget<AboutModel> {
+class AboutWidget extends VDomRenderer<AboutModel> {
   /**
    * Handle `'activate-request'` messages.
    */

+ 5 - 5
packages/apputils/src/vdom.ts

@@ -26,7 +26,7 @@ import {
  * Phosphor widget that encodes best practices for VDOM based rendering.
  */
 export
-abstract class VDomWidget<T extends VDomWidget.IModel> extends Widget {
+abstract class VDomRenderer<T extends VDomRenderer.IModel> extends Widget {
   /**
    * A signal emited when the model changes.
    */
@@ -97,10 +97,10 @@ abstract class VDomWidget<T extends VDomWidget.IModel> extends Widget {
 
 
 /**
- * The namespace for VDomWidget statics.
+ * The namespace for VDomRenderer statics.
  */
 export
-namespace VDomWidget {
+namespace VDomRenderer {
   /**
    * An interface for a model to be used with vdom rendering.
    */
@@ -115,10 +115,10 @@ namespace VDomWidget {
 
 
 /**
- * Concrete implementation of VDomWidget model.
+ * Concrete implementation of VDomRenderer model.
  */
 export
-class VDomModel implements VDomWidget.IModel {
+class VDomModel implements VDomRenderer.IModel {
   /**
    * A signal emitted when any model state changes.
    */

+ 2 - 2
packages/csvviewer/src/table.ts

@@ -12,7 +12,7 @@ import {
 } from '@phosphor/virtualdom';
 
 import {
-  VDomModel, VDomWidget
+  VDomModel, VDomRenderer
 } from '@jupyterlab/apputils';
 
 
@@ -148,7 +148,7 @@ namespace CSVModel {
  * A CSV table content widget.
  */
 export
-class CSVTable extends VDomWidget<CSVModel> {
+class CSVTable extends VDomRenderer<CSVModel> {
   /**
    * Instantiate a new CSV table widget.
    */

+ 2 - 2
packages/faq-extension/src/widget.ts

@@ -10,7 +10,7 @@ import {
 } from '@phosphor/virtualdom';
 
 import {
-  ICommandLinker, VDomModel, VDomWidget
+  ICommandLinker, VDomModel, VDomRenderer
 } from '@jupyterlab/apputils';
 
 
@@ -152,7 +152,7 @@ class FaqModel extends VDomModel {
  * A virtual-DOM-based widget for the FAQ plugin.
  */
 export
-class FaqWidget extends VDomWidget<FaqModel> {
+class FaqWidget extends VDomRenderer<FaqModel> {
   /**
    * Construct a new faq widget.
    */

+ 2 - 2
packages/landing-extension/src/widget.ts

@@ -14,7 +14,7 @@ import {
 } from '@phosphor/virtualdom';
 
 import {
-  ICommandLinker, VDomModel, VDomWidget
+  ICommandLinker, VDomModel, VDomRenderer
 } from '@jupyterlab/apputils';
 
 
@@ -132,7 +132,7 @@ class LandingModel extends VDomModel {
  * A virtual-DOM-based widget for the Landing plugin.
  */
 export
-class LandingWidget extends VDomWidget<LandingModel> {
+class LandingWidget extends VDomRenderer<LandingModel> {
   /**
    * Construct a new landing widget.
    */

+ 2 - 2
packages/launcher/src/index.ts

@@ -18,7 +18,7 @@ import {
 } from '@phosphor/virtualdom';
 
 import {
-  ICommandLinker, VDomModel, VDomWidget
+  ICommandLinker, VDomModel, VDomRenderer
 } from '@jupyterlab/apputils';
 
 
@@ -177,7 +177,7 @@ class LauncherModel extends VDomModel implements ILauncher {
  * A virtual-DOM-based widget for the Launcher.
  */
 export
-class LauncherWidget extends VDomWidget<LauncherModel> {
+class LauncherWidget extends VDomRenderer<LauncherModel> {
   /**
    * Construct a new launcher widget.
    */

+ 3 - 3
test/src/apputils/vdom.spec.ts

@@ -10,7 +10,7 @@ import {
 } from '@phosphor/virtualdom';
 
 import {
-  VDomModel, VDomWidget
+  VDomModel, VDomRenderer
 } from '@jupyterlab/apputils';
 
 
@@ -27,7 +27,7 @@ class TestModel extends VDomModel {
   private _value = '';
 }
 
-class TestWidget extends VDomWidget<TestModel> {
+class TestWidget extends VDomRenderer<TestModel> {
   protected render(): VirtualNode {
     return h.span(this.model.value);
   }
@@ -71,7 +71,7 @@ describe('@jupyterlab/domutils', () => {
 
   });
 
-  describe('VDomWidget', () => {
+  describe('VDomRenderer', () => {
 
     describe('#constructor()', () => {
 

+ 4 - 4
tutorial/virtualdom.md

@@ -21,7 +21,7 @@ rendering following best practices. This API can be found in `common/vdom.ts`
 and offers two classes:
 
 * `VDomModel`
-* `VDomWidget`
+* `VDomRenderer`
 
 To use these classes, we recommend the following approach.
 
@@ -33,7 +33,7 @@ import {
 } from 'phosphor/lib/ui/vdom';
 
 import {
-  VDomModel, VDomWidget
+  VDomModel, VDomRenderer
 } from '../common/vdom'; // From another JupyterLab plugin
 ```
 
@@ -59,11 +59,11 @@ For each attribute that is part of your model, you will implement a `get` and `s
 method as we have done here for the `myvalue` attribute. All of the `set` methods
 in your model should end by calling `this.stateChanged.emit(void 0)`.
 
-Third, create a subclass of `VDomWidget` that has a `render()` method that uses Phosphor's
+Third, create a subclass of `VDomRenderer` that has a `render()` method that uses Phosphor's
 virtual DOM API and returns a PhosphorJS `VNode` or an array of them:
 
 ```typescript
-class TestWidget extends VDomWidget<TestModel> {
+class TestWidget extends VDomRenderer<TestModel> {
   protected render(): VNode | VNode[] {
     return h.span(this.model.myvalue);
   }