-
Notifications
You must be signed in to change notification settings - Fork 875
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
removed vscode compilation & use vscode-web package #118
Conversation
* removed vscode compilation * use vscode-web package
<!-- <div id='load-spinner' aria-label="loading"> | ||
<div class="lds-roller"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div> | ||
</div> | ||
</div> --> |
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.
Loader is disabled by this comment.
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 see, the issue is how we delete the element after the vscode-web loaded in browser.
This patch will work:
diff --git a/resources/index.html b/resources/index.html
index 9f05f8b..c014364 100644
--- a/resources/index.html
+++ b/resources/index.html
@@ -121,12 +121,42 @@
<noscript title="No JavaScript Support">
<h1>You need to enable JavaScript to run this app.</h1>
</noscript>
- <!-- <div id='load-spinner' aria-label="loading">
+ <div id='load-spinner' aria-label="loading">
<div class="lds-roller"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>
- </div> -->
+ </div>
</body>
<script>
+ function waitForElement(selector) {
+ return new Promise(function(resolve, reject) {
+ const element = document.querySelector(selector);
+
+ if(element) {
+ resolve(element);
+ return;
+ }
+
+ const observer = new MutationObserver(function(mutations) {
+ mutations.forEach(function(mutation) {
+ const nodes = Array.from(mutation.addedNodes);
+ for(const node of nodes) {
+ if(node.matches && node.matches(selector)) {
+ observer.disconnect();
+ resolve(node);
+ return;
+ }
+ };
+ });
+ });
+
+ observer.observe(document.documentElement, { childList: true, subtree: true });
+ });
+ }
+ waitForElement('div[role="application"]').then(function() {
+ document.querySelector('#load-spinner').remove();
+ });
+
+
parseGitHubUrl = (url) => {
const urlObj = new window.URL(url);
It looks great. But the For these points:
I think we could use extension to achieve the same https://code.visualstudio.com/api/extension-capabilities/extending-workbench
|
I think we may need some ability to customize the source code of vscode, though we should do it as little as possible (convenient for merge the newer version vscode), but sometimes we really need to do this |
I think I can easily manage notification banner & loader. But home button & read-only tips I won't be able to manage it through extension points. @conwnet What kind of stuff, do you think, we need to keep ? All info in Welcome page can be moved to Github1s:settings panel. |
In my opinion, we should change the source code of vscode as little as we can, but I think there are somethings we should care. If we can't change the source code of vscode, when we want do a little change for better user experience, we have to wait the vscode officially (or never achieve it), you can search On the other hand, GitHub1s just want to provide a better experience for view code, we may remove some unused code in vscode for a minimal bundle in the furture, The vscode-web is great, I think it can provide an build script for better development experience. |
Ok I understand, I close this PR |
I did try your PR and really enjoy it because it's so fast to build and iterate. Maybe we could do the following to finally integrate with vscode-web:
|
Hi there,
following my comment in #62 I tried to remove the vscode compilation from the project.
Here is my first attempt if you are still interested.
But some features are still missing
Let me know what you think !