Merged Axel changes. Added dev docs for Cline

This commit is contained in:
Richard Osborne
2025-12-06 22:37:54 +01:00
parent da40209322
commit 9a5952ec13
15 changed files with 3927 additions and 0 deletions

View File

@@ -0,0 +1,140 @@
# TASK-001 Changelog
Track all changes made during this task. Update this file as you work.
---
## [Date] - [Your Name/Handle]
### Summary
[To be filled in as work progresses]
### Starting Point
- Based on branch: `12-upgrade-dependencies`
- Previous work by: [previous developer]
- Previous commits include:
- Package.json dependency updates
- "Update rendering to use non-deprecated react-dom calls"
---
## Dependency Fixes
### Package: [package-name]
- **Issue**: [What was wrong]
- **Fix**: [What was changed]
- **File**: `path/to/package.json`
---
## React 19 Migration
### File: [filename]
- **Before**: `ReactDOM.render(<App />, element)`
- **After**: `createRoot(element).render(<App />)`
- **Notes**: [Any relevant context]
---
## react-instantsearch Migration
### File: HelpCenter.tsx
- **Before**: `import { ... } from 'react-instantsearch-hooks-web'`
- **After**: `import { ... } from 'react-instantsearch'`
- **API Changes**: [List any API differences encountered]
---
## Build Fixes
### Error: [Error message]
- **Cause**: [Why it happened]
- **Fix**: [What was changed]
- **File**: `path/to/file`
---
## Build Optimizations
### Optimization: [Name]
- **Before**: Build time X seconds
- **After**: Build time Y seconds
- **Change**: [What was optimized]
---
## Files Modified
<!-- Update this list as you make changes -->
- [ ] `package.json` (root)
- [ ] `packages/noodl-editor/package.json`
- [ ] `packages/noodl-core-ui/package.json`
- [ ] `packages/noodl-viewer-react/package.json`
- [ ] `packages/noodl-editor/src/editor/src/views/HelpCenter/HelpCenter.tsx`
- [ ] [Add more as needed]
---
## Files Created
<!-- List any new files created -->
- None expected for this task
---
## Files Deleted
<!-- List any files removed -->
- None expected for this task
---
## Breaking Changes
- React 19 requires Node.js 18+ (documented in root package.json engines)
- [Add any other breaking changes discovered]
---
## Testing Notes
### Automated Tests
- `npm run test:editor`: [PASS/FAIL] - [Notes]
- `npm run test:platform`: [PASS/FAIL] - [Notes]
- `npx tsc --noEmit`: [PASS/FAIL] - [Notes]
### Manual Tests
- Dev server start: [PASS/FAIL]
- Create project: [PASS/FAIL]
- Node operations: [PASS/FAIL]
- Preview: [PASS/FAIL]
- Help Center search: [PASS/FAIL]
- Hot reload: [PASS/FAIL]
---
## Known Issues
<!-- Document any issues discovered that aren't fixed in this task -->
1. [Issue description] - [Will be addressed in TASK-XXX]
---
## Follow-up Tasks
<!-- Note any work that should be done in future tasks -->
1. [Follow-up item] - Suggested for TASK-XXX
---
## Final Summary
[To be completed when task is done]
**Total files modified**: X
**Total lines changed**: +X / -Y
**Build time**: Before X sec → After Y sec
**Tests**: All passing / X failures
**Confidence**: X/10

View File

