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

Add activationHook #283

Merged
merged 3 commits into from Mar 8, 2020
Merged

Add activationHook #283

merged 3 commits into from Mar 8, 2020

Conversation

idleberg
Copy link
Contributor

As mentioned in the Atom documentation, activationHooks (or activationCommands) will improve startup performance by deferring the package activation. Since this package is grammar agnostic, the core:loaded-shell-environment hook is the only suitable one.

As mentioned in the Atom documentation, `activationHooks` (or `activationCommands`) will improve startup performance by deferring the package activation. Since this package is grammar agnostic, the `core:loaded-shell-environment` hook is the only suitable one.
@ericcornelissen
Copy link
Contributor

It seems the unit tests fail because of this change @idleberg 😕

I found some solutions online for when the activationHook refers to another package, but not when it is set to core:loaded-shell-environment. Some quick tries with atom.packages.triggerDeferredActivationHooks() doesn't seem to do the trick for me... Do you have more knowledge on the topic and can you fix the tests @idleberg?

@idleberg
Copy link
Contributor Author

idleberg commented Feb 26, 2020

It would be helpful if the version I installed using apm would complete the specs, but they all fail.

$ atom -v
Atom    : 1.44.0
Electron: 4.2.7
Chrome  : 69.0.3497.128
Node    : 10.11.0

$ apm -v
apm  2.4.3
npm  6.2.0
node 10.2.1 x64
atom 1.44.0
python 2.7.16
git 2.25.0

Screenshot 2020-02-26 at 23 33 34

I used GitHub's code search to find occurences of triggerDeferredActivationHooks and came up with this:

atom.packages.triggerDeferredActivationHooks()
atom.packages.triggerActivationHook('core:loaded-shell-environment')

But since I cannot run the unmodified specs of v1.2.0, I don't know how to help with the tests. Any ideas?

@ericcornelissen
Copy link
Contributor

Thanks for the research @idleberg, I missed the triggerActivationHook function 😅

Once I added those two lines and ran the tests locally and everything worked like a charm again! I created a PR with a fix for you (in your fork), if you merge that this PR's CI should succeed 👍

Fix tests for activationHooks Pull Request
@idleberg idleberg mentioned this pull request Feb 27, 2020
@suda suda merged commit 3fe95ae into atom-community:master Mar 8, 2020
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

3 participants