-
Notifications
You must be signed in to change notification settings - Fork 31
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
SITES-16562 - [Xwalk] Open Universal Editor from Franklin Sidekick #17
Conversation
- port code from wknd project
- hide the default buttons
The
although the description contains test URLs. |
scripts/sidekick.js
Outdated
// hide the default buttons | ||
const container = await getElement(sk, '.plugin-container'); | ||
container.style.visibility = 'hidden'; | ||
for (let i = 0; i < ['edit', 'reload', 'publish', 'delete', 'unpublish'].length; i += 1) { |
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.
use ['edit', 'reload', 'publish', 'delete', 'unpublish'].forEach(async (action) => { ... })
instead
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 was giving a linting error. That's why I used the for
loop.
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.
but then at least define array as a variable and don't duplicate 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.
addressed in 5c102d6
scripts/scripts.js
Outdated
@@ -142,6 +143,7 @@ function loadDelayed() { | |||
// eslint-disable-next-line import/no-cycle | |||
window.setTimeout(() => import('./delayed.js'), 3000); | |||
// load anything that can be postponed to the latest here | |||
initSidekick(); |
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.
better do an import('./sidekick.js').then(({ initSidekick }) => initSidekick());
here
that defers loading the script until after loadLazy finished. with the static import at the top scripts.js only executes with the script loaded and hence we impact LCP.
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.
addressed in 8fd5333
- address review feedback
- address review feedback
Fix SITES-16562
Test URLs:
Example: