wip: New Monaco editor integration#3436
Closed
msmithstubbs wants to merge 8 commits into
Closed
Conversation
Contributor
|
@msmithstubbs can you give this lib a try to see if we can have a more lightweight testing strategy for the js areas, especially for Monaco editor testing |
618f13e to
727ccd4
Compare
Contributor
Author
|
I've got the JSDOM library working locally but the biggest missing piece is cookie support so it can hit authenticated routes. Could submit a PR for this? Or is there another approach to take? If we just want to test the monaco editor in isolation we could just mount it in a harness designed for testing, and leave Playwright to handle full integration testing |
727ccd4 to
a8a4050
Compare
Contributor
Author
|
Closing, now #3525 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Early WIP don't review yet.
The goal is to replace the existing LiveMonacoEditor component with a simpler, more testable model. This approach uses a hidden <textarea> element to store the edited code. The Monaco editor instance writes updates to that element, which in turn triggers the standard form change event handled by LiveView. Updates from LiveView still use a hook, but the Monaco editor itself no longer sends events directly to LiveView. This should be much closer to the familiar form-backed LiveView model.
The intention is to enable JavaScript-based test coverage for editor and DOM interactions without requiring a running LiveView instance. I also expect to add a small number of end-to-end Playwright tests to sanity-check the integration.
Another advantage of this approach is that it allows us to vendor the Monaco JavaScript dependencies directly into our repository.
Follows #3444
Fixes O11Y-1684
TODO