-
-
Notifications
You must be signed in to change notification settings - Fork 415
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
WIP : use typescript compiler to have typescript in examples #1060
WIP : use typescript compiler to have typescript in examples #1060
Conversation
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.
Oh wow thanks @TomSmith27,
This PR just made my day!
If we manage to combine this with using Monaco to get autocompletion and syntax checking, we could make a real revolution.
build/config.gypi
Outdated
@@ -0,0 +1,84 @@ | |||
# Do not edit. File was generated by node-gyp's "configure" step | |||
{ |
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 think this file should be ignored
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.
Yep I will remove it
I found that you don't use typescript in getAst... I wonder if typescript itself could do the trick. |
Ye that is a good idea would be much easier to edit examples using Monaco. There is some more work that needs to be done as this change will only work for the single file component sytanx. We should probably support tsx as well? |
I had a try integrating with https://github.com/react-monaco-editor/react-monaco-editor. It was pretty smooth sailing. 3 things were missing if we simply replaced prism with it:
I don't think it's a big deal to get the 2 first working, maybe a day or two of work. |
to replace |
Ahh this all sounds great, if we can get typescript examples working and a new editor it will make the design system i work on so much better. I noticed you had a go at using esbuild last night, how did that go? How do you want to work on this is there anything I can help with or does it make sense for you to make these changes as you know the codebase much better? |
I worked to make in browser compiler use typescript. It works. Way to go !! |
I get warnings with typescript when running it. This issue on typescript describes what I see
TypeScript is doing some stuff not allowed by webpack. The good news is it compiles typescript in the browser 🦜 🍾 |
Ye i did noticed that, as you say everything still works but i guess it needs fixing in that other repo. So today I managed to get Monoco setup and working I managed to get the height to update as you type which is good, The syntax highlighting is a bit of problem because there are quite a few types, Javascript/Typescript Also the highlighting doesn't work perfectly for Vue SFC's, I tried splitting them into html and script editors which gives you better typing support, but means two editors and you have to put them back together when recompiling. I also didn't know which editors you wanted to keep and in which situations so the make-webpack.config file needs looking at. I also had to revert a change to the evalInContext method because SFC's weren't working at all |
Great Job @TomSmith27 we are making progress. Very few people understand the Hybrid SFC mode. The 3 supported formats would then be:
|
This is all looking great!, can't wait to be able to write my examples in typescript this will really help out the rest of the development team. So my current understanding is there are 3 editors Prisim Which of those do you intend to keep? and which is the default? |
Also I think the way you can get Vue intellisense is by running a langauge server? which is how Vetur works, but not sure if thats something you will want to do |
The default is going to be Monaco, code mirror will be abandoned, and prism will be an option. |
We could also use sucrase to do the compilation. We would still have to work out the kinks of the live typings. |
Hey @TomSmith27, TypeScript is now allowed in examples using the extra package Checkout version 4.47.X of |
No description provided.