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

Relay example: update Babel configs #2867

Merged
merged 2 commits into from
Aug 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions src/example-relay/.babelrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// @flow strict

module.exports = {
presets: ['@adeira/babel-preset-adeira', 'next/babel'],
/**
* test-bc script broke after upgrading some babel packages.
* Adding @babel/plugin-proposal-class-properties made it work, but it should not be necessary
* to add it here, since we already have it in @adeira/babel-preset-adeira.
* We need to leave it here for now for the test-bc script to work, but we should try
* to remove it in the future
*/
plugins: ['relay', '@babel/plugin-proposal-class-properties'],
presets: ['@adeira/babel-preset-adeira'],
// For some unknown reason, we have to specify here the `class-properties` Babel plugin explicitly
mrtnzlml marked this conversation as resolved.
Show resolved Hide resolved
// even though it's already part of `@adeira/babel-preset-adeira`. Seems like `next/babel` preset
// is somehow interfering with our preset because removing it fixes the issue as well.
//
// See: https://github.com/adeira/universe/issues/1854
plugins: ['relay'],
};
7 changes: 6 additions & 1 deletion src/example-relay/__github__/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ module.exports = function (api /*: ApiType */) /*: BabelConfig */ {

return {
presets: ['@adeira/babel-preset-adeira', 'next/babel'],
plugins: ['relay'],
// For some unknown reason, we have to specify here the `class-properties` Babel plugin explicitly
// even though it's already part of `@adeira/babel-preset-adeira`. Seems like `next/babel` preset
// is somehow interfering with our preset because removing it fixes the issue as well.
//
// See: https://github.com/adeira/universe/issues/1854
plugins: ['relay', '@babel/plugin-proposal-class-properties'],
};
};