-
Notifications
You must be signed in to change notification settings - Fork 0
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
Native: Initialize AtlaspackNative async #402
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: dc9c912 The changes in this PR will be included in the next version bump. This PR includes changesets to release 100 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
65c565b
to
b9fdede
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be initialized synchronously now, no need for any channel shenanigans
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🪦
@@ -66,6 +82,6 @@ export class AtlaspackV3 { | |||
} | |||
|
|||
respondToFsEvents(events: Array<Event>): boolean { | |||
return this._internal.respondToFsEvents(events); | |||
return atlaspackNapiRespondToFsEvents(this._atlaspack_napi, events); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you opt for functions instead of adding to the _atlaspack_napi
instance like before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
napi-rs V2 has broken macros for napi classes requring us to disable macro expansion in our LSPs. This results in incorrect intelisense and limits the napi features we can use. For instance; the boilerplate in this section of code could all be handled by the macro but without macro expansion we cannot use it.
I'd like to turn macro expansion back on and to do that we either need to:
- Migrate to napi-rs v3 (which is still in alpha)
- Avoid the use of napi-rs classes (recreating them in the JS layer)
Personally, I'm okay with migrating to v3, even if it's in alpha, but I am not sure how much work is needed for the migration and if the team is comfortable with pre-release software.
db6c2ee
to
e5d870a
Compare
Motivation
Lazy initialization of AtlaspackNapi was hiding errors occuring asynchronously. This fixes the watcher hanging, but also Matt's PR bumping the watcher version fixes it too. Por que no los dos?
Changes
Checklist