Commit Graph

10 Commits

Author SHA1 Message Date
Charis eed0f6e7ce fix: don't render hidden pages (#38477)
* 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
2025-09-08 13:05:38 -04:00
Ivan Vasilov 0cb08341f6 chore: Bump nextjs for the docs app (#35333)
* 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>
2025-05-08 09:27:22 +00:00
Charis e44e6aec86 clean: remove console logs (#33623) 2025-02-23 11:49:05 -05:00
Charis 20016b28a0 fix: timeouts (#33186) 2025-02-13 13:44:28 -05:00
Charis bdce404105 chore: add some logging to debug timeout issues (#30212) 2024-10-31 14:25:30 -04:00
Charis 5d2bdc9efb refactor(docs): move last pages over to app router (#29293)
The end of the Great Migration is here!!!

Moves the last pages over, deleting pages like the FAQ that we don't use
and that contain duplicated information anyway.

Dev secret auth page URL had to change as App Router doesn't like the
leading underscores in the path.

Also fixes the not-found recommendations to use the proper Next.js
not-found page so it will return a 404 as it should. (I was under the
erroneous impression that I couldn't get the pathname in not-found.tsx,
that is not true, so this works better.)
2024-09-13 13:28:15 -04:00
Charis 11e19ff29f refactor(docs): convert self-hosting to app router (#29268)
* chore(docs,refs): prebuild self-hosted ref data

Pregenerate self-hosted ref data files, in the style of the client lib,
Management API, and CLI references. Preparatory step for migrating the
self-hosted references to App Router.

* refactor(docs): convert self-hosting to app router

Convert self-hosting reference pages to App Router.

* fix(docs,sitemap)
2024-09-13 09:45:55 -04:00
Charis 33ede6f893 refactor(docs): convert management api reference to app router (#29146)
* chore(docs): preprocess management api specs

In preparation for App Router migration of Management API reference,
preprocess the Management API spec (both OpenAPI spec and common
sections), and write the processed data to file, in the style of the
other pregenerated reference data.

Details:

- Split reference section generation into separate functions for SDK, CLI, and API
- Add new function to generate API reference sections from OpenAPI spec
- Introduce mapEndpointsById function to create a map of API endpoints
- Update run function to execute all reference generation tasks in parallel
- Import necessary new dependencies and types

* refactor(docs): migrate management api reference to app router

* fix(docs): statically build management api reference page

* fix(docs): minor styling issues
2024-09-11 13:53:45 -04:00
Charis 84a8fa7ac3 refactor(docs): migrate cli reference to app router (#29117) 2024-09-06 09:22:25 -04:00
Charis fc164b5d07 Refactor/app router refs (#28095)
Migrates client SDK References to App Router. (Management and CLI API references aren't migrated yet, nor are self-hosting config references.)

Some notes:

Big changes to the way crawler pages are built and individual section URLs (e.g., javascript/select) are served. All of these used to be SSG-generated pages, but the number of heavy pages was just too much to handle -- slow as molasses and my laptop sounded like it was taking off, and CI sometimes refuses to build it all at all.

Tried various tricks with caching and pre-generating data but no dice.

So I changed to only building one copy of each SDK+version page, then serving the sub-URLs through a response rewrite. That's for the actual user-visible pages.

For the bot pages, each sub-URL needs to be its own page, but prebuilding it doesn't work, and rendering on demand from React components is too slow (looking for super-fast response here for SEO). Instead I changed to using an API route that serves very minimal, hand-crafted HTML. It looks ugly, but it's purely for the search bots.

You can test what bots see by running curl --user-agent "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" <URL_OF_PAGE>

Also added some smoke tests to run against prod for the crawler routes, since we don't keep an eye on those regularly, and Vercel config changes could surprise-break them. Tested the meta images on Open Graph and all seems to work fine.

With this approach, full production builds are really fast: ~5 minutes

Starts using the new type spec handling, which is better at finding params automatically, so I could remove some of the manually written ones from the spec files.
2024-08-13 16:12:59 -04:00