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

Created withRunOnce #2965

Merged
merged 9 commits into from
Nov 30, 2020
Merged

Conversation

EvanBacon
Copy link
Contributor

@EvanBacon EvanBacon commented Nov 27, 2020

  • When we start migrating users from unversioned config plugins to versioned config plugins, we'll need a way to prevent running plugins more than once.
  • Initially a user will eject, see a deprecation warning about an unversioned feature, maybe resolve the issue by adding a static plugin for a package like expo-facebook, then run expo eject again.
    • Without a way to track that expo-facebook has already been run, expo-cli would just run the unversioned legacy plugin again.
    • Now our versioned plugins can import the History interface, or the withRunOnce plugin to prevent unversioned plugins from running.
      • Note: User plugins run before Expo built-in plugins.
  • Uses the new _internal.pluginHistory to track plugin history.

Test Plan

  • Wrote some unit tests

@EvanBacon EvanBacon added enhancement New feature or request Expo config Related to the app.json config for Expo projects labels Nov 30, 2020
@EvanBacon EvanBacon marked this pull request as ready for review November 30, 2020 13:21
@EvanBacon EvanBacon merged commit 223aed1 into master Nov 30, 2020
@EvanBacon EvanBacon deleted the @evanbacon/config-plugins/history-tracking branch November 30, 2020 14:48
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