feat(kno-12274): add guides in vue.js tutorial#1374
feat(kno-12274): add guides in vue.js tutorial#1374scotidodson wants to merge 10 commits intomainfrom
Conversation
… and linked to it from tutorial; added in-app guide channel to the list on integration overview (we never incorporated guides here); copy updates to tutorial
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Risk HIGH: Adds a new Vue.js guides tutorial with modifications to shared UI components (Callout.tsx and CodeBlock.tsx), sidebar navigation, and content across multiple documentation sections.
Reasons
- Shared component modified (
Callout.tsx). Adds a newcommunity_sourcedcallout type with aCOMMUNITY_SOURCEDconstant containing hardcoded title/body, and refactors title/text rendering to useeffectiveTitle/effectiveText— this affects all existing callout usage site-wide. - Shared component modified (
CodeBlock.tsx). Registersvueas a new syntax highlighting language aliased toxml, which changes the set of recognized languages in all code blocks across the site. - New MDX page added.
content/tutorials/guides-in-vue.mdxis a brand new 469-line tutorial file — new pages carry MEDIUM risk on their own (routing, SEO, sidebar integration). - Sidebar navigation modified.
data/sidebars/tutorialsSidebar.tsadds a new entry, which affects the tutorials section navigation for all readers. - Changes span multiple documentation sections. Edits touch
content/concepts/,content/integrations/,content/in-app-ui/, andcontent/tutorials/, increasing the surface area of potential issues.
Notes
Callout.tsxrendering logic. The refactor from directtitle/textprops toeffectiveTitle/effectiveTextshould be tested to confirm that existing callout types still render correctly whentitleortextis explicitly passed asundefinedornull.CodeBlock.tsxlanguage alias. Verify that aliasingvuetoxmlproduces acceptable syntax highlighting for Vue SFC templates —.vuefiles contain<script>,<style>, and<template>blocks that may not all highlight correctly with plain XML grammar.- TypeScript loose typing. The PR description notes that guide step types use
unknownin several places — a reviewer should assess whether stronger typing is feasible with the current@knocklabs/clientexports. - New tutorial content quality. At 469 lines, this is a substantial tutorial. Review for adherence to the style guide (sentence case, active voice, no adverbs, Oxford comma, American spelling, link validity).
Sent by Cursor Automation: Docs PR classifier
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
JEverhart383
left a comment
There was a problem hiding this comment.
Made a couple of tweaks/suggestions for naming, but this looks awesome, should help a lot of people
| npm install @knocklabs/client urlpattern-polyfill | ||
| ``` | ||
|
|
||
| Then import the polyfill at the top of your app entry point (e.g. `main.ts`): |
There was a problem hiding this comment.
Might callout why the polyfill is needed here
| | React | Vue | | ||
| | -------------------- | ------------------------------------------------------------------- | | ||
| | `KnockProvider` | A `KnockProvider.vue` component that uses Vue's `provide`/`inject`. | | ||
| | `KnockGuideProvider` | Included in `KnockProvider.vue`. | |
There was a problem hiding this comment.
Feels like this is actually useKnockGuides and maybe I would recommend calling this useKnockGuidesClient to make it more clear that this returns a client and not just guides. Totally take or leave though on naming, but would recommend calling out this layer here
There was a problem hiding this comment.
But when I look at the Guide Component example, more so think adding client to naming would help disambiguate what's happening
There was a problem hiding this comment.
useKnockGuideClient so that we're building on the actual class name
|
|
||
| ## Architecture overview | ||
|
|
||
| The [Knock React SDK](/in-app-ui/react/sdk/overview) uses a provider/hook pattern (`KnockProvider`, `KnockGuideProvider`, `useGuide`). In Vue.js, you replicate this with `provide`/`inject` and composables. |
There was a problem hiding this comment.
| The [Knock React SDK](/in-app-ui/react/sdk/overview) uses a provider/hook pattern (`KnockProvider`, `KnockGuideProvider`, `useGuide`). In Vue.js, you replicate this with `provide`/`inject` and composables. | |
| The [Knock React SDK](/in-app-ui/react/sdk/overview) uses a provider/hook pattern (`KnockProvider`, `KnockGuideProvider`, `useGuide`). In Vue.js, you replicate this with `provide`/`inject` and composables. Here's a comparison of Knock's React components and their Vue equivalents. |



KNO-12274: [Docs] Add guides in Vue tutorial
Summary
Changes
content/tutorials/guides-in-vue.mdx— new tutorial on implementing guides in Vue.jsdata/sidebars/tutorialsSidebar.ts— added sidebar entry for tutorial pagecomponents/ui/Callout.tsx— addedcommunity_sourcedtype with fixed title and body copy viaCOMMUNITY_CONTENTconstant; idea is that this will always have the same copy every time it's used and we expect to use it again on other tutorials.components/ui/CodeBlock.tsx— registeredvueas a syntax highlighting language (aliased toxml/hljs, which handles Vue SFC template syntax)content/in-app-ui/guides/render-guides.mdx— added "Guide identifiers" section explaining guide channel ID, guide key, and guide type based on some recent customer confusioncontent/integrations/overview.mdx— added in-app guide to the destination channels listcontent/concepts/channels.mdx— added in-app guide to the destination channels listNotes
unknown) in places where the exact exported types from@knocklabs/clientare unclear — we may want to change that.