@@ -0,0 +1,123 @@
# TASK-001 Checklist
## Prerequisites
- [ ] Read README.md completely
- [ ] Understand React 19 breaking changes
- [ ] Have Node.js 18+ installed
- [ ] Clone the repository fresh (or ensure clean state)
## Phase 1: Setup
- [ ] Checkout existing work: `git checkout 12-upgrade-dependencies`
- [ ] Create task branch: `git checkout -b task/001-dependency-updates`
- [ ] Delete node_modules: `rm -rf node_modules packages/*/node_modules`
- [ ] Clean install: `npm install`
- [ ] Document any install errors in NOTES.md
- [ ] Note: confidence level for this phase: __/10
## Phase 2: Dependency Conflicts
- [ ] List all peer dependency warnings
- [ ] Research each warning
- [ ] Fix conflicts in root package.json
- [ ] Fix conflicts in packages/noodl-editor/package.json
- [ ] Fix conflicts in packages/noodl-core-ui/package.json
- [ ] Fix conflicts in packages/noodl-viewer-react/package.json
- [ ] Fix conflicts in other packages as needed
- [ ] Verify clean `npm install`
- [ ] Document fixes in CHANGELOG.md
- [ ] Note: confidence level for this phase: __/10
## Phase 3: Build Errors
- [ ] Run `npm run build:editor`
- [ ] List all build errors
- [ ] Fix error 1: _______________
- [ ] Fix error 2: _______________
- [ ] Fix error 3: _______________
- [ ] (add more as needed)
- [ ] Verify clean build
- [ ] Document fixes in CHANGELOG.md
- [ ] Note: confidence level for this phase: __/10
## Phase 4: React 19 Migration
- [ ] Search for ReactDOM.render usage:
```bash
grep -rn "ReactDOM.render" packages/ --include="*.ts" --include="*.tsx" --include="*.js"
```
- [ ] List all files found: _______________
- [ ] Update file 1: _______________
- [ ] Update file 2: _______________
- [ ] (add more as needed)
- [ ] Search for ReactDOM.hydrate usage
- [ ] Search for ReactDOM.unmountComponentAtNode usage
- [ ] Update any found
- [ ] Verify no legacy ReactDOM usage remains
- [ ] Document changes in CHANGELOG.md
- [ ] Note: confidence level for this phase: __/10
## Phase 5: react-instantsearch Migration
- [ ] Open `packages/noodl-editor/src/editor/src/views/HelpCenter/HelpCenter.tsx`
- [ ] Update import from `react-instantsearch-hooks-web` to `react-instantsearch`
- [ ] Check all hooks used are still available
- [ ] Search for other files using old package:
```bash
grep -rn "react-instantsearch-hooks-web" packages/
```
- [ ] Update any other files found
- [ ] Test search functionality works
- [ ] Document changes in CHANGELOG.md
- [ ] Note: confidence level for this phase: __/10
## Phase 6: Build Optimization (Optional but Recommended)
- [ ] Measure current build time: ___ seconds
- [ ] Check webpack config for cache settings
- [ ] Enable persistent caching if not enabled
- [ ] Check for unnecessary rebuilds
- [ ] Measure new build time: ___ seconds
- [ ] Document optimizations in CHANGELOG.md
## Phase 7: Testing - Automated
- [ ] Run `npm run test:editor`
- [ ] All tests pass
- [ ] Note any failures: _______________
- [ ] Run `npm run test:platform`
- [ ] All tests pass
- [ ] Note any failures: _______________
- [ ] Run `npx tsc --noEmit`
- [ ] No TypeScript errors
- [ ] Note any errors: _______________
## Phase 8: Testing - Manual
- [ ] Start dev server: `npm run dev`
- [ ] Starts without errors
- [ ] No console warnings about deprecated APIs
- [ ] Create new project
- [ ] Add Group node to canvas
- [ ] Add Text node as child
- [ ] Connect nodes
- [ ] Open preview
- [ ] Edit text content, verify preview updates
- [ ] Save and reopen project
- [ ] Open Help Center, test search (react-instantsearch)
- [ ] Edit Function node code
- [ ] Change a file, verify hot reload works
- [ ] Build production: `npm run build:editor`
## Phase 9: Cleanup & Documentation
- [ ] Remove any debug console.logs added
- [ ] Review all changes for code quality
- [ ] Complete CHANGELOG.md with summary
- [ ] Update NOTES.md with learnings
- [ ] Self-review: confidence level __/10
## Phase 10: Completion
- [ ] All success criteria met (see README.md)
- [ ] Create pull request
- [ ] PR title: "TASK-001: Dependency Updates & Build Modernization"
- [ ] PR description includes:
- [ ] Summary of changes
- [ ] Testing performed
- [ ] Any known issues or follow-ups
- [ ] Mark task complete
## Final Confidence Check
- Overall confidence this task is complete and correct: __/10
- Remaining concerns: _______________

View File

@@ -0,0 +1,128 @@
# TASK-001 Working Notes
## Research
### Previous Developer's Work
**Branch**: `12-upgrade-dependencies`
**Commits found**:
1. Package.json updates across all packages
2. "Update rendering to use non-deprecated react-dom calls"
**What they changed**:
- React 17.0.2 → 19.0.0
- react-instantsearch-hooks-web → react-instantsearch
- Removed deprecated react-json-view, added @microlink/react-json-view
- Updated webpack 5.74.0 → 5.101.3
- Removed Node.js upper version cap (was <=18, now 16+)
- Removed Storybook 6.x packages
### React 19 Breaking Changes to Watch For
1. **Automatic Batching** - State updates are now automatically batched
2. **Concurrent Features** - May affect node graph rendering timing
3. **Strict Mode** - Double-renders effects for cleanup detection
4. **Removed APIs**:
- `ReactDOM.render()``createRoot()`
- `ReactDOM.hydrate()``hydrateRoot()`
- `ReactDOM.unmountComponentAtNode()``root.unmount()`
### react-instantsearch Changes
The package was renamed from `react-instantsearch-hooks-web` to `react-instantsearch`.
Most APIs are compatible, but verify:
- `useHits`
- `useSearchBox`
- `InstantSearch` component props
### Files to Search
```bash
# Find ReactDOM.render usage
grep -rn "ReactDOM.render" packages/ --include="*.ts" --include="*.tsx" --include="*.js"
# Find old instantsearch imports
grep -rn "react-instantsearch-hooks-web" packages/
# Find any remaining TSFixme (for awareness, not this task)
grep -rn "TSFixme" packages/ --include="*.ts" --include="*.tsx"
```
---
## Assumptions
- [ ] Previous dev's changes are on `12-upgrade-dependencies` branch - **VERIFY**
- [ ] Build was working before their changes - **VERIFY by checking main**
- [ ] No other branches need to be merged first - **VERIFY**
---
## Implementation Notes
### Approach Decisions
[To be filled in during work]
### Gotchas / Surprises
[To be filled in during work]
---
## Debug Log
### [Date/Time]
- **Trying**: [what you're attempting]
- **Result**: [what happened]
- **Next**: [what to try next]
---
## Useful Commands
```bash
# Clean install
rm -rf node_modules packages/*/node_modules
npm install
# Build editor
npm run build:editor
# Run tests
npm run test:editor
# Type check
npx tsc --noEmit
# Start dev server
npm run dev
# Find files with pattern
grep -rn "pattern" packages/ --include="*.ts" --include="*.tsx"
# Check git status
git status
git diff --stat
# Compare with main
git diff main..HEAD --stat
```
---
## Questions to Resolve
- [ ] Are there any other branches that should be merged first?
- [ ] Did the previous dev test the build?
- [ ] Are there any known issues documented anywhere?
---
## Links & Resources
- [React 19 Blog Post](https://react.dev/blog/2024/04/25/react-19)
- [React 19 Upgrade Guide](https://react.dev/blog/2024/04/25/react-19-upgrade-guide)
- [react-instantsearch Migration](https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/react/)

View File

@@ -0,0 +1,218 @@
# TASK-001: Dependency Updates & Build Modernization
## Metadata
| Field | Value |
|-------|-------|
| **ID** | TASK-001 |
| **Phase** | Phase 1 - Foundation |
| **Priority** | 🔴 Critical |
| **Difficulty** | 🟡 Medium |
| **Estimated Time** | 2-3 days |
| **Prerequisites** | None (this is the first task) |
| **Branch** | `task/001-dependency-updates` |
| **Related Branches** | `12-upgrade-dependencies` (previous dev work) |
## Objective
Complete and validate all dependency updates, fully migrate to React 19, and modernize the build pipeline for reliable, fast development.
## Background
A previous developer started this work on the `12-upgrade-dependencies` branch. They updated package.json files across the monorepo, including:
- React 17 → 19
- Various webpack, typescript, and tooling updates
- Removed Node.js version upper cap
They also made a commit "Update rendering to use non-deprecated react-dom calls" which addressed some React 19 breaking changes.
This task completes that work, validates everything works, and improves the overall build experience.
## Current State
### What Exists
- Branch `12-upgrade-dependencies` with package.json updates
- Some React 19 migration work done
- Build may have errors or warnings
### Known Issues
- `react-instantsearch-hooks-web` renamed to `react-instantsearch` (breaking API change)
- `ReactDOM.render()` deprecated in React 18+
- Potential peer dependency conflicts
- Hot reload may be unreliable
- Build times are slow
### Key Package Changes (from previous dev)
| Package | Old | New | Breaking Changes |
|---------|-----|-----|------------------|
| react | 17.0.2 | 19.0.0 | Yes - see below |
| react-dom | 17.0.0 | 19.0.0 | Yes - render API |
| react-instantsearch-hooks-web | 6.38.0 | react-instantsearch 7.16.2 | Yes - renamed |
| webpack | 5.74.0 | 5.101.3 | Minor |
| typescript | 4.8.3 | 4.9.5 | Minor |
## Desired State
After this task:
- All packages build without errors
- No deprecation warnings in console
- React 19 fully adopted (no legacy patterns)
- Hot reload works reliably
- Build completes in <60 seconds
- All existing tests pass
## Scope
### In Scope
- [x] Validate and fix dependency updates
- [x] Complete React 19 migration
- [x] Fix all build errors and warnings
- [x] Update react-instantsearch usage
- [x] Improve build performance
- [x] Fix hot reload issues
### Out of Scope
- Major refactoring (that's later tasks)
- New features
- TSFixme cleanup (TASK-002)
- Storybook 9 migration (can be separate task)
## Technical Approach
### Key Files to Modify
| File | Changes |
|------|---------|
| `package.json` (root) | Verify dependencies, fix conflicts |
| `packages/*/package.json` | Verify peer deps, fix conflicts |
| `packages/noodl-editor/src/editor/src/views/HelpCenter/HelpCenter.tsx` | Update react-instantsearch imports |
| Any file with `ReactDOM.render` | Migrate to createRoot |
| `packages/noodl-viewer-react/` | React 19 compatibility |
### React 19 Migration Points
```typescript
// OLD (React 17)
import ReactDOM from 'react-dom';
ReactDOM.render(<App />, document.getElementById('root'));
// NEW (React 19)
import { createRoot } from 'react-dom/client';
const root = createRoot(document.getElementById('root'));
root.render(<App />);
```
Search for these patterns:
```bash
grep -r "ReactDOM.render" packages/ --include="*.ts" --include="*.tsx" --include="*.js"
grep -r "ReactDOM.hydrate" packages/ --include="*.ts" --include="*.tsx" --include="*.js"
grep -r "ReactDOM.unmountComponentAtNode" packages/ --include="*.ts" --include="*.tsx" --include="*.js"
```
### react-instantsearch Migration
```typescript
// OLD
import { InstantSearch, Hits } from 'react-instantsearch-hooks-web';
// NEW
import { InstantSearch, Hits } from 'react-instantsearch';
```
The API is mostly compatible, but verify all hooks used still exist.
## Implementation Steps
### Step 1: Setup and Initial Validation
1. Checkout the existing branch: `git checkout 12-upgrade-dependencies`
2. Create our task branch: `git checkout -b task/001-dependency-updates`
3. Clean install: `rm -rf node_modules && npm install`
4. Document any install errors in NOTES.md
### Step 2: Fix Dependency Conflicts
1. Run `npm install` and note all peer dependency warnings
2. For each warning, determine the correct resolution
3. Update package.json files as needed
4. Repeat until `npm install` runs cleanly
### Step 3: Fix Build Errors
1. Run `npm run build:editor`
2. Fix each error one at a time
3. Document each fix in CHANGELOG.md
4. Repeat until build succeeds
### Step 4: React 19 Migration
1. Search for deprecated ReactDOM calls
2. Update each to use createRoot pattern
3. Check for class component lifecycle issues
4. Test each changed component
### Step 5: react-instantsearch Update
1. Update imports in HelpCenter.tsx
2. Verify all hooks/components still available
3. Test search functionality
### Step 6: Build Optimization
1. Analyze current build time
2. Check webpack configs for optimization opportunities
3. Enable caching if not already
4. Measure improvement
### Step 7: Validation
1. Run full test suite
2. Manual testing of key workflows
3. Verify hot reload works
4. Check for console warnings
## Testing Plan
### Automated Tests
- [ ] Run `npm run test:editor` - all pass
- [ ] Run `npm run test:platform` - all pass
- [ ] Run `npx tsc --noEmit` - no type errors
### Manual Testing Scenarios
- [ ] Start dev server: `npm run dev` - starts without errors
- [ ] Create new project - works
- [ ] Add nodes to canvas - works
- [ ] Connect nodes - works
- [ ] Preview project - works
- [ ] Edit code in Function node - works
- [ ] Hot reload when editing - works
- [ ] Search in Help Center - works (react-instantsearch)
- [ ] Build for production - works
## Success Criteria
- [ ] `npm install` completes with no errors
- [ ] `npm run build:editor` completes with no errors
- [ ] `npm run test:editor` all tests pass
- [ ] `npx tsc --noEmit` no TypeScript errors
- [ ] No deprecation warnings in browser console
- [ ] Hot reload works reliably
- [ ] All manual test scenarios pass
## Risks & Mitigations
| Risk | Mitigation |
|------|------------|
| React 19 breaks something subtle | Extensive manual testing, rollback plan ready |
| react-instantsearch API changes | Read migration guide, test search thoroughly |
| Build time regression | Measure before/after, optimize if needed |
| Peer dependency hell | Use `--legacy-peer-deps` as last resort, document why |
## Rollback Plan
If major issues discovered:
1. Checkout main branch
2. Cherry-pick any non-breaking fixes
3. Document issues for future attempt
4. Consider incremental approach (React 18 first, then 19)
## References
- [React 19 Release Notes](https://react.dev/blog/2024/04/25/react-19)
- [react-instantsearch v7 Migration](https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/react/)
- Previous dev branch: `12-upgrade-dependencies`
- Previous dev commit: "Update rendering to use non-deprecated react-dom calls"