You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, we're using multiple views to combat different contexts. Unfortunately, the contexts are not controlled in a way that plays nicely with the main document settings, c.f. #88. Without moving everything into module form and risking running into more publish woes (e.g. webr-*worker.js), we should avoid injecting code in-place in favor of maintaining an internal stack of code and contexts in the HTML document. By moving in this direction, we can gain more utility in introducing a new inline execution mechanic, c.f. #92, and, potentially, allow for document-level resets/re-renders without leaving the page.
From there, we would need to take advantage of promises and maintain a call stack. A rough idea would be somewhere along the lines of:
// Define an array of asynchronous functions to execute consecutivelyconstasyncFunctions=[asyncFunction1,asyncFunction2];functionexecuteAsyncFunctionsConsecutively(functions){// Base case, no code to callif(functions.length===0){console.log("All async functions are done.");return;}// Get and remove the first function from the arrayconstcurrentFunction=functions.shift();// Execute the function, once resolved move to the next functioncurrentFunction().then(()=>executeAsyncFunctionsConsecutively(functions)).catch((error)=>{console.error("Error:",error);});}executeAsyncFunctionsConsecutively(asyncFunctions);
Though, this might be a bit overkill at the moment.
The text was updated successfully, but these errors were encountered:
Right now, we're using multiple views to combat different contexts. Unfortunately, the contexts are not controlled in a way that plays nicely with the main document settings, c.f. #88. Without moving everything into module form and risking running into more publish woes (e.g.
webr-*worker.js
), we should avoid injecting code in-place in favor of maintaining an internal stack of code and contexts in the HTML document. By moving in this direction, we can gain more utility in introducing a new inline execution mechanic, c.f. #92, and, potentially, allow for document-level resets/re-renders without leaving the page.The rough sketch of the Lua filter change was prototyped out in: https://github.com/coatless-quarto/catchandrelease
From there, we would need to take advantage of promises and maintain a call stack. A rough idea would be somewhere along the lines of:
Though, this might be a bit overkill at the moment.
The text was updated successfully, but these errors were encountered: