Skip to content

Fix SDF loadFont rejecting promise with target instead of error - #893

Merged
jfboeve merged 1 commit into
lightning-js:mainfrom
guilhermesimoes:bugfix/sdf-load-font-error
Sep 14, 2026
Merged

jfboeve merged 1 commit into
lightning-js:mainfrom
guilhermesimoes:bugfix/sdf-load-font-error

Conversation

@guilhermesimoes

Copy link
Copy Markdown
Contributor

No description provided.

});

atlasTexture.on('failed', (error: Error) => {
atlasTexture.on('failed', (_target, error: Error) => {

@guilhermesimoes guilhermesimoes Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, this has been an issue in our migration from L2 to L3.

Given that in none of the listeners we ever use the first argument (target), would it be possible to change this:

listeners[i]!(this, data);

to simply

listeners[i]!(data); 

?
In our app we have never needed access to the target.

Usually we do:

this.on(someEvent => {
  // here we have access to `this`
});

Or we do:

const child = this.child;
child.on(someEvent => {
  // here we have access to `child`
});

Don't see why we have to receive the target as the first argument.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can implement this for v4.0 @wouterlucas? internally in the renderer I don't encounter use of target either?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jfboeve sure!

@guilhermesimoes guilhermesimoes changed the title Fix SDF loadFont rejecting promise with target instead of error Fix SDF loadFont rejecting promise with target instead of error Sep 11, 2026
@jfboeve
jfboeve merged commit f5a4ae0 into lightning-js:main Sep 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants