Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for Electron issue with setImmediate #12765

Merged
merged 5 commits into from
Aug 17, 2021

Conversation

sergiou87
Copy link
Member

Description

This PR includes a workaround for electron/electron#29261 that basically replaces calls to setImmediate with setTimeout(…, 0).

Given it will need some time in testing, I created a very original abstraction with setAlmostImmediate and wrote an eslint rule to make sure we don't use setImmediate (@shiftkey I'd love if you could take a look at it and share any feedback… but only if you have time!!!)

After testing it, I haven't noticed any issues, and of course I wasn't able to repro the aforementioned issue after bumping Electron to one of the affected versions, so we could say this temporary workaround is actually useful 😌

Release notes

Notes: no-notes

Copy link
Contributor

@tidy-dev tidy-dev left a comment

Choose a reason for hiding this comment

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

✨ Seems like a reasonable work around. I like the name. 😸

One comment need updated from copy/paste of previous lint rule.

const sourceCode = context.getSourceCode()

/**
* Check each member of the interface body and ensure it is marked `readonly`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy/Pasta comment

Copy link
Member Author

Choose a reason for hiding this comment

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

Ouch! Fixed now, thanks 😄

// @ts-check

/**
* set-almost-immediate
Copy link
Contributor

Choose a reason for hiding this comment

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

These custom rules are neat!

@shiftkey
Copy link
Member

@sergiou87 ESLint rules look fine to me :shipit:

Copy link
Contributor

@tidy-dev tidy-dev left a comment

Choose a reason for hiding this comment

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

@sergiou87 sergiou87 merged commit e73b6f7 into development Aug 17, 2021
@sergiou87 sergiou87 deleted the set-almost-immediate branch August 17, 2021 14:00
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.

None yet

4 participants