i18next / i18next-xhr-backend

[deprecated] can be replaced with i18next-http-backend
https://github.com/i18next/i18next-http-backend
MIT License
253 stars 75 forks source link

Should not mark as deprecated #348

Closed fynncfchen closed 4 years ago

fynncfchen commented 4 years ago

🐛 Bug Report

I found this package should not marked as deprecated because the package i18next-http-backend doesn't work properly with Parcel.

To Reproduce

Reported to i18next-http-backend already: https://github.com/i18next/i18next-http-backend/issues/15

  1. Use Parcel as bundler with Babel
  2. Use i18next-xhr-backend for the first time on i18n.js
    import Backend from 'i18next-xhr-backend';
  3. Access website by Firefox 34, the website is working fine
  4. Change to use i18next-http-backend
    import Backend from 'i18next-http-backend';
  5. Open Firefox 34, got syntax error because of using module field on package.json then include some non-transpiled codes
    SyntaxError: missing ; before statement
  6. Use CJS version explicitly on i18n.js
    import Backend from 'i18next-http-backend/cjs';
  7. Open Firefox 34, got undefined error
    TypeError: global.fetch is undefined
  8. Use i18nextHttpBackend.js explicitly
    import Backend from 'i18next-http-backend/i18nextHttpBackend';
  9. Open Firefox 34, got undefined error
    TypeError: global.fetch is undefined

Expected behavior

Should not marked as deprecated package until the new replacement i18next-http-backend can work properly on Parcel.

Your Environment

adrai commented 4 years ago

https://github.com/i18next/i18next-http-backend/issues/15#issuecomment-640658009

gruckionvit commented 4 years ago

Hi Team, thank you for making this package. We are using it in our project. Can I just clarify why you are deprecating i18next-xhr-backend in favour for i18next-http-backend. We've done a little digging but haven't found why this is happening.

Is it just a name change?

Thank you for taking the time to respond to this.

adrai commented 4 years ago

i18next-xhr-backend was just using the XMLHttpRequest... so this was more or less a browser only module... i18next-http-backend is using the fetch api and if not there as fallback the XMLHttpRequest. And the way it is built, it's usable also in Node.js and Deno environment.

gruckionvit commented 4 years ago

i18next-xhr-backend was just using the XMLHttpRequest... so this was more or less a browser only module... i18next-http-backend is using the fetch api and if not there as fallback the XMLHttpRequest. And the way it is built, it's usable also in Node.js and Deno environment.

Nice update!, could you put this clarification at the top of the Readme's for both so it's clear for the next newbie?