Skip to content

Regression: New RegExp format causes blank page #3051

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

Closed
L3P3 opened this issue Apr 6, 2021 · 4 comments
Closed

Regression: New RegExp format causes blank page #3051

L3P3 opened this issue Apr 6, 2021 · 4 comments
Labels
upstream:vscode Needs to be fixed upstream in VSCode upstream Needs to be fixed upstream

Comments

@L3P3
Copy link
Contributor

L3P3 commented Apr 6, 2021

OS/Web Information

  • Web Browser: Mypal 29.1.1 (Pale Moon/Firefox)
  • Local OS: Windows XP SP3
  • Remote OS: Debian 10
  • Remote Architecture: x86-64
  • code-server --version: 3.9.2 109d2ce

Steps to Reproduce

  1. Open Mypal
  2. Open code-server

Expected

App opens.

Actual

Blank page.

Screenshot

mpcsb2

Notes

Is most probably caused by following lines including quite recent RegExp syntax:

https://github.com/cdr/code-server/blob/f21433a130ab07db569a1ae43a04416e7ec306ba/lib/vscode/src/vs/editor/contrib/linesOperations/linesOperations.ts#L1060

Please either revert these lines (v3.9.0 it worked well) or make them more backwards-compatible (maybe feature check and fallback). Maybe, we can also consider this a bug in closure compiler as it should generate backwards-compatible code out of the box.

@jsjoeio
Copy link
Contributor

jsjoeio commented Apr 6, 2021

Hi @L3P3! Thanks for opening the issue.

This issue can be reproduced in VS Code: Yes/No

It looks like part of the bug report is missing this line. Can this be reproduced in VS Code?

Based on what you linked, if that's truly the issue, then it looks like it was introduced/changed here: microsoft/vscode@5c1ff81#diff-dde3b56145713053f086e5ce1fcea39c4cb171d4555b6ab91256c7cf2b39e9af

We suggest raising this upstream.

Maybe, we can also consider this a bug in closure compiler as it should generate backwards-compatible code out of the box.

If that's the case, it may be worth raising this there.

@jsjoeio jsjoeio added the upstream:vscode Needs to be fixed upstream in VSCode label Apr 6, 2021
@L3P3
Copy link
Contributor Author

L3P3 commented Apr 6, 2021

Thanks for pointing that out. Did not know that vscode aims for backwards-compatiblity and I thought it is just used in modern electron.
Workaround for now is to simply delete SnakeCaseAction, I will now look into the compiler side of things.

@jsjoeio jsjoeio added upstream Needs to be fixed upstream upstream:vscode Needs to be fixed upstream in VSCode and removed upstream:vscode Needs to be fixed upstream in VSCode labels Apr 8, 2021
@repo-ranger
Copy link
Contributor

repo-ranger bot commented Apr 8, 2021

This issue has been marked as 'upstream:vscode'. Please file this upstream: link to open issue"
This issue will automatically close in 5 seconds.

@repo-ranger repo-ranger bot closed this as completed Apr 8, 2021
@L3P3
Copy link
Contributor Author

L3P3 commented Apr 9, 2021

Just for the record, if anyone else has this problem, run this command on your server:

sudo sed -i 's#return q\.replace(/(\\p{Ll})(\\p{Lu})/gmu,\"\$1_\$2\")\.replace(/(\[^\\b_\])(\\p{Lu})(\\p{Ll})/gmu,\"\$1_\$2\$3\")\.toLocaleLowerCase()#return eval('\''q\.replace(/(\\\\p{Ll})(\\\\p{Lu})/gmu,\"\$1_\$2\")\.replace(/(\[^\\\\b_\])(\\\\p{Lu})(\\\\p{Ll})/gmu,\"\$1_\$2\$3\")\.toLocaleLowerCase()'\'')#g' /usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js

With this, automatic snake case transformation is still not working but at least, everything else does. In newer browsers, everything still works as before.

Updated for v3.10.0:

sudo sed -i 's#return G\.replace(/(\\p{Ll})(\\p{Lu})/gmu,\"\$1_\$2\")\.replace(/(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})/gmu,\"\$1_\$2\$3\")\.toLocaleLowerCase()#return eval('\''G\.replace(/(\\\\p{Ll})(\\\\p{Lu})/gmu,\"\$1_\$2\")\.replace(/(\\\\p{Lu}|\\\\p{N})(\\\\p{Lu})(\\\\p{Ll})/gmu,\"\$1_\$2\$3\")\.toLocaleLowerCase()'\'')#g' /usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js

jsjoeio added a commit that referenced this issue Dec 15, 2021
* Support browsers from before 2020

As reported in #2825, #2826 and #3051, almost everything works in older browsers. This setting here prevented me from updating and I think it is an obvious enhancement to not restrict to browsers from 2020+. There should not be any measurable downsides of this change since es6 and es2020 are pretty similar with only minor differences.

* Include lib (polyfills) for <es2020 targets

* Assume all modern dom features despite es6 syntax

* Add modern dom iterators to es6 environment

Co-authored-by: Joe Previte <[email protected]>
Co-authored-by: Asher <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream:vscode Needs to be fixed upstream in VSCode upstream Needs to be fixed upstream
Projects
None yet
Development

No branches or pull requests

2 participants