Skip to content

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

Merged
Twixes merged 3 commits intomasterfrom
newdoclinks
Jun 18, 2021
Merged

New doc links + copy for Plugins in Source Editor#4755
Twixes merged 3 commits intomasterfrom
newdoclinks

Conversation

@neilkakkar
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
Member

@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
Copy Markdown
Member

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
Copy Markdown
Member

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
Copy Markdown
Member

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

<>
<p>
<a href="https://posthog.com/docs/plugins/build" target="_blank">
Feeling lost?{' '}
Copy link
Copy Markdown
Member

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
Copy Markdown
Member

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.

3 participants