Skip to content

docs(@nylas/react): restructure README onto the SDK house style - #97

Merged
nbarraclough merged 5 commits into
mainfrom
docs/react-readme-house-style
Sep 1, 2026
Merged

docs(@nylas/react): restructure README onto the SDK house style#97
nbarraclough merged 5 commits into
mainfrom
docs/react-readme-house-style

Conversation

@nbarraclough

Copy link
Copy Markdown
Member

Stacked on #94. Base is fix/react-readme-connect-imports, so this diff shows only the style work. GitHub will retarget it to main automatically once #94 merges. Merge #94 first.

Brings packages/react/README.md onto the section skeleton shared by @nylas/connect (#95), nylas-nodejs, nylas-python, nylas-ruby and nylas-java.

Structure

Before After
Header plain # Nylas React Components centered block: banner, tagline, badge row, nav links
Badges 1 (version) 4 (version, downloads, TypeScript, license)
Sections Requirements, Installation, Exports overview, Getting Started, Nylas Connect Hook, Nylas Connect Button, Links Get started, ⚙️ Install, ⚡️ Usage, 💡 Examples, 🤖 AI agents, 📚 Reference, ✨ Upgrading, 💙 Contributing, 🔒 Security, 🔗 Other Nylas SDKs, 📝 License

All existing prose and every code sample are preserved. The Scheduler Editor example, local dev server instructions, hook usage, environment setup, identity provider example and custom code exchange example are unchanged apart from moving under ## ⚡️ Usage.

Gaps closed while restructuring

These go beyond pure restructuring — happy to strip any of them if you'd rather keep the diff to layout only:

  • Exports overview listed 3 of ~59 exported components without saying what the rest were. Now names the three entry points (NylasScheduling, NylasSchedulerEditor, NylasSchedulingMethod) and explains the remainder are their building blocks.
  • Hook config table omitted initialLoadingState, and never said that UseNylasConnectConfig extends ConnectConfig — so readers had no way to know apiUrl, defaultScopes, persistTokens, logLevel, codeExchange and identityProviderToken are all accepted (src/connect/useNylasConnect.ts:18).
  • Hook return values omitted setLogLevel and connectClient (useNylasConnect.ts:36-47).
  • NylasConnectButton had no prop documentation at all. Its 26 props (NylasConnectButton.tsx:12) are now grouped as Connection / Appearance / Callbacks / Advanced, including the unstyled and cssVars theming hooks and the onStart / onCancel callbacks that were never mentioned.
  • CHANGELOG.md and LICENSE.md exist in the package but were never linked. Both now are.
  • Added an Error handling section, which was absent entirely.
  • Added the subpath table, and an explicit note that the Connect symbols are only importable from @nylas/react/connect — the thing fix(@nylas/react): correct Connect import paths in README #94 fixes.

Deliberately unchanged

Two pre-existing claims I left alone rather than quietly altering:

  • "Node.js v20 or higher" — inconsistent with the root README's Node 22+ and the root package.json's engines: >=22.0.0, and Node 20 went EOL in April 2026. Not wrong for this package (Node 20 has the globals @nylas/connect needs), just stale. Worth a separate decision.
  • The package has no engines field, so nothing enforces either number.

I did align "React.js v18 or higher" to "React 18 or 19", which is what peerDependencies actually declares (^18 || ^19) and what the root README already says.

Patch changeset included so the corrected README reaches npmjs.com.

🤖 Generated with Claude Code

nbarraclough and others added 2 commits September 1, 2026 09:46
`useNylasConnect` and `NylasConnectButton` are exported only from the
`@nylas/react/connect` subpath. `src/index.ts` re-exports `./elements`
and `./utils`, neither of which reaches them, so the four README
snippets importing from `@nylas/react` could not resolve.

Also corrects the Exports overview, which claimed the Connect symbols
were importable from `@nylas/react` as well as `@nylas/react/connect`.

The Elements entries are unaffected: `NylasSchedulerEditor` and
`NylasScheduling` genuinely resolve from the package root.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@nbarraclough
nbarraclough requested review from a team and radenkovic as code owners September 1, 2026 15:07
@nbarraclough
nbarraclough requested review from AaronDDM and maithri471 and removed request for a team September 1, 2026 15:07
Brings the README onto the section skeleton shared by @nylas/connect,
nylas-nodejs, nylas-python, nylas-ruby and nylas-java: centered header
block with banner, tagline, badge row and nav links, then Get started,
Install, Usage, Examples, AI agents, Reference, Upgrading, Contributing,
Security, Other Nylas SDKs, License.

All existing prose and every code sample are preserved. The Scheduler
Editor example, the local dev server instructions, the hook usage, the
environment setup, the identity provider example and the custom code
exchange example are unchanged apart from being moved under `## Usage`.

Documentation gaps closed while restructuring:

- The Exports overview listed 3 of the ~59 exported components without
  saying what the rest were. Now names the 3 entry points and explains
  that the others are their building blocks.
- The hook config table omitted `initialLoadingState`, and did not
  mention that UseNylasConnectConfig extends ConnectConfig.
- The hook return values omitted `setLogLevel` and `connectClient`.
- NylasConnectButton had no prop documentation at all; 26 props are now
  grouped by purpose, including the `unstyled` and `cssVars` theming
  hooks.
- CHANGELOG.md and LICENSE.md exist in the package but were never
  linked. Both now are.
- Added an Error handling section, absent entirely.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@nbarraclough
nbarraclough force-pushed the docs/react-readme-house-style branch from 9fd0ca6 to 5ab61c8 Compare September 1, 2026 15:40
AaronDDM
AaronDDM previously approved these changes Sep 1, 2026

@AaronDDM AaronDDM left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good afternoon!

Spot-checked the new tables against the source and they hold up:

  • UseNylasConnectConfig extends ConnectConfig and initialLoadingState defaults to true (useNylasConnect.ts:18-27).
  • setLogLevel and connectClient are both on the return type (useNylasConnect.ts:36-48).
  • The 26 button props and the four cssVars names match NylasConnectButton.tsx:12. Worth noting the CSS file defines more variables than that (--nylas-btn-border-radius, the focus/active states, etc.), but the cssVars prop type only accepts those four, so listing four is right.

Two non-blocking notes:

  1. The subpath table omits @nylas/react/utils, which is a real entry in package.json exports. The root row says "everything below except the Connect symbols", so a reader can infer utils content is in the root, but they can't tell what it is. One more row would close it.
  2. Merge order still matters — this is based on fix/react-readme-connect-imports, so #94 goes in first.

Agreed on leaving the Node 20 vs 22 inconsistency for a separate decision rather than changing it here.

Approving.

The subpath table omitted @nylas/react/utils, which is a real entry in
the package.json exports map. Noted in review on #97.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@nbarraclough

Copy link
Copy Markdown
Member Author

Thanks — both notes taken.

1. Missing utils subpath. Fixed in 01898ba. Added the row:

| @nylas/react/utils | NylasIdentityRequestWrapper, and the LANGUAGE_CODE type |

That's the whole of src/utils.ts, so the table now covers all four entries in the exports map.

2. Merge order. Agreed — this is still based on fix/react-readme-connect-imports, so #94 goes in first and GitHub will retarget this to main automatically.

Good catch on the cssVars distinction, too. The CSS file does define more variables than the prop accepts, so listing the four from the prop type is the accurate cut.

Base automatically changed from fix/react-readme-connect-imports to main September 1, 2026 18:13
@nbarraclough
nbarraclough dismissed AaronDDM’s stale review September 1, 2026 18:13

The base branch was changed.

…se-style

# Conflicts:
#	packages/react/README.md
@nbarraclough

Copy link
Copy Markdown
Member Author

Rebased onto main now that #94, #95 and #96 have merged — pushed as 20992be.

There was a merge conflict. #94 was squash-merged as b23827f, so this branch's base commit isn't in main's history and packages/react/README.md collided.

Resolved by taking this branch's version, which is safe because the rewrite already supersedes what landed in #94 — it carries all four @nylas/react/connect imports plus the corrected Exports overview line. I diffed main's copy of the file against this branch's base first to confirm main had nothing else in it beyond #94's fix, so nothing was dropped in the resolution.

Verified after resolving:

  • All 11 house-style sections present, no conflict markers.
  • Every code sample intact (spot-checked nylasSessionsConfig, schedulerPreviewLink, requires_session_auth, npm run dev -- --port, handleCodeExchange, getIdpToken).
  • All four Connect imports still point at @nylas/react/connect.
  • Net diff against main is just this PR's changeset plus the README restructure.

The earlier approval was auto-dismissed by the new commits, so this needs a fresh look when you have a moment — no content has changed since your review beyond the utils row you asked for.

@nbarraclough
nbarraclough merged commit e24f3ab into main Sep 1, 2026
6 checks passed
@nbarraclough
nbarraclough deleted the docs/react-readme-house-style branch September 1, 2026 18:26
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.

2 participants