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

Upgrade to C# 8.0 and disable NRT during type generation #47

Merged
merged 8 commits into from Jul 25, 2021
Merged

Upgrade to C# 8.0 and disable NRT during type generation #47

merged 8 commits into from Jul 25, 2021

Conversation

hez2010
Copy link
Contributor

@hez2010 hez2010 commented Apr 17, 2020

  • Upgrade to C# 8.0 so that the new switch expression can be used in project
  • Disable NRT in type generation

@hez2010 hez2010 changed the title Upgrade to C# 8.0 Upgrade to C# 8.0 and disable NRT during type generation Apr 17, 2020
@hez2010
Copy link
Contributor Author

hez2010 commented Feb 28, 2021

WebView isn't compatible with monaco 0.23+, I'm closing this PR.
I think monaco-editor-uwp needs to switch to WinUI 3.0. I played with WinUI 3.0 preview 4 last week but it seems that AddHostObjectToScript doesn't work currently.

@hez2010 hez2010 closed this Feb 28, 2021
@hawkerm
Copy link
Owner

hawkerm commented Mar 12, 2021

Hey @hez2010 sorry I've been quiet on this for so long, been heads down at work. My plan is to investigate splitting apart the main generated parts to .NET so we can shim on top of different WebView/2 projections for different frameworks.

Is there an issue open on the Monaco repo about the broken Edge support? They don't call it out in their readme, only IE.

I know there's an open issue about AddHostObjectToScript, so I'm hoping that'll come soon, though I'd still want to support UWP for another year, so I think we may have to stay back on the Monaco version.

@hawkerm hawkerm reopened this Mar 12, 2021
@hez2010
Copy link
Contributor Author

hez2010 commented Mar 12, 2021

I've generated full bindings for monaco editor using TypedocConverter and applied some modifications to it, also implemented relevant methods for Uri, Token and etc.

https://gist.github.com/hez2010/3d3e493f8e434f1dc758438c4a2c9dab

Still needs some minor modifications if you want to use them in monaco-editor-uwp.

I think it's better to decouple monaco type bindings from MonacoEditorComponent and publish the type bindings itself as a dedicated package, otherwise you cannot expose a non-selaed class which is really annoying.

@hawkerm
Copy link
Owner

hawkerm commented Jul 25, 2021

Hey @hez2010 sorry for the delay in getting back to this. Was finally trying to take a stab at it.

I did see there were come conflicts with the new type definitions since they changed ResolveCompletionItem. I do plan after the next update to start looking at splitting the Monaco API parts out to a .NET standard library instead of being part of the component somehow.

I was trying to re-generate the typings myself with your updates, but was running into this:

Warning: No compiler options set. This likely means that TypeDoc did not find your tsconfig.json. Generated documentation will probably be empty.
Warning: Unable to locate entry point: I:/code/monaco-editor-uwp/GenerateMonacoTypings/.temp/monaco.ts

It was still generating a json file, but it was mostly empty, and then the C# files weren't being generated. Any thoughts on what I may be missing?

Thanks!

@hawkerm
Copy link
Owner

hawkerm commented Jul 25, 2021

Also hit an issue with trying to run test app with 0.22.3 on Win 10 19042.

image

Points to this place in editor.main.js:

ae.replace(/(\p{Ll})(\p{Lu})/gmu,"$1_$2").replace(/([^\b_])(\p{Lu})(\p{Ll})/gmu,"$1_$2$3").toLocaleLowerCase()

Tried reverting back to 21.3 instead and that seems to be working great so far.

@hawkerm hawkerm merged commit 54ebe57 into hawkerm:0.9-beta-prep Jul 25, 2021
@hawkerm
Copy link
Owner

hawkerm commented Jul 25, 2021

I've got this PR integrated into my local copy of my #46 PR along with the updates to bring us up to compatibility with 0.21.3 of Monaco tested out with all the examples in the Sample app.

Would be nice to at least fix the type-generation script though so it can be run locally. Feel like there's been updates to TypeScript and typedoc which aren't playing nice with the current script's configuration?

@hez2010
Copy link
Contributor Author

hez2010 commented Jul 26, 2021

Feel like there's been updates to TypeScript and typedoc which aren't playing nice with the current script's configuration

A tsconfig.json is needed to generate json from TypeScript. Also .d.ts in filename should be renamed to .ts.

@hawkerm
Copy link
Owner

hawkerm commented Jul 26, 2021

Thanks @hez2010, do you have the one that you've been using locally? It'd be great if we can commit it, so we can just run npm install again.

@hez2010
Copy link
Contributor Author

hez2010 commented Jul 26, 2021

Typedoc introduced a bug (TypeStrong/typedoc#1637) recently which mis-interprets property delegates as method signatures. To workaround, typedoc version should be fixed at 0.20.* (TypeScript 3.9~4.2).

I'm working on a PR to make it work again.

@hez2010
Copy link
Contributor Author

hez2010 commented Jul 26, 2021

Done. #57

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

Successfully merging this pull request may close these issues.

None yet

2 participants