Skip to content

CodeMirror stack 1/4: upgrade to latest 6.x, fix sql() option names, rollup build#2834

Draft
asg017 wants to merge 2 commits into
mainfrom
asg017/codemirror-1-upgrade
Draft

CodeMirror stack 1/4: upgrade to latest 6.x, fix sql() option names, rollup build#2834
asg017 wants to merge 2 commits into
mainfrom
asg017/codemirror-1-upgrade

Conversation

@asg017

@asg017 asg017 commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Part 1 of the CodeMirror stack (integration view: #2833). Pure maintenance — no behavior change beyond a fresher editor.

What

  • Upgrade to current CodeMirror 6.x: codemirror 6.0.1 → 6.0.2, @codemirror/lang-sql 6.3.3 → 6.10.0, transitives refreshed (autocomplete 6.20.3, view 6.43.6, state 6.7.1). Everything is still major-version 6 — no breaking changes; no CodeMirror 7 exists.
  • Fixes a long-standing silent bug: sql() was called with defaultTableName / defaultSchemaName, which have never been valid lang-sql options (the real names are defaultTable / defaultSchema). They were silently ignored — nothing supplied them, but part 2 of the stack makes defaultTable load-bearing.
  • caseInsensitiveIdentifiers: true on the curated SQLite dialect (lang-sql ≥ 6.7): stops completions auto-quoting mixed-case identifiers.
  • Version-agnostic filenames: cm-editor-6.0.1.{js,bundle.js}cm-editor.{js,bundle.js} (git records clean renames), so upgrades no longer require editing a template. Cache busting was already handled by the static() template helper's ?_hash= content hash.
  • Real build config: rollup.config.mjs + npm run build:codemirror replace the six-flag one-liner previously documented in docs/contributing.rst; docs rewritten accordingly.

Review notes

Testing

Full pytest suite green. Manual QA: editor mounts on /fixtures, completion popup, Shift/Meta-Enter submit, Format SQL, resize handle.

The stack

# PR Content
1/4 #2834 CM 6.x upgrade, option-name bugfix, rollup build
2/4 #2835 Rich schema autocomplete, /-/editor-schema.json, defaultTable
3/4 #2836 datasette-sql-editor ESM primitives
4/4 #2837 <datasette-sql-editor> element + core-page dogfood

Each PR is based on the previous branch; merge top-down, retargeting the next base to main as each lands. Bundle files (*.bundle.js) conflict on rebase by nature — resolve by re-running npm run build:codemirror, never by merging. Integration view of the whole branch: #2833.

🤖 Generated with Claude Code

asg017 and others added 2 commits July 10, 2026 10:39
codemirror 6.0.1 -> 6.0.2, @codemirror/lang-sql 6.3.3 -> 6.10.0
(autocomplete 6.20.3, view 6.43.6, state 6.7.1).
defaultTableName/defaultSchemaName were never valid SQLConfig options;
the real names are defaultTable/defaultSchema. Also enables
caseInsensitiveIdentifiers on the SQLite dialect.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
cm-editor-6.0.1.{js,bundle.js} -> cm-editor.{js,bundle.js}; new
npm run build:codemirror replaces the documented rollup one-liner.
Cache busting already handled by the static() template helper's
?_hash= content hash.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (db82123) to head (28d8113).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2834   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         73      73           
  Lines      12208   12208           
=====================================
  Misses     12208   12208           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant