feat(docs): generate llms.txt and un-deprecate the browser-dependent hooks - #435
Draft
hyesungoh wants to merge 6 commits into
Draft
feat(docs): generate llms.txt and un-deprecate the browser-dependent hooks#435hyesungoh wants to merge 6 commits into
hyesungoh wants to merge 6 commits into
Conversation
🦋 Changeset detectedLatest commit: d850a8a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
Size Change: -1.4 kB (-1.42%) Total Size: 97.3 kB 📦 View Changed
ℹ️ View Unchanged
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #435 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 58 58
Lines 1652 1652
Branches 499 499
=========================================
Hits 1652 1652 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 0·1 of making the library legible to AI coding agents. Related: #433.
Un-deprecate the browser-dependent hooks
@deprecatedJSDoc fromuseDoubleClick,useGeolocation,useImpressionRef,useIntersectionObserver,useLongPress,useOutsideClickEffect,useStorageStateanduseVisibilityEvent. They are maintained hooks again — editors stop rendering them struck-through and agents stop routing around them. Patch changeset included.useVisibilityEvent↔usePageVisibilitywith@see, since the two solve the same problem with different shapes (callback vs state).packages/coreREADME lags the.d.tsby one release.Serve LLM-friendly docs
vitepress-plugin-llmssoyarn docs:buildemits/llms.txt,/llms-full.txt, and a raw Markdown twin of every page (e.g./core/hooks/useDebounce.md). The plugin follows the existing VitePressrewrites, so the links are the clean URLs rather than source paths.ko/,ja/, generated fallbacks) and non-doc Markdown (READMEs, plugin skills, examples) are excluded so each page is listed exactly once.llms.txt. It was never actually served —srcDiris the repo root, so a non-Markdown file there never reached the build and/llms.txtreturned 404. Its "Usage Guidelines for AI Agents" section moved into the plugin'sdetails, and it had drifted (missing all components, all utils, and 8 hooks).Keep it from drifting
test:docsalready builds the site in CI, so the newassertLlmsOutputcheck rides along on that build rather than adding a job. It asserts that:packages/core/src/index.tsandpackages/mobile/src/index.tshas a page linked inllms.txt— the list is derived from the index files, so a new hook is covered without touching this check;llms-full.txtinlines page contents, and the per-page Markdown is Markdown (no<Interface>components).collectPublicExportsis split out because the skill generator planned for the next phase needs the same list.Notes for reviewers
chore(docs): add vitepress-plugin-llmsis only the lockfile plus.yarn/cachearchives — nothing to read there.injectLLMHintdefaults to on, so each page now carries adisplay: noneline pointing agents at its.mdtwin (Are you an LLM? You can read better optimized documentation at /core/hooks/useDebounce.md …). Invisible to human readers; say the word and I'll setinjectLLMHint: false.useDebouncefrom the plugin'signoreFilesmakestest:docsexit 1 withllms.txt must link the documentation page of useDebounce.Checklist
yarn test,yarn test:docs,yarn test:spec)yarn fix)react-simplikitpatch)