* fix: remove hidden guide pages from render
Guide pages hidden from nav are still rendered. This change removes them
from both build-time and on-demand rendering.
* fix: build llms script
The build llms script does not run in an environment where React is
available, so it must import from 'common/enabled-features', not from
'common', to avoid errors.
* fix: don't render hidden reference pages
Similar to guides, but for client SDK references. If a page is hidden
from the navigation (its feature flag is toggled off), don't render it
at all. This includes (a) at build time, (b) at request time, and (c) at
crawler request time.
* fix: types
* fix: search sync + sentry errors issues
Fixes two issues:
1. Search sync: The embedded content now includes denormalized examples,
so the examples codegen needs to be run before embeddings are
created. Otherwise, the GitHub Action will fail because it cannot
find the examples to use for content inclusion.
2. Sentry errors on pages that fail to load: Sentry errors were being
sent for genuine 404s because the check for FileNotFoundErrors was
wrong. The error that is caught is wrapped in a new Error by
Result.unwrap(), so it's the child of this error, error.cause, that
is potentially a FileNotFoundError, not the error itself.
* fix: remove double processing of mdx
* refactor: reading markdown docs files
Refactor how Markdown docs files are read:
- Reuses the same logic across search index generation & page generation
- Improves the indexed content for search:
- Stops removing MDX components, which often contain useful
information like Admonitions
- Denormalizes Partials and CodeSamples for more complete content
This is a prerequisite step for implementing the "Copy docs as Markdown"
functionality.
Only touches regular guides for now, not federated ones.
* fix: tailwind build error (#37728)
We changed to default to ESM imports a while ago, which means local
builds are now breaking because the Tailwind uses a require. Changed to
CJS for Tailwind config file. (I have no idea how this has been working
on Vercel all this time.)
* style: prettier
* feat(docs): code samples with ts type stripping
Introduce a new option to `$CodeSample`, `convertToJs`, which takes a
code sample written in TypeScript and strips the types to produce a
JavaScript version.
Adds tests for type stripping.
* Clarify instructions
---------
Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>
We have a global troubleshooting view at /guides/troubleshooting, but
for greater visibility, we should also have product-specific
troubleshooting views. This is the same view and same data as the global
page, but filtered down to a specific product.
* General updates and switch to Svelte 5
* Update code example to Svelte 5
* Update some examples to use codesamples component
* Add Svelte to codesample component
* Final code updates
* Add more CodeSample components
* Add db wrappers open in dashboard cta
* Restore getLatestRelease return to null
* Add guide template components with flexible content positioning
* Add Guide components with composition pattern
* Remove default branch on tag value
* Add GuideTemplate component and do some clean up
* Restore original GuideTemplate
* Clean up code and unused props
* Remove displayName
* Remove unwanted export
* Refactor EditLink to its own helper file
* Apply several fixes
* Fix underline on cta button
* Remove default main tag
* More descriptive button cta label
* fix(docs): add iceberg_wrapper dashboard integration
---------
Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
* Consolidate copy to clipboard
* Fix
* Fix some extra clipboard events.
* Fix the tests. Fix a small issue with the copy button.
* Fix
---------
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
* feat(graphql): add paginated errors collection query
- Add new GraphQL query field 'errors' with cursor-based pagination
- Add UUID id column to content.error table for cursor pagination
- Implement error collection resolver with forward/backward pagination
- Add comprehensive test suite for pagination functionality
- Update database types and schema to support new error collection
- Add utility functions for handling collection queries and errors
- Add seed data for testing pagination scenarios
This change allows clients to efficiently paginate through error codes using cursor-based pagination, supporting both forward and backward traversal. The implementation follows the Relay connection specification and includes proper error handling and type safety.
* docs(graphql): add comprehensive GraphQL architecture documentation
Add detailed documentation for the docs GraphQL endpoint architecture, including:
- Modular query pattern and folder structure
- Step-by-step guide for creating new top-level queries
- Best practices for error handling, field optimization, and testing
- Code examples for schemas, models, resolvers, and tests
* feat(graphql): add service filtering to errors collection query
Enable filtering error codes by Supabase service in the GraphQL errors collection:
- Add optional service argument to errors query resolver
- Update error model to support service-based filtering in database queries
- Maintain pagination compatibility with service filtering
- Add comprehensive tests for service filtering with and without pagination
* feat(graphql): add service filtering and fix cursor encoding for errors collection
- Add service parameter to errors GraphQL query for filtering by Supabase service
- Implement base64 encoding/decoding for pagination cursors in error resolver
- Fix test cursor encoding to match resolver implementation
- Update GraphQL schema snapshot to reflect new service filter field
* docs(graphql): fix codegen instruction
* ci(docs): fix sync process
GraphQL codegen needs to be run before sync because otherwise the types
are missing. Missed this in local testing because codegen had already
been run for other reasons.
* fix(troubleshooting sync): unresolved import
* ci(docs lint): fix commenting workflow
Add a script for syncing error codes from the repo to the database. This
is part of the newly created rootSync script, where all sync scripts
should be moved eventually.
strictNullChecks was off for docs, which lets errors slip through and
leads to incorrect required/optional typing on Zod-inferred types. This
PR enables strictNullChecks and fixes all the existing violations.
* Move all components in ui-patterns into src folder. Add exports field for all files.
* Fix all apps to use the new ui-patterns.
* Fix the design-system build.
* Remove all unused rexports from ui-patterns index. Apps should use direct imports instead.
* Change the tailwind content property to include src folder of ui-patterns.
* Remove autoprefixer from the tailwind configs.
* Remove autoprefixer as a dependency.
* Fix the CVA conditions in FormLayout.
Our environment variables are a bit of a mess, so cleaning them up:
- We have duplicate environment variables that resolve to the same thing
but just have different names, deduplicating all of these
- We have a .env.development (for publicly safe variables) and a
.env.example, we
really only need one
- Privately, we have a .env (for running scripts) and a .env.local (for
Next.js). Changing the dotenv source for scripts, so again we only need
one
Scripts currently use CJS, which is causing a bit of a mess when trying
to use shared utilities from the app. Converting everything to ESM so
there are fewer conflicts when adding new scripts going forward.
* refactor(docs): turn auth error codes table into data file
Take the Markdown error codes table and turn it into a data file
instead. This makes it easy to parse and reuse in other places besides
Markdown documents.
* Update apps/docs/content/errorCodes/authErrorCodes.toml
Co-authored-by: Terry Sutton <saltcod@gmail.com>
---------
Co-authored-by: Terry Sutton <saltcod@gmail.com>
Don't know why I was using string interpolation instead of GraphQL
variables for the GitHub API calls, leading to all kinds of escaping
problems. Changed to using GraphQL variables properly.
## Before
Partners fetch is showing stale data from a few months ago
## After
Partners fetch can be revalidated by tag. The revalidation will be
triggered by a DB function when the partners table is changed.
# Before
Crawlers pages that used MDX components with defined attributes errored.
Example: /docs/reference/kotlin/installing
# After
The pages do not error.
* Bump all versions of postcss to 8.5.3.
* Run next/codemod on the docs app.
* Move two experimental flags into stable. Add next-mdx-remote as a transpiled package.
* Add extra folders to the clean command in docs.
* Fix type errors in docs test.
* Run prettier on the new files.
* remove turbopack, fix fetch revalidation, fix metadata awaits
Couple of minor fixes:
- Turbopack doesn't work in dev because of known MDX loader limitations
(cannot load functions in MDX plugin config)
- Fetches not cached by default anymore in Next 15 so need to manually
cache the ones we need
- Missing a few awaits for metadata generation with page params
* Bump the graphiql version because headlessui/react is not building with Next 15.
---------
Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
When translation tools go over prices, they wrongfully convert USD into other currencies without changing the price. $25 becomes Rp25 (Rupiah).
By using `translate='no'` we avoid the translation of pricing info. There are some tooltips left that are not covered yet, but this should be the majority already.
Kept the docs Pricing component as simple as possible, just wrapping in a span to avoid translation, not modifying any formatting.
* docs: user nav dropdown
* www: user dropdown nav
* update menus
* chore: add complete local storage allowlist
* move all local-storage to common
* reload after logOut
* add local storage key changes from #35175
* fix errors
* add more keys
* fix merge bugs
---------
Co-authored-by: Alaister Young <a@alaisteryoung.com>
* chore: add usercentrics for consent management
* client component to make next.js happy
* address feedback
* move consent state to common
* fix import
* ensure page events are sent correctly
* add feature flag provider to ui library site
* fix ui lib 500 error
* skip in test env
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
Add models and GraphQL interface definitions for search results and guides (representing Markdown documents such as tutorials, etc.).
These aren't connected to anything yet, but putting them in a separate
PR to keep the review short and relatively simple.
Towards DOCS-214
Correct the code examples for the Clerk third-party auth docs:
- Fix TypeScript error
- Change RLS policy check to accept both [Clerk v1 and v2
JWTs](https://clerk.com/docs/backend-requests/resources/session-tokens)
Pulled code samples from an example app that I've checked in to make
maintenance and testing easier in the future.
An experiment in lowering docs preview build times. Build times have gotten quite long again (~12 minutes) because we are generating types on code blocks during prerendering. This wastes compute time building a lot of pages on preview branches that never get viewed, and slows down iteration speed.
Instead, let's only prerender on prod, and build on-demand for preview sites.
Limiting to realtime section for now to monitor the effects of changes.
Before:
Revalidation was turned off entirely for wrappers pages, and done daily for GraphQL pages.
After:
Revalidation is via tag. There is an /api/revalidate endpoint that is used by GitHub Actions on the federated repos to trigger the revalidation. This decreases the number of unnecessary page generations by Vercel, and gives the maintainers of federated repos more fine-grained control over when to reploy their docs (see the docs deployment playbook for more info).