[4.0] Extract I18N interface without dependency on Polymer library
Closed this issue · 1 comments
t2ym commented
[4.0] Extract I18N interface without dependency on Polymer library
Status
- Part of t2ym/i18n-element#63
- WIP in 4.0-develop branch
- NPM package
npm install i18n-behavior@next
ornpm install i18n-behavior@4.0.0-pre.19
@polymer/polymer
as a peer dependency- Compatible with
i18n-element@^4.0.0-pre
- Not compatible with
i18n-element@3.0.0
Tasks
- Depend on
i18n-format@4.0.0-pre.*
- Remove Polymer dependency from
i18n-attr-repo
- Convert to a vanilla web component
- TBD
- Remove Polymer dependency from
i18n-preference
- Convert to a vanilla web component
- Remove
<iron-localstorage>
dependency fromi18n-preference
- Re-implement
"storage"
event handler for the vanilla web component - TBD
- Remove
<iron-ajax>
dependency fromI18nBehavior
- Extract Polymer-independent interfaces to
i18n-controller.js
- Move
@polymer/polymer
from dependencies to devDependencies - Drop Safari 9 support
- Documentation
- Decent comments
- API Docs page
- TBD
Design Issues
- Polymer dependency as an NPM package
- As all users of
I18nBehavior
should depend on@polymer/polymer
NPM package, it should be acceptable to move@polymer/polymer
fromdependencies
todevDependencies
-
@polymer/polymer
should be added topeerDependencies
i18n-element@4
package will depend oni18n-behavior@4
but Polymer library will NOT be installed nor loaded unless an Polymer element, which depends on@polymer/polymer
NPM package, importsi18n-element@4
ori18n-behavior@4
- This is not a normal configuration but should be practical
- There must be explicit documentation on this configuration to avoid any unexpected missing
@polymer/polymer
package errors
- As all users of
- Are
importMeta
properties fori18n-preference
andi18n-attr-repo
required? No
Issues
- Fail to import
I18nBehavior@4.0.0-pre.12
viaimport { I18nBehavior } from "i18n-behavior"
- Root Cause: the main module was changed to
i18n-controller.js
ini18n-behavior@4.0.0-pre.12
- Fix: The main module is reverted to
i18n-behavior.js
ati18n-behavior@4.0.0-pre.13
- Root Cause: the main module was changed to
t2ym commented
i18n-behavior.js
is the main module again at 4.0.0-pre.13
- Do not import
i18n-bahavior@4.0.0-pre.12
withimport { I18nBehavior } from "i18n-behavior"
omitting the script file name - The main module of
i18n-behavior@4.0.0-pre.12
isi18n-controller.js
i18n-behavior | Main Module | @polymer/polymer | Notes |
---|---|---|---|
4.0.0-pre.13 |
i18n-behavior.js |
peerDependencies |
|
4.0.0-pre.12 |
i18n-controller.js |
devDependencies |
No import "i18n-behavior" |
4.0.0-pre.11 |
i18n-behavior.js |
devDependencies |