@@ -183,32 +183,32 @@ export default class JsExecutor {
183183 }
184184 if ( targetPlatform === TargetPlatforms . COMPOSE_WASM ) {
185185
186- const skikoExports = fetch ( API_URLS . SKIKO_VERSION ( ) , {
186+ const skikoStdlib = fetch ( API_URLS . RESOURCE_VERSIONS ( ) , {
187187 method : 'GET'
188- } ) . then ( response => response . text ( ) )
189- . then ( version =>
190- fetch ( API_URLS . SKIKO_MJS ( version ) , {
188+ } ) . then ( response => response . json ( ) )
189+ . then ( versions => {
190+ const skikoVersion = versions [ "skiko" ] ;
191+
192+ const skikoExports = fetch ( API_URLS . SKIKO_MJS ( skikoVersion ) , {
191193 method : 'GET' ,
192194 headers : {
193195 'Content-Type' : 'text/javascript' ,
194196 }
195197 } ) . then ( script => script . text ( ) )
196198 . then ( script => script . replace (
197199 "new URL(\"skiko.wasm\",import.meta.url).href" ,
198- `'${ API_URLS . SKIKO_WASM ( version ) } '`
200+ `'${ API_URLS . SKIKO_WASM ( skikoVersion ) } '`
199201 ) )
200202 . then ( skikoCode =>
201203 executeJs (
202204 this . iframe . contentWindow ,
203205 skikoCode ,
204206 ) )
205- . then ( skikoExports => fixedSkikoExports ( skikoExports ) ) )
207+ . then ( skikoExports => fixedSkikoExports ( skikoExports ) )
206208
207- const stdlibExports = fetch ( API_URLS . STDLIB_HASH ( ) , {
208- method : 'GET'
209- } ) . then ( response => response . text ( ) )
210- . then ( hash =>
211- fetch ( API_URLS . STDLIB_MJS ( hash ) , {
209+ const stdlibVersion = versions [ "stdlib" ] ;
210+
211+ const stdlibExports = fetch ( API_URLS . STDLIB_MJS ( stdlibVersion ) , {
212212 method : 'GET' ,
213213 headers : {
214214 'Content-Type' : 'text/javascript' ,
@@ -217,7 +217,7 @@ export default class JsExecutor {
217217 . then ( script =>
218218 // necessary to load stdlib.wasm before its initialization to parallelize
219219 // language=JavaScript
220- ( `const stdlibWasm = fetch('${ API_URLS . STDLIB_WASM ( hash ) } ');\n` + script ) . replace (
220+ ( `const stdlibWasm = fetch('${ API_URLS . STDLIB_WASM ( stdlibVersion ) } ');\n` + script ) . replace (
221221 "fetch(new URL('./stdlib_master.wasm',import.meta.url).href)" ,
222222 "stdlibWasm"
223223 ) . replace (
@@ -230,9 +230,11 @@ export default class JsExecutor {
230230 stdlibCode ,
231231 )
232232 )
233- )
234233
235- this . stdlibExports = Promise . all ( [ skikoExports , stdlibExports ] )
234+ return Promise . all ( [ skikoExports , stdlibExports ] )
235+ } )
236+
237+ this . stdlibExports = skikoStdlib
236238 . then ( async ( [ skikoExportsResult , stdlibExportsResult ] ) => {
237239 return [
238240 await stdlibExportsResult . instantiate ( {
0 commit comments