-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat(@lexical/devtools): Added TreeView rendering instead of a simple textarea #5830
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
265eb4a
to
9916b80
Compare
9916b80
to
f20069d
Compare
f20069d
to
10e09b1
Compare
|
||
return false; | ||
}, | ||
COMMAND_PRIORITY_HIGH, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want this to be the highest priority (CRITICAL) to have higher confidence it'll be executed. On a related note, there're some changes commands won't be logged if any plugin is added dynamically and extension (extension is initialized before plugin is enabled). Although I'd argue it should be very rare scenario
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shall add your 2nd concern to the refresh procedure (I'll create issue)
Regarding criticality - I just moved this code from existing TreeView, but your point sounds right, will update it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
const newState = [...state]; | ||
newState.push({ | ||
payload, | ||
type: command.type ? command.type : 'UNKNOWN', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: command.type ?? 'UNKNOWN'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change causes error in WWW build, so leaving as is:
node scripts/build.js --www --prod
/home/runner/work/lexical/lexical/node_modules/@ampproject/rollup-plugin-closure-compiler/dist/index.js:1571
[33](https://github.com/facebook/lexical/actions/runs/8604009341/job/23577172760?pr=5830#step:9:34)
reject(new Error(`Google Closure Compiler exit ${exitCode}: ${stdErr}`));
ERROR - [JSC_LANGUAGE_FEATURE] This language feature is only supported for ECMASCRIPT_***0***0 mode or better: Nullish coalescing.
onMessage('generateTreeViewContent', (message) => { | ||
const editor = queryLexicalEditorByKey(message.data.key); | ||
if (editor == null) { | ||
throw new Error(`Can't find editor with key: ${message.data.key}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: what happens when extension throws?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error will be passed to the caller side (devtools tab) and there we show message to the used at the top of the page now.
It's lame, so better error/log system shall be in place, but not in this PR :P I'll create issue for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added to the plan here: #5675 (comment)
10e09b1
to
7cbbc71
Compare
7cbbc71
to
f9017fd
Compare
List of changes:
@lexical/devtools-core
that will contain all UIs for Lexical debugging. As we may want to use them outside of the extension (like nowTreeView
is a part of the@lexical/react
)EditorSetOptions
type fromlexical
packageFeature demo in Chrome:
Screen.Recording.2024-04-04.at.6.38.48.PM.mov
Feature demo in Firefox:
Screen.Recording.2024-04-04.at.6.46.13.PM.mov