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

[Misc] babelrc config to make deployment a bit quieter #1237

Open
mrgum opened this issue Nov 4, 2023 · 5 comments
Open

[Misc] babelrc config to make deployment a bit quieter #1237

mrgum opened this issue Nov 4, 2023 · 5 comments

Comments

@mrgum
Copy link
Contributor

mrgum commented Nov 4, 2023

What's on your mind?
I deploy swb in codebuild as part of a code pipeline so I get the full logs rather than the scrolling thing you get in cli, there are hundreds, possibly thousands of lines like these repeated

addons/addon-base-ui/packages/base-ui build: Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-property-in-object since the "loose" mode option was set to "true" for @babel/plugin-proposal-class-properties.
addons/addon-base-ui/packages/base-ui build: The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding
addons/addon-base-ui/packages/base-ui build:    ["@babel/plugin-proposal-private-property-in-object", { "loose": true }]
addons/addon-base-ui/packages/base-ui build: to the "plugins" section of your Babel config.

This can be fixed by using .babelrc containing

{
  "plugins": [
    ["@babel/plugin-proposal-class-properties", { "loose": true }],
    ["@babel/plugin-proposal-private-methods", { "loose": true }],
    ["@babel/plugin-proposal-private-property-in-object", { "loose": true }]
  ],
  "presets": [
    "@babel/preset-react",
    ["@babel/preset-env", {
      "loose": true
    }]
  ]
}

PR on its way

I know little to nothing about react/babel etc so please can someone who does review :)

Versions (please complete the following information):

  • Release Version installed git mainline
@SanketD92
Copy link
Contributor

Thank you for reaching out. Your request has been added to our backlog for research computing solutions. Our
team curates these requests for fit with our solutions vision on a regular basis. Please watch this space for new
updates. If you require immediate assistance, please reach out to your AWS account team. Please note that
security issues should be reported directly to AWS Security at [email protected].

@mrgum
Copy link
Contributor Author

mrgum commented Nov 7, 2023

the babel config I used above breaks part of the UI and reading up I think loose set false is what should be used so either

{
  "plugins": [
    ["@babel/plugin-proposal-class-properties", { "loose": false }],
    ["@babel/plugin-proposal-private-methods", { "loose": false }],
    ["@babel/plugin-proposal-private-property-in-object", { "loose": false }]
  ],
  "presets": [
    "@babel/preset-react",
    ["@babel/preset-env", {
      "loose": false
    }]
  ]
}

or as false is the default

{
  "plugins": [
    "@babel/plugin-proposal-class-properties"
  ],
  "presets": [
    "@babel/preset-react", "@babel/preset-env"
  ]
}

@mrgum
Copy link
Contributor Author

mrgum commented Nov 7, 2023

I tried to find out why this was set in the first place but it seems to have been made in the initial commit. did the code live in another repo / versioning system prior to github?

@mrgum
Copy link
Contributor Author

mrgum commented Nov 8, 2023

I've failed to fix this properply, for now I will use grep to ignore the lines I do not want to see but if someone could fix usage of babel properly that would be great

@mrgum
Copy link
Contributor Author

mrgum commented Nov 23, 2023

I've upgraded to SWB 6.2.0 and the errors have moved from build to prepare and now refer to slightly different components

addons/addon-base-ui/packages/base-ui` prepare: Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-transform-private-methods since the "loose" mode option was set to "true" for @babel/plugin-transform-private-property-in-object.
addons/addon-base-ui/packages/base-ui prepare: The "loose" option must be the same for @babel/plugin-transform-class-properties, @babel/plugin-transform-private-methods and @babel/plugin-transform-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding
addons/addon-base-ui/packages/base-ui prepare:  ["@babel/plugin-transform-private-methods", { "loose": true }]
addons/addon-base-ui/packages/base-ui prepare: to the "plugins" section of your Babel config.
addons/addon-base-ui/packages/base-ui prepare: Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-transform-private-property-in-object since the "loose" mode option was set to "true" for @babel/plugin-transform-class-properties.
addons/addon-base-ui/packages/base-ui prepare: The "loose" option must be the same for @babel/plugin-transform-class-properties, @babel/plugin-transform-private-methods and @babel/plugin-transform-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding
addons/addon-base-ui/packages/base-ui prepare:  ["@babel/plugin-transform-private-property-in-object", { "loose": true }]

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

No branches or pull requests

3 participants