Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Remove hypnosphi polyfill #435

Open
wants to merge 4 commits into
base: v1.x
Choose a base branch
from

Conversation

yuri-scarbaci-lenio
Copy link

I'm not sure how to properly build/test the project locally, I ran yarn test:jest and it worked, but running yarn build:demo would output an unexpected error about parcel and a duplicate plugin


If you'd like to use two separate instances of a plugin,
they need separate names, e.g.

  plugins: [
    ['some-plugin', {}],
    ['some-plugin', {}, 'some unique name'],
  ]

Duplicates detected are:
[
  {
    "alias": "/foobar/react-popper/node_modules/@babel/plugin-proposal-class-properties/lib/index.js",
    "dirname": "/foobar/react-popper",
    "ownPass": false,
    "file": {
      "request": "@babel/proposal-class-properties",
      "resolved": "/foobar/react-popper/node_modules/@babel/plugin-proposal-class-properties/lib/index.js"
    }
  },
  {
    "alias": "base$3",
    "options": {
      "loose": "#__internal__@babel/preset-env__prefer-false-but-true-is-ok-if-it-prevents-an-error"
    },
    "dirname": "/foobar/react-popper",
    "ownPass": false
  }
]

nonetheless, the change should be straigth-forward,
it's about removing a polyfill https://www.npmjs.com/package/@hypnosphi/create-react-context that is creating problems in modern project due to it not compiling/defining esm module in package.json, this can usually be fixed via Aliases in project, but code-sandbox has no solution to this problem, as a result when trying to use react-popper 1.3.11 in a code-sandbox we get an error
image

I'm going to test this out in the project I'm working on and see if everything works as expected, if someone can provide some additional instroction on how I can make it work with flow/parcel and test it out as intended, it would be really appreciated!

N.B. I bumped the version to 1.4 because removing the polyfill could be potentially breaking for some project that are using react < 16 and depending on it...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants