andreasbm / lit-translate

A blazing-fast and lightweight internationalization (i18n) library for your next web-based project
https://codepen.io/andreasbm/pen/MWWXPNO?editors=1010
MIT License
137 stars 14 forks source link

Feature request: Upgrade to lit-html 2.0 #22

Open dflorey opened 3 years ago

dflorey commented 3 years ago

...using new Directive class :-)

christophe-g commented 3 years ago

@andreasbm - just interested to know if this is somehow in a tentative pipeline, now that lit 2.0 is at release candidate stage ?

Thanks a lot, even if the answer is no!

P.S. I am aware that lit now offers localization (https://lit.dev/docs/libraries/localization/), but I prefer lit-translate approach allowing to handle localization files in JSON.

andreasbm commented 3 years ago

I'm super excited about the new Directive class! 🌞 I plan on upgrading the library to lit v2 during the next weekend 👍

christophe-g commented 3 years ago

Oh, that is great - indeed, lit 2 all together is super exciting !

inureyes commented 3 years ago

👍 Thank you. Looking forward to the release.

andreasbm commented 2 years ago

I have now released lit-translate with lit 2 as a release candidate 👍 You can install it with npm i lit-translate@next - when lit 2 is officially released I will release this version as well 🌞

Mateozmaldonado17 commented 2 years ago

Greeat !!! i'm excite for this new version

mhmo91 commented 2 years ago

@andreasbm any updates when this will be a stable release? lit 2 is official now

jonnenauha commented 2 years ago

Hi @andreasbm any change you could do official 2.0.0 release with the lit v2 branch at some point. I'm getting this warning from webpack duplicate detection plugin.

WARNING in lit
  Multiple versions of lit found:
    2.0.0-rc.2 ./~/lit-translate/~/lit
    2.1.2 ./~/lit

Looks like that branch has dep to "latest" lit. But at the time when you did lit-translate@2.0.0-rc.1 i guess that was lit@2.0.0-rc.2.

The package-lock.json also in that branch has the lit@2.0.0-rc.2 reference.

I'm not too familiar with npm publishing but i would recond you reinstall latest lit so package-lock.json gets fixed to 2.x.x when make official 2.0.0 npm release for lit-translate.

Edit: App build looks to work fine. I think the downside of this is the app is loading lit two times. Once for lit translate and once for everything else. So even if not causing issues it bloats the build unnecessarily.

using npm v8 here is relevant part from my apps lock file

    "node_modules/lit-translate": {
      "version": "2.0.0-rc.1",
      "resolved": "https://registry.npmjs.org/lit-translate/-/lit-translate-2.0.0-rc.1.tgz",
      "integrity": "sha512-8r7MK4OuFoUis41RHS4pFxIuCKn8K/nBdhJKdcnCeD+2MEH0Wg2oiaodYxK6cYcyzc0dFGf1+a/32r4Ym7A/cg==",
      "dependencies": {
        "lit": "2.0.0-rc.2"
      }
    },
    "node_modules/lit-translate/node_modules/lit": {
      "version": "2.0.0-rc.2",
      "resolved": "https://registry.npmjs.org/lit/-/lit-2.0.0-rc.2.tgz",
      "integrity": "sha512-BOCuoJR04WaTV8UqTKk09cNcQA10Aq2LCcBOiHuF7TzWH5RNDsbCBP5QM9sLBSotGTXbDug/gFO08jq6TbyEtw==",
      "dependencies": {
        "@lit/reactive-element": "^1.0.0-rc.2",
        "lit-element": "^3.0.0-rc.2",
        "lit-html": "^2.0.0-rc.3"
      }
    },
peschee commented 2 years ago

@andreasbm Would you be interested in allowing others to help with the maintenance of this library?

nicolasr75 commented 2 years ago

Shouldn't this issue be closed? I somehow stumbled over this and thought lit-translate would still be on v1 but then fortunately noticed in the releases section that v2 is already out :-)