Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodeMirror lint: stop patching global lint #26013

Merged
merged 1 commit into from
Nov 20, 2024
Merged

Conversation

salazarm
Copy link
Contributor

@salazarm salazarm commented Nov 19, 2024

Summary & Motivation

We currently override CodeMirror's global lint addon with a custom implementation that conflicts with the original addon. This incompatibility surfaced while developing the new asset selection syntax input; specifically, loading the launchpad and then accessing the new syntax input triggers JavaScript errors due to the overridden lint behavior.

To fix this issue, this PR stops patching the global lint addon and instead uses a separate patchedLint namespace. By doing so, our custom lint functionality is isolated to specific editor instances, allowing the original lint addon to operate correctly in other editors without interference.

How I Tested These Changes

Use the launchpad and see that it lints and surfaces errors correctly by starting with a valid config, adding invalid stuff, and then making it valid again and making sure we lint each step along the way.

Screenshot 2024-11-19 at 3 41 55 PM Screenshot 2024-11-19 at 3 42 28 PM Screenshot 2024-11-19 at 3 42 20 PM

Copy link

Deploy preview for dagit-storybook ready!

✅ Preview
https://dagit-storybook-4d7tog72t-elementl.vercel.app
https://salazarm-patched-lint.components-storybook.dagster-docs.io

Built with commit 3c0c5f7.
This pull request is being automatically deployed with vercel-action

@salazarm salazarm merged commit 21818b6 into master Nov 20, 2024
2 checks passed
@salazarm salazarm deleted the salazarm/patched-lint branch November 20, 2024 16:07
pskinnerthyme pushed a commit to pskinnerthyme/dagster that referenced this pull request Dec 16, 2024
## Summary & Motivation

We currently override CodeMirror's global lint addon with a custom
implementation that conflicts with the original addon. This
incompatibility surfaced while developing the new asset selection syntax
input; specifically, loading the launchpad and then accessing the new
syntax input triggers JavaScript errors due to the overridden lint
behavior.

To fix this issue, this PR stops patching the global lint addon and
instead uses a separate patchedLint namespace. By doing so, our custom
lint functionality is isolated to specific editor instances, allowing
the original lint addon to operate correctly in other editors without
interference.


## How I Tested These Changes

Use the launchpad and see that it lints and surfaces errors correctly by
starting with a valid config, adding invalid stuff, and then making it
valid again and making sure we lint each step along the way.

<img width="1089" alt="Screenshot 2024-11-19 at 3 41 55 PM"
src="https://github.com/user-attachments/assets/c58e9637-42cf-4c28-9f75-5b5f50d1dce7">
<img width="908" alt="Screenshot 2024-11-19 at 3 42 28 PM"
src="https://github.com/user-attachments/assets/74a66579-2a1f-487a-bfa5-a817793bd102">
<img width="784" alt="Screenshot 2024-11-19 at 3 42 20 PM"
src="https://github.com/user-attachments/assets/b895f385-a0ad-42b4-bc8f-47944dc2e284">
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.

2 participants