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

fix(gatsby): show multiple invites together & at end where people are more likely to see them #28450

Merged
merged 25 commits into from
Dec 8, 2020

Conversation

KyleAMathews
Copy link
Contributor

@KyleAMathews KyleAMathews commented Dec 2, 2020

Also track when we show invites so we get a sense of how often that is happening

Screen Shot 2020-12-03 at 11 03 09 AM

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Dec 2, 2020
Copy link
Contributor

@pvdz pvdz left a comment

Choose a reason for hiding this comment

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

I think the emitter.off needs a little work.

Overall I like the grouping of these messages but I worry that people will never see them if they are only shown at the end. Like what happens when you abort?

Does this system have no tests? No snapshots to update? Could we have some?

packages/gatsby/src/utils/start-server.ts Outdated Show resolved Hide resolved
packages/gatsby/src/utils/show-experiment-notice.ts Outdated Show resolved Hide resolved
@ascorbic ascorbic added topic: cli Related to the Gatsby CLI and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Dec 3, 2020
pvdz
pvdz previously approved these changes Dec 3, 2020
}
}

emitter.on(`COMPILATION_DONE`, showNotices)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we avoid executing code at import time? This leads to weird and hard to debug problems later on when shuffling imports that potentially impact how things work together. In fact I would propose to not even use COMPILATION_DONE callback at all and just call showNotices() in webpack's DONE hook handler (on first compile only?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah we could do that 👍

pieh
pieh previously approved these changes Dec 8, 2020
@pieh pieh added bot: merge on green Gatsbot will merge these PRs automatically when all tests passes and removed bot: merge on green Gatsbot will merge these PRs automatically when all tests passes labels Dec 8, 2020
Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

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

Re-approve

@pieh pieh added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Dec 8, 2020
@gatsbybot gatsbybot merged commit 7e734cc into master Dec 8, 2020
@delete-merged-branch delete-merged-branch bot deleted the consolidate-invites branch December 8, 2020 21:57
pieh pushed a commit that referenced this pull request Dec 8, 2020
… more likely to see them (#28450)

* fix(gatsby): show multiple invites together & at end where people are more likely to see them

* Add telemetry

* update copy from suggestions by @DSchau

* Actually stop listening

* Update packages/gatsby/src/utils/show-experiment-notice.ts

Co-authored-by: Matt Kane <[email protected]>

* Add test for generating the message

* rewrite messages & make shorter

* make all the things happy

* update flag

* This breaking windows??

* Don't use explicit \n to see if that helps snapshot

* Maybe jest is fine w/ explicit new-lines 🤷‍♂️

* Strip ansi for tests

* Update packages/gatsby/src/services/initialize.ts

Co-authored-by: Michal Piechowiak <[email protected]>

* Update packages/gatsby/src/services/run-page-queries.ts

Co-authored-by: Michal Piechowiak <[email protected]>

* use trackCLI not trackFeatureIsUsed

* only store that we showed the invite when we actually do show the invite

* Call code directly from webpack's done callback

* mock in jest

* be more explicit about how the caching behavior changes

* Show full code sample per @pelikhan's feedback

* typescript fixes

* Update packages/gatsby/src/services/initialize.ts

Co-authored-by: Michal Piechowiak <[email protected]>

* Update packages/gatsby/src/services/initialize.ts

Co-authored-by: Matt Kane <[email protected]>
Co-authored-by: gatsbybot <[email protected]>
Co-authored-by: Michal Piechowiak <[email protected]>
(cherry picked from commit 7e734cc)
pieh pushed a commit that referenced this pull request Dec 10, 2020
… more likely to see them (#28450) (#28541)

* fix(gatsby): show multiple invites together & at end where people are more likely to see them

* Add telemetry

* update copy from suggestions by @DSchau

* Actually stop listening

* Update packages/gatsby/src/utils/show-experiment-notice.ts

Co-authored-by: Matt Kane <[email protected]>

* Add test for generating the message

* rewrite messages & make shorter

* make all the things happy

* update flag

* This breaking windows??

* Don't use explicit \n to see if that helps snapshot

* Maybe jest is fine w/ explicit new-lines 🤷‍♂️

* Strip ansi for tests

* Update packages/gatsby/src/services/initialize.ts

Co-authored-by: Michal Piechowiak <[email protected]>

* Update packages/gatsby/src/services/run-page-queries.ts

Co-authored-by: Michal Piechowiak <[email protected]>

* use trackCLI not trackFeatureIsUsed

* only store that we showed the invite when we actually do show the invite

* Call code directly from webpack's done callback

* mock in jest

* be more explicit about how the caching behavior changes

* Show full code sample per @pelikhan's feedback

* typescript fixes

* Update packages/gatsby/src/services/initialize.ts

Co-authored-by: Michal Piechowiak <[email protected]>

* Update packages/gatsby/src/services/initialize.ts

Co-authored-by: Matt Kane <[email protected]>
Co-authored-by: gatsbybot <[email protected]>
Co-authored-by: Michal Piechowiak <[email protected]>
(cherry picked from commit 7e734cc)

Co-authored-by: Kyle Mathews <[email protected]>
@pieh
Copy link
Contributor

pieh commented Dec 10, 2020

Published in [email protected]

pragmaticpat pushed a commit to pragmaticpat/gatsby that referenced this pull request Apr 28, 2022
… more likely to see them (gatsbyjs#28450)

* fix(gatsby): show multiple invites together & at end where people are more likely to see them

* Add telemetry

* update copy from suggestions by @DSchau

* Actually stop listening

* Update packages/gatsby/src/utils/show-experiment-notice.ts

Co-authored-by: Matt Kane <[email protected]>

* Add test for generating the message

* rewrite messages & make shorter

* make all the things happy

* update flag

* This breaking windows??

* Don't use explicit \n to see if that helps snapshot

* Maybe jest is fine w/ explicit new-lines 🤷‍♂️

* Strip ansi for tests

* Update packages/gatsby/src/services/initialize.ts

Co-authored-by: Michal Piechowiak <[email protected]>

* Update packages/gatsby/src/services/run-page-queries.ts

Co-authored-by: Michal Piechowiak <[email protected]>

* use trackCLI not trackFeatureIsUsed

* only store that we showed the invite when we actually do show the invite

* Call code directly from webpack's done callback

* mock in jest

* be more explicit about how the caching behavior changes

* Show full code sample per @pelikhan's feedback

* typescript fixes

* Update packages/gatsby/src/services/initialize.ts

Co-authored-by: Michal Piechowiak <[email protected]>

* Update packages/gatsby/src/services/initialize.ts

Co-authored-by: Matt Kane <[email protected]>
Co-authored-by: gatsbybot <[email protected]>
Co-authored-by: Michal Piechowiak <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes topic: cli Related to the Gatsby CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants