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

Computed insertion point clashing with next/head #33

Closed
Andarist opened this issue Sep 9, 2021 · 3 comments
Closed

Computed insertion point clashing with next/head #33

Andarist opened this issue Sep 9, 2021 · 3 comments

Comments

@Andarist
Copy link
Contributor

Andarist commented Sep 9, 2021

We are using Next.js with Monaco editor and I've noticed Monaco's styles disappearing.

TLDR is that next/head is using a little bit quirky~ diffing logic to update <head/> during the client's runtime. Injecting any element in the middle of the elements managed by Next is a risk of weird side-effects

I think there is a potential of improving this in Next and I will probably file an issue there as well but I was wondering if maybe this is something that could be fixed here. Or at least, by raising an issue here, I would satisfy my personal curiosity about those liens of code. I don't exactly see why links would be injected before the last existing link. Is there any particular reason behind this? Could this be changed to just appending to the end of the head? I would be happy to provide a PR for this.

I've been searching for an answer in the git's history but this code is already in the initial commit of this repository.

@alexdima
Copy link
Member

alexdima commented Sep 9, 2021

I don't remember what the reason was. I pushed on top of your PR to just always append to the end of <head>.

@Andarist
Copy link
Contributor Author

Aaaaawesome! ❤️ Is there anything needed to get those changes in Monaco or is the whole process automated and it will get in in one of the upcoming releases?

@alexdima
Copy link
Member

Done via microsoft/vscode@7de611f

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

No branches or pull requests

2 participants