The compiler worker should be waiting for initialization to finish before processing new requests, see:
#382. This mainly impacts local environments - the only production issue is a failed lookup for new web IDE Components, though it has no impact on the user.
Rather than having consumers of useCompiler responsible for waiting on initialization, I'm leaning towards having compileComponent wait on pending initialization like it does currently with LightningCSS. E.g. something like
init(...) {
let initResolver;
this.initialization = new Promise((res) => { initResolver = res; });
...
initResolver();
}
...
compileComponent(...) {
await this.cssParser.init();
await this.initializer;
}
The compiler worker should be waiting for initialization to finish before processing new requests, see:
#382. This mainly impacts local environments - the only production issue is a failed lookup for new web IDE Components, though it has no impact on the user.
Rather than having consumers of
useCompilerresponsible for waiting on initialization, I'm leaning towards havingcompileComponentwait on pending initialization like it does currently with LightningCSS. E.g. something like