t2ym/i18n-format

[4.0] Remove dependency on Polymer library

Closed this issue · 0 comments

t2ym commented

[4.0] Remove dependency on Polymer library

Status

  • Part of t2ym/i18n-element#63
  • WIP in 4.0-develop branch
  • NPM package
    • npm install i18n-format@next or npm install i18n-format@4.0.0-pre.13
      • Depends on i18n-number@4.0.0-pre, wc-putty@0.1.0, lit-html@^1.0.0, make-plural@^4.3.0

Tasks

  • Move @polymer/polymer from dependencies to devDependencies
  • Drop Safari 9 support
  • bower.json with BSD-2-Clause as license
  • Add lit-html dependency
  • Convert to lit-html rendering
    • Remove @polymer/polymer imports
    • Convert properties and observers
  • Make these properties read-only
    • paramAttribute is slot
    • paramFormat is {n}
    • observeParams is true
      • Dummy setter for observeParams
  • Support IE11 and Edge with custom elements v1 polyfill
    • Import a separate polyfill.js from an independent npm module for polyfill.js
      • Import npm package wc-putty
  • Convert tests
    • No Polymer methods
    • Adjust some waits
  • Convert demo
    • Remove intl from extraDependencies in polymer.json
  • Documentation
    • Decent comments
    • API Docs page

Design Issues

  • root property for shadowRoot to imitate a Polymer element
  • Is importMeta property necessary? No

Issues

  • document.createElement('i18n-format') fails with "The result must not have attributes"
    • Fix: Put off setting this.lang in the constructor to connectedCallback()
  • Calling of _setupParams() is too early to collect the expected parameters in the local DOM
    • Fix: Put off this._setupParams() to connectedCallback()
  • ShadyDOM misinterprets target of direct node.appendChild() as shadowRoot
    • Root Cause: If shadowRoot is attached, ShadyDOM unexpectedly performs appendChild() to shadowRoot instead of the node's local DOM
    • Fix: Put off attachShadow() to the first rendering