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

Remove external config evaluation script #2625

Conversation

EvanBacon
Copy link
Contributor

@EvanBacon EvanBacon commented Sep 11, 2020

Why

How

  • Removed the external script for config reading in favor of parsing the string contents of the config file via @babel/core and evaluating it as a string.
  • I also removed 2 seemingly unused deep clone / evaluation calls, this should make reading a bit faster too.
    1. It's not needed on a static config because static configs don't support JS functions.
    2. It's unified in the shared evalConfig method.
  • Removed an unused FS existence check.

Test Plan

  • Tested locally that the contents of the config can still be updated during expo start. Ensured the dynamic behavior was used and Constants.manifest.name could be updated by reloading the app (⌘+r).

@EvanBacon EvanBacon added enhancement New feature or request Expo config Related to the app.json config for Expo projects labels Sep 11, 2020
@EvanBacon EvanBacon self-assigned this Sep 11, 2020
@EvanBacon
Copy link
Contributor Author

This change might break #2220 by essentially reverting the issue they had initially by default. cc @RedMickey see test failures https://github.com/expo/expo-cli/pull/2625/checks?check_run_id=1101429349

@EvanBacon EvanBacon changed the title Added support for disabling dynamic config evaluation Remove external config evaluation script Sep 14, 2020
const config = JsonFile.read(configPath, { json5: true });
if (config) {
return serializeAndEvaluate(config);
return config as any;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lmfao ¯_(ツ)_/¯

@EvanBacon EvanBacon merged commit cf63ad0 into master Sep 14, 2020
@EvanBacon EvanBacon deleted the @evanbacon/config/add-support-for-toggling-config-evaluation-modes branch September 14, 2020 21:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request Expo config Related to the app.json config for Expo projects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants