Skip to content

Conversation

@sid1029
Copy link

@sid1029 sid1029 commented Aug 1, 2025

Introducing a few more config props & bundling changes

The current implementation uses:

import * as monacoEditor from 'monaco-editor'

which causes the entire 3.2MB Monaco Editor library to be bundled with the solid-monaco wrapper, defeating the purpose of dynamic loading.

✅ Changed to import type * as monacoEditor from 'monaco-editor' (types only)
✅ Added CDN fallback for out-of-the-box functionality

This also addresses ##7
Fixed type definition for DiffEditor options so diff editor specific features can be configured.

New Features

  • line prop: Jump to specific line numbers in the editor
  • onBeforeMount prop: Configure Monaco before editor creation (renamed from beforeMount)
  • onValidate prop: Real-time validation marker callbacks

Added some documentation for how to use the library.

Added a devcontainer config.

GitHub Actions Updates

  • Modernized workflows: Updated all actions to latest versions (@v4, @v5, @V3)
  • Matrix testing: Added Node.js 18/20/22 testing
  • New release workflow: Automated NPM publishing and GitHub releases

Siddhesh Vichare added 10 commits July 30, 2025 17:08
- Add line prop for jumping to specific line numbers
- Add beforeMount callback for pre-editor setup
- Add onValidate callback for validation markers
- Add line positioning effect with proper reactivity
- Add comprehensive TypeScript interfaces
- Add devcontainer configuration for Node.js 24
- Add basic tests for new props functionality

These changes improve monaco-react compatibility and provide
better developer experience for Monaco Editor integration.
- Document line prop for line positioning
- Document beforeMount callback for pre-editor setup
- Document onValidate callback for validation markers
- Add comprehensive usage examples for each new feature
- Highlight new props in props table with bold formatting

These docs help developers understand and adopt the new
monaco-react compatibility features.
…props

- Fix options prop to use IStandaloneDiffEditorConstructionOptions instead of IStandaloneEditorConstructionOptions
- Add beforeMount prop with full implementation for pre-editor setup
- Improve TypeScript type annotations throughout
- Fix container ref handling with proper undefined checks
- Update documentation to reflect all enhancements

This resolves the incorrect options type that was preventing proper
diff editor configuration and adds feature parity with MonacoEditor
for the beforeMount callback functionality.
- Enable corepack for pnpm in devcontainer
- Change to root user for better permissions
- Add .pnpm-store to gitignore
- Fix readonly array type for Monaco validation markers
- Remove unnecessary type assertions in ref assignments
- Ensure all linting passes with zero warnings

All validation complete: TypeScript compilation, tests, build, and linting all pass successfully.
…the bundle size of any downstream project consuming this library. Instead import only the types and use CDN URL as the fallback.
@sid1029 sid1029 marked this pull request as draft August 3, 2025 16:20
@sid1029 sid1029 marked this pull request as ready for review August 3, 2025 16:20
@sid1029
Copy link
Author

sid1029 commented Aug 4, 2025

@alxnddr would you be able to take a look at this ?

This effectively reverts your latest change that bundles 'monaco-editor' with solid-monaco. I've described an alternate way of bundling monaco-editor in the readme while still keeping the old way of CDN loading monaco as the default.

Proposing this because currently we (and others #7) are not able to upgrade to the newer version of solid-monaco.

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