Skip to content

fix(tiptap): merge Context.ts into Context.tsrx to remove the ./Context ambiguity - #1502

Merged
trueadm merged 2 commits into
octanejs:mainfrom
aleclarson:fix/tiptap-context-specifiers
Oct 1, 2026
Merged

trueadm merged 2 commits into
octanejs:mainfrom
aleclarson:fix/tiptap-context-specifiers

Conversation

@aleclarson

@aleclarson aleclarson commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Merge Context.ts into Context.tsrx so the package has one Context module again, matching upstream Context.tsx.

Why

  • src/Context.ts and src/Context.tsrx share the ./Context specifier. Resolvers that order .tsrx ahead of .ts (the octane toolchain resolves .tsrx first when compiling consumers' programs over shipped sources) then resolve ./Context to Context.tsrx from every site:
    • Context.tsrx imports EditorContext/useCurrentEditor/EditorContextValue from ./Context — a self-import that reports missing exports.
    • index.ts star-exports both './Context' and './Context.tsrx', which then resolve to the same module — duplicate re-exports of EditorContext, EditorContextValue, and useCurrentEditor.
  • Found while consuming the published package under tsrx-tsc with .tsrx prioritized. Explicit .ts specifiers would also fix it but impose allowImportingTsExtensions on every consumer of this source-shipped package; the merge carries no new toolchain requirement and restores the upstream file mapping one-to-one.

Changes

  • src/Context.tsrx: gains the EditorContextValue type, EditorContext constant, and useCurrentEditor hook (contents of the deleted Context.ts).
  • src/Context.tsrx.d.ts: declares the moved exports.
  • src/Context.ts: deleted.
  • src/index.ts: single export * from './Context.tsrx' (the './Context' star-export was the ambiguous one).
  • src/Tiptap.tsrx: imports EditorContext from './Context.tsrx'.

Validation

  • pnpm format:files (changed files unchanged)
  • pnpm typecheck:files (tsrx-tsc, clean)
  • targeted tests: vitest run --project tiptap --project tiptap-ssr --project tiptap-pristine --project tiptap-upstream --project tiptap-differential — 25 files / 45 tests pass
  • pnpm upstream:verify — pristine/adapted trees verified, no missing/mismatched/unexpected
  • pnpm format:check (not run — repo-wide)
  • pnpm test (not run — repo-wide)

Risk / follow-ups

  • Public export surface unchanged (the same names arrive from the same barrel). The port's Context.tsx ↔ Context.tsrx correspondence is restored rather than forked.

Provenance

  • An agent produced this diff (agent-authored)

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Note

Low Risk
Refactor consolidates duplicate modules and fixes import paths; no behavioral or API surface change for consumers.

Overview
Fixes module resolution when the toolchain prefers .tsrx over .ts: Context.ts and Context.tsrx both answered to ./Context, which caused Context.tsrx to self-import missing symbols and index.ts to star-export the same module twice.

The PR deletes Context.ts and inlines EditorContextValue, EditorContext, and useCurrentEditor into Context.tsrx (and its .d.ts), matching upstream’s single Context.tsx layout. The barrel now exports only ./Context.tsrx, and internal imports (Tiptap.tsrx, menu components) point at Context.tsrx explicitly. Public export names are unchanged—only where they are defined and how resolution works.

Reviewed by Cursor Bugbot for commit 7b7e5a5. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix labels Oct 1, 2026
@aleclarson
aleclarson marked this pull request as ready for review October 1, 2026 15:39
@trueadm
trueadm merged commit 5e5f523 into octanejs:main Oct 1, 2026
29 checks passed
trueadm added a commit that referenced this pull request Oct 1, 2026
…resource-leaks

Both branches merged main's #1482 squash separately, so the merge had two
bases. This branch already contains #1483's changes, so conflicts keep
this side; the only new content is main's tiptap fix (#1502).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 1, 2026
Brings in #1500, #1471, and #1502. #1500 changes vitest.config.js, which every
user-app grader digest covers, so manifest.jsonl is regenerated rather than
hand-merged. The Strong repair ledger, prompts, and alternatives are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
aleclarson added a commit to octane-xplat/octane-xplat that referenced this pull request Oct 1, 2026
…iptap patch

PR octanejs/octane#1501 (process.env guard) was closed upstream; the
patched source should not diverge in runtime behavior. The patch now only
adds a module-local process declaration for typecheck and keeps the
Context merge, which is being upstreamed as octanejs/octane#1502.
aleclarson added a commit to octane-xplat/octane-xplat that referenced this pull request Oct 8, 2026
The ambient @nativescript/types URL declaration (no toJSON, matching the
native runtime) owns the global URL binding in app typecheck programs, so
new URL(...) in these node-side configs no longer satisfies fs PathLike,
which wants import("url").URL. Import the node class explicitly.

---

chore(deps): bump @nativescript/types to 9.1.4 and @octanejs/tiptap to 0.0.52

@nativescript/types 9.1.4 ships the URL/URLSearchParams ambient
declarations (NativeScript/NativeScript#11482), so the pnpm patch is
dropped entirely — manifest entry, patch file, and patchedDependencies.

@octanejs/tiptap 0.0.52 lands the './Context' disambiguation
(octanejs/octane#1502), so the patch shrinks to the remaining
process.env guard in useEditor.ts (closed unmerged upstream).

types-ios 9.1.3 tightens nullability: NSNotification.userInfo and
UIApplication.keyWindow are now nullable — optional-chain the
interruption observer reads in audio.ios and cast the keyWindow
fallback in auth-session.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants