Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Add postinstall hook to remove the webworker-threads module #244

Merged
merged 2 commits into from
Apr 11, 2018

Conversation

jasonrudolph
Copy link
Contributor

In an attempt to resolve the problem described in #67 (comment), this pull request adds a postinstall hook to delete the webworker-threads module as described in #67 (comment).

This is admittedly a hack, and I'm not certain that it will resolve the issue, but we'll give it a shot.

If this does resolve the issue, we can consider it a temporary workaround, and we can remove this workaround when the spelling-manager module no longer depends on the natural module (#67 (comment)), or when the natural module makes the webworker-threads module a peer dependency (NaturalNode/natural#368) instead of an optional dependency.

/fyi @dmoonfire @maxbrunsfeld

@jasonrudolph
Copy link
Contributor Author

I've tested this on macOS, Windows 10, and Ubuntu as a sanity check regarding cross-platform compatibility. In each case, I did the following:

git clone https://github.com/atom/spell-check
cd spell-check
apm link
apm install

Then, verify that node_modules/webworker-threads is present.

Then:

git checkout jr-investigate-67
apm install

Then, verify that node_modules/webworker-threads is not present.

Then, open Atom and run the "Spell Check: Toggle" command on a file to verify that spell check is still working.

@jasonrudolph jasonrudolph merged commit 87a12ca into master Apr 11, 2018
@jasonrudolph jasonrudolph deleted the jr-investigate-67 branch April 11, 2018 16:35
@jasonrudolph
Copy link
Contributor Author

It doesn't seem like this change is going to have the desired effect. 😩 While the approach in this pull request successfully removed the webworker-threads module in the scenario described in #244 (comment), it doesn't seem to remove the module when bundling the spell-check package as part of a full Atom build.

I published a patch version of this package (0.73.2) and updated atom/atom to use that version (atom/atom@282fd85). I then downloaded resulting atom-mac.zip built by CI for that commit. Unfortunately, webworker-threads is still present:

$ tree /Applications/Atom.app/Contents/Resources/app.asar.unpacked/node_modules/webworker-threads
/Applications/Atom.app/Contents/Resources/app.asar.unpacked/node_modules/webworker-threads
└── build
    └── Release
        └── WebWorkerThreads.node

2 directories, 1 file

I'll see if I can find an approach that will meet our needs. If anyone has ideas, definitely let me know. 😅🙏

@dmoonfire
Copy link
Contributor

I added an issue to spelling-manager to get rid of the dependency: dmoonfire/spelling-manager-js#4.

jasonrudolph added a commit that referenced this pull request Apr 12, 2018
This reverts commits bceff78 and
fc81e5d.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants