Registry / web-framework / polymer-transpiler

polymer-transpiler

JSON →
library1.1.4-alphajsnpmunverified

Polymer 1 to Polymer 2 transpiler that converts Polymer function-based elements into ES6 class syntax. Current version is 1.1.4-alpha, released as an unstable alpha with frequent breaking changes. It provides a CLI tool to search and transpile components, allowing customization of base class. Differentiators: specific focus on Polymer 1→2 migration, simple CLI usage, but no other major features or community support.

npm install polymer-transpiler
INSTALL
IMPORT
SIG · POLYMER-TRANSPILER
P
polymer-transpiler
web-frameworkjavascriptv1.1.4-alpha
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import polymerTranspiler from 'polymer-transpiler'
const polymerTranspiler = require('polymer-transpiler')
Package is ESM-only, no CommonJS export.
transpile
import { transpile } from 'polymer-transpiler'
const { transpile } = require('polymer-transpiler')
Named export for programmatic use.
PolymerTranspiler
import PolymerTranspiler from 'polymer-transpiler'
import { PolymerTranspiler } from 'polymer-transpiler'
Default export is the class.

Transpile a Polymer 1 element string to Polymer 2 class syntax

import polymerTranspiler from 'polymer-transpiler'; // Example: transpile a single Polymer 1 element file const input = ` <dom-module id="my-element"> <template><span>{{text}}</span></template> <script> Polymer({ is: 'my-element', properties: { text: { type: String } } }); </script> </dom-module> `; const output = polymerTranspiler.transpile(input, { extends: 'Polymer.Element' }); console.log(output); // Output will be ES6 class extending Polymer.Element
polymer-transpiler --version
Debug
Known issues
breakingCLI name changed from 'poly-transpiler' to 'polymer-transpiler' in v1.1.0-alpha
fix
Update scripts and references to use 'polymer-transpiler' instead of 'poly-transpiler'
affects: >=1.1.0-alpha <1.1.0
deprecatedPolymer itself is deprecated; this transpiler is only relevant for legacy codebases
fix
Migrate to modern web component frameworks (Lit, etc.)
affects: >=0
gotchaAlpha stability: anything can change, no semver in alpha, may break without notice
fix
Pin to a specific version and test thoroughly before using in production
affects: <1.0.0
Errors
Common errors & fixes
Cannot find module 'polymer-transpiler'
Package not installed globally or missing from node_modules
fix
Run: npm install -g polymer-transpiler
TypeError: polymerTranspiler.transpile is not a function
Incorrect import or using default import as named object
fix
Use: import polymerTranspiler from 'polymer-transpiler' then call polymerTranspiler.transpile()
Error: The specified path does not contain Polymer components
CLI path option points to a directory without Polymer 1 elements
fix
Provide a valid path with .html files containing Polymer({}) calls
Upgrade
Version history
1.1.4-alphalatest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
polymer-transpiler — npm install polymer-transpiler · libregistry