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

New doc links + copy for Plugins in Source Editor #4755

Merged
merged 3 commits into from Jun 18, 2021
Merged

Conversation

neilkakkar
Copy link
Collaborator

@neilkakkar neilkakkar commented Jun 15, 2021

Changes

To come after PostHog/posthog.com#1467.

Also reverting the basic example to export just the special functions we mention everywhere else in the documentation.

Our starter-kit template now points to a full fledged typescript example, which explains typescript support better.

Checklist

  • All querysets/queries filter by Organization, by Team, and by User
  • Django backend tests
  • Jest frontend tests
  • Cypress end-to-end tests
  • Migrations are safe to run at scale (e.g. PostHog Cloud) – present proof if not obvious
  • Frontend/CSS is usable at 320px (iPhone SE) and decent at 360px (most phones)

@timgl timgl temporarily deployed to posthog-pr-4755 June 15, 2021 11:01 Inactive
@neilkakkar neilkakkar marked this pull request as ready for review June 17, 2021 12:00
@neilkakkar neilkakkar requested a review from Twixes June 17, 2021 12:00
@neilkakkar neilkakkar changed the title New doc links + copy for Plugins New doc links + copy for Plugins in Source Editor Jun 17, 2021
@Twixes Twixes temporarily deployed to posthog-pr-4755 June 17, 2021 16:14 Inactive
Copy link
Collaborator

@Twixes Twixes left a comment

Choose a reason for hiding this comment

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

Hey! Picked on the details a bit. I put #4792 out as a supplement to this, take a look

Comment on lines 15 to 16
const defaultSource = `
// Learn more about plugins at: https://posthog.com/docs/plugins/build/overview
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should leave the initial newline out, as it will appear in the code editor

},
global: {},
}>
/* Runs on every event */
Copy link
Collaborator

Choose a reason for hiding this comment

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

This description could be a bit confusing, because we also have onEvent which is the one intended for running on event. processEvent should only be used for actually processing/transforming the event in flight.

Comment on lines 33 to 37
/* Runs once every full hour */
// function runEveryHour(meta) {
// const weather = await (await fetch('https://weather.example.api/?city=New+York')).json()
// posthog.capture('weather', { degrees: weather.deg, fahrenheit: weather.us })
// }`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Feels a bit weird to leave commented-out code in. I think we actually can provide a functioning runEveryHour by default

@@ -101,9 +102,18 @@ export function PluginSource(): JSX.Element {
{editingSource ? (
<>
<p>
<a href="https://posthog.com/docs/plugins/build" target="_blank">
Feeling lost?{' '}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, this question suggests a bit that this is a common feeling with this UX. 😅 Would rather go for a statement here, in the spirit of "BTW you can check that one page out if you want to know more"

Read the documentation.
</a>
<br />
Happy with your plugin?{' '}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This feels kind of passive aggressive 😅 Maybe a statement too

* Reword Plugins header caption a bit

* Update `defaultSource` slightly (functioning `runEveryHour`)

* Update source editor help wording
@timgl timgl temporarily deployed to posthog-pr-4755 June 18, 2021 08:58 Inactive
@Twixes Twixes merged commit 4097b7b into master Jun 18, 2021
@Twixes Twixes deleted the newdoclinks branch June 18, 2021 09:23
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