File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ const BABEL_DEPENDENCIES = [
109109// Dependencies that we actually don't need, we will replace this by a dynamic
110110// system in the future
111111const PREINSTALLED_DEPENDENCIES = [
112- 'node-lib -browser' ,
112+ 'node-libs -browser' ,
113113 'react-scripts' ,
114114 'react-scripts-ts' ,
115115 'parcel-bundler' ,
Original file line number Diff line number Diff line change @@ -17,10 +17,27 @@ const host = process.env.CODESANDBOX_HOST;
1717
1818const VERSION = 1 ;
1919
20+ /**
21+ * Warm the cache of our new API
22+ */
23+ const warmNewPackagerAPI = ( url : string , method : string = 'GET' ) => {
24+ try {
25+ fetch ( url , { method } )
26+ . then ( ( ) => { } )
27+ . catch ( ( ) => { } ) ;
28+ } catch ( e ) {
29+ /* ignore */
30+ }
31+ } ;
32+
2033const BUCKET_URL =
2134 process . env . NODE_ENV === 'production' || process . env . NODE_ENV === 'test'
2235 ? 'https://d1jyvh0kxilfa7.cloudfront.net'
2336 : 'https://s3-eu-west-1.amazonaws.com/dev.packager.packages' ;
37+
38+ const NEW_PACKAGER_URL =
39+ 'https://aiwi8rnkp5.execute-api.eu-west-1.amazonaws.com/prod/packages' ;
40+
2441const PACKAGER_URL =
2542 process . env . NODE_ENV === 'production' || process . env . NODE_ENV === 'test'
2643 ? 'https://drq28qbjmc.execute-api.eu-west-1.amazonaws.com/prod/packages'
@@ -145,6 +162,7 @@ async function getDependencies(dependencies: Object) {
145162
146163 setScreen ( { type : 'loading' , text : 'Downloading Dependencies...' } ) ;
147164 try {
165+ warmNewPackagerAPI ( `${ NEW_PACKAGER_URL } /${ dependencyUrl } ` , 'POST' ) ;
148166 const bucketManifest = await callApi (
149167 `${ BUCKET_URL } /${ bucketDependencyUrl } `
150168 ) ;
You can’t perform that action at this time.
0 commit comments