You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 30, 2018. It is now read-only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Convert widget-core to use TS2.2 class mixins instead of dojo/compose
There are a couple of interesting changes included
The baseTheme property for the Themeable mixin is set via a class decorator (@theme exported from Themeable)
The βresultβ from using the class Mixins requires a generic to define the Widgetβs properties class MyWidget extends ThemeableMixin(WidgetBase)<MyWidgetProperties> and excluding this does actually provide a pretty obscure error No base constructor has the specified number of type arguments. along with a few others.
Iβve removed the default export for all base, mixin and main classes in place of named exports (This is personal preference, so we can debate this potentially)
The constructor argument for any widget is now just properties, the WidgetOptions class/interface has been removed.
Allowed pascal casing for variables, mainly because the result can be a class in cases like const Projector = ProjectorMixin(Button);
Items to follow up on:
A generic solution for decorating the prototype with attributes, eg. provide an object bag from widget base that attributes get set to and then copied from for usage.
Decorators to add functions to a list used by widget base for "property specific diffs" and "render decorators". This will enable us to move away from strict regular expressions.
Need to check the order that "decorator" functions get applied, should work back up the inheritance chain.
agubler
changed the title
Converted Widgets to use TS2.2 Class Mixins over dojo/compose
Convert to use TS2.2 Class Mixins over dojo/compose
Feb 7, 2017
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
6 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type: feature
The following has been addressed in the PR:
Description:
Convert widget-core to use TS2.2 class mixins instead of
dojo/compose
There are a couple of interesting changes included
baseTheme
property for the Themeable mixin is set via a class decorator (@theme
exported from Themeable)class MyWidget extends ThemeableMixin(WidgetBase)<MyWidgetProperties>
and excluding this does actually provide a pretty obscure errorNo base constructor has the specified number of type arguments.
along with a few others.const Projector = ProjectorMixin(Button);
Items to follow up on:
Resolves #327