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

Use loose template literals to avoid bug in nft #149

Merged
merged 2 commits into from
Oct 12, 2022

Conversation

superdav42
Copy link
Contributor

vercel/nft#314

This PR will fix proskomma from breaking next js builds. The option is documented in https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose . I'm really not familiar with the downsides of using loose but the tests pass just fine. I'm guessing it has potential to break old browser or node versions but I couldn't find details on which ones may be affected.

@DanielC-N
Copy link
Collaborator

DanielC-N commented Oct 11, 2022

Hello,
For this, please see these ressources :

Try this babel.config.js and see if this solves the problem:

module.exports = {
  "assumptions": {
    "noDocumentAll": true,
    "pureGetters": true,
    "iterableIsArray": true,
    "ignoreToPrimitiveHint": true
  },
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": {
          "esmodules": true,
        },
        useBuiltIns: "entry",
        corejs: "3.25.1"
      }
    ],
  ],
};

I think what you're looking for is "ignoreToPrimitiveHint"

@mandolyte
Copy link
Collaborator

It did seem to get further, but after some minutes, it has not completed. Looks to be hung again. Here is the babel.config.js I have ended up with.

module.exports = {
  "assumptions": {
    "noDocumentAll": true,
    "pureGetters": true,
    "iterableIsArray": true,
    "ignoreToPrimitiveHint": true
  },
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": {
          "esmodules": true,
        },
        useBuiltIns: "entry",
        corejs: "3.25.1"
      }
    ],
    [ "@babel/preset-react"]
  ],
};

@superdav42
Copy link
Contributor Author

I think what you're looking for is "ignoreToPrimitiveHint"

Yes, that's exactly what we need. I just updated this PR to the config you proposed and it solved the problems we were having with the concat() chains.

@DanielC-N DanielC-N merged commit fcbe654 into mvahowe:master Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants