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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add extends config loading support #977

Open
huntie opened this issue May 10, 2023 · 3 comments 路 May be fixed by #1212
Open

Feature: Add extends config loading support #977

huntie opened this issue May 10, 2023 · 3 comments 路 May be fixed by #1212
Labels
馃憢馃徎 Good First Issue An issue or task that is ideal for new open source contributors. Type: Feature Request

Comments

@huntie
Copy link
Member

huntie commented May 10, 2023

馃憢馃徎 Good First Issue

  • An issue or task that is ideal for new open source contributors.
  • Please reach out to the issue creator before claiming an issue to discuss design.

Description

We'd like Metro's configuration to accept an extends key, similar to other tools such as ESLint and TypeScript.

This would benefit Metro users in enabling a more convenient and concise API that abstracts away the need for mergeConfig() today.

// metro.config.js
module.exports = {
  extends: ['@react-native/metro-config'],
  ...
};

Related context:

Rough design

The implementation for this feature should live in the metro-config package.

  • Update the relevant MetroConfig type constituents to add extends?: $ReadOnlyArray<string>.
  • Update loadMetroConfigFromDisk to read extends if present.
    • For each value in extends, attempt to require the config path relative to the filepath of the input config file, and apply the imported object in order via mergeConfig().
    • Throw an error if a config path cannot be resolved.
  • Add one or more test cases in packages/metro/src/integration_tests/.
  • Update documentation to illustrate usage of this feature.
@huntie huntie added Type: Feature Request 馃憢馃徎 Good First Issue An issue or task that is ideal for new open source contributors. labels May 10, 2023
@CaioFernandoDev
Copy link

CaioFernandoDev commented Jun 17, 2023

Hey @huntie, I would love to work on this feature. I am new to this repo, but I think I can do this.

@huntie
Copy link
Member Author

huntie commented Jun 20, 2023

Hi @CaioFernandoDev! Awesome, please reach out if you have any questions 鈥斅爀ither here, or feel free to DM me on Twitter.

@antongolub
Copy link

antongolub commented Feb 6, 2024

As far as the prev assignment has been removed, I'll try to continue, if no one minds.

@huntie, could you assist with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
馃憢馃徎 Good First Issue An issue or task that is ideal for new open source contributors. Type: Feature Request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants