Skip to content

Compiler worker processes requests before initialization is finished #386

Description

@andy-haynes

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;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions