Support Polymer 3.0 + NPM
We should publish these decorators in their module form (i.e., without the Polymer.decorators global generated files) on NPM, so that they can be used with Polymer 3.0, and we should add instructions to the README demonstrating how to install and use them.
The polymer-decorators package on NPM is already taken by https://github.com/Cu3PO42/polymer-decorators, so we can use @polymer/decorators instead.
We'll also need to distribute Polymer 3.0 type declarations before this will be fully usable, which will require some additional work in https://github.com/Polymer/gen-typescript-declarations.
Support Polymer 3.0 + NPM
Is there any progress?
Polymer 3 with polymer-decorators works normally. Grieving absence in npm 😔
Use same for implement:
CMD
@echo off
cd ./node_modules/@polymer/decorators
npm install & npm run build & rd /s /q "./node_modules"
Bash
#!/bin/bash
cd ./node_modules/@polymer/decorators;
npm install;
npm run build;
rm -rf ./node_modules;
Polymer 3 with polymer-decorators works normally.
Hmm, how did you deal with typings? The decorators require that they are applied to something that extends Polymer.Element, which doesn't exist with Polymer 3 because it's exported from a module instead of being in a global namespace.
Typings from Polymer 2 (They are alike)
For example my 404 component:
import {
PolymerElement,
html,
} from '@polymer/polymer/polymer-element'
import {
customElement,
property,
} from '@polymer/decorators'
import * as view from './template.pug'
@customElement('app-404')
export default class AppNotFound extends (PolymerElement as new () => Polymer.Element) {
public static get template() {
return html([view()])
}
}
Grettings aomarks, polymer team is working for "Support Polymer 3.0 + NPM" on polymer-decorators or not? If yes, how we know the progress? Please i need a answer for this.
In the meantime, this fork mays interest you. https://www.npmjs.com/package/darkengines-polymer3-decorators
AFAIK it is enough to build polymer 3 elements, just send PR if you want to improve.
https://www.npmjs.com/package/@polymer/decorators for Polymer 3.0 is now published