Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should not mark as deprecated #348

Closed
fynncfchen opened this issue Jun 8, 2020 · 4 comments
Closed

Should not mark as deprecated #348

fynncfchen opened this issue Jun 8, 2020 · 4 comments

Comments

@fynncfchen
Copy link

🐛 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: i18next/i18next-http-backend#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';
  1. Access website by Firefox 34, the website is working fine
  2. Change to use i18next-http-backend
import Backend from 'i18next-http-backend';
  1. Open Firefox 34, got syntax error because of using module field on package.json then include some non-transpiled codes
SyntaxError: missing ; before statement
  1. Use CJS version explicitly on i18n.js
import Backend from 'i18next-http-backend/cjs';
  1. Open Firefox 34, got undefined error
TypeError: global.fetch is undefined
  1. Use i18nextHttpBackend.js explicitly
import Backend from 'i18next-http-backend/i18nextHttpBackend';
  1. 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

  • runtime version: Firefox 34
  • i18next version: ^19.0.1
  • os: Mac
  • package.json
{
  "dependencies": {
    "@babel/runtime": "^7.7.6",
    "core-js": "^3.6.4",
    "i18next": "^19.0.1",
    "i18next-browser-languagedetector": "^4.0.1",
    "i18next-chained-backend": "^2.0.0",
    "i18next-http-backend": "^1.0.15",
    "i18next-localstorage-backend": "^3.0.0",
    "i18next-xhr-backend": "^3.2.2",
    "react": "^16.12.0",
    "react-i18next": "^11.2.5"
  },
  "devDependencies": {
    "@babel/core": "^7.7.4",
    "@babel/plugin-transform-runtime": "^7.7.6",
    "@babel/preset-env": "^7.7.4",
    "@babel/preset-react": "^7.7.4",
    "babel-loader": "^8.0.6",
    "babel-plugin-module-resolver": "^3.2.0",
    "parcel-bundler": "^1.12.4"
  }
}
  • .babelrc
{
  "presets": [
    ["@babel/preset-env", { "useBuiltIns": "entry", "corejs": "3" }],
    "@babel/preset-react"
  ],
  "plugins": [
    "@babel/plugin-transform-runtime"
  ]
}
  • .browserslistrc
Firefox 34
@adrai adrai closed this as completed Jun 8, 2020
@gruckionvit
Copy link

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
Copy link
Member

adrai commented Jul 23, 2020

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
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants