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

[xdl] Get xdl-manifests from apiv2 endpoint #1978

Merged
merged 5 commits into from
Apr 28, 2020
Merged

Conversation

jkhales
Copy link
Contributor

@jkhales jkhales commented Apr 24, 2020

How

There are two locations xdl-manifests are fetched. For the first one in packages/xdl/gulp/build-tasks.js replaced the url. Confirmed this worked by repopulating the schema cache (git diff is empty):

cd ~/expo-cli/packages/xdl
rm caches/*
yarn prepack
git diff

For the second location, Line 69 in packages/xdl/src/project/ExpSchema.ts:

  1. Refactored the Cache out of the Api v1 class and into its own: XdlSchemaClient.
  2. Checked it worked in a similar way to the first point, but this time checking that~/.expo/caches/ was repopulated by running expo start in an expo project. (Note: you have to delete ~/expo-cli/packages/xdl/caches/* before running this test to force the repopulation to happen from the endpoint instead of the local backup.)

@jkhales jkhales requested a review from fson April 24, 2020 15:45
@@ -44,3 +49,22 @@ export class Semaphore {
}
}
}

export class XdlSchemaClient {
Copy link
Contributor

Choose a reason for hiding this comment

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

A better name for this would be ConfigurationSchemaClient. (The old method name xdlSchemaAsync was incorrect, or at least outdated by now.)

But since this "singleton" only has static properties and this is not Java, you might as well remove the class and have a function like getConfigurationSchemaAsync. (_schemaCaches can be a top-level variable in the module.) Please also move it to ExpSchema.ts, Utils only has some helper functions that are not really bound to our APIs or anything like that.

@jkhales jkhales merged commit a0e055d into master Apr 28, 2020
@jkhales jkhales deleted the @jkhales/xdl-manifests branch April 28, 2020 14:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants