Skip to content

Commit

Permalink
Updating readme, updating a version to 0.4.0-rc
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Busłowicz committed Jul 7, 2017
1 parent 915fbc6 commit 4d96859
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
29 changes: 16 additions & 13 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,11 @@ If there is a namespace declared in the definitions, it will automatically upgra

#### Generating types for Polymer elements/behaviors
To generate the type declarations from existing behaviors/components, use the [potts](https://github.com/Draccoz/potts) tool.
Simply install it globally (`npm install potts -g`) and run `potts path/to/component.html`. Declarations will be saved under the `types`
directory by default (configurable via `--outDir` or `-d` flag). This will generate declarations for html module and all its dependencies.
Simply install it globally (`npm install potts -g`) and run `potts` in the project root directory. Declarations will be saved
to the `potts.d.ts` file by default (configurable via `--outFile` or `-o` flag). This will generate declarations for all html
files listen in `main` section of `bower.json` file of every bower dependency.
All modules will be declared to match the importable path (for example `bower:polymer/polymer.html`).

Further improvement of `potts` tool will generate types of every bower dependency installed via bower.

**For generating types out of internal components/behaviors please allow [this](https://github.com/Draccoz/twc/issues/48) issue to be resolved.**

### Documenting events
Every solid project should have a proper documentation. This also includes documenting events fired by the component. TWC lets you do it
with ease by creating an interface that extends `Event` or `CustomEvent`.
Expand Down Expand Up @@ -254,8 +251,16 @@ export class MyElement {
}
```

### Behaviors and Mixins
Work in Progress
### Mixins
ES Mixins are supported since TypeScript 2.2. You can read more about them [here](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html).

**Mixins are NOT supported by Polymer v1**

### Behaviors
Behaviors are the first approach to sharing functionality in Polymer (now replaced with ES Mixins). They are defined as plain
objects with Polymer properties and methods listed just as with Polymer v1 config object.
To add a behavior, use the `Polymer.mixinBehaviors()` mixin (more info [here](https://www.polymer-project.org/2.0/docs/upgrade#using-hybrid-behaviors-with-class-style-elements)).
For Polymer v1, they will be added to behaviors config, while Polymer v2 will use them with above mixin.

### Decorators
As mentioned before, not everything can be done with keywords. This is why TWC comes with a set of design-time annotations.
Expand Down Expand Up @@ -356,14 +361,12 @@ Typed Web Components is in an early phase and needs your feedback. Please try it
Also, do not hesitate to also post ideas!
## Roadmap
* Polymer v2 compile target
* Analysing included files on-the-fly to fetch namespaces and all the necessary details
* Make mixins and behaviors work properly
* Importing events interfaces (to avoid redeclaration
* Make relative imports not break if outDir changes the files structure
* Warn on using reserved property/method name (like `classList`)
* Allow expressions in the templates
* Importing events interfaces (to avoid redeclaration
* Make relative imports not break if outDir changes the files structure
* Generate valid source maps
* Create PolymerTS compatible decorators and workflow
## Running tests on Windows
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "twc",
"version": "0.3.1-beta.2",
"version": "0.4.0-rc",
"description": "Typed Web Components compiles pure TypeScript classes to native Polymer modules.",
"main": "./dist/cli.js",
"scripts": {
Expand Down

0 comments on commit 4d96859

Please sign in to comment.