+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

feat(playground): Add Syntax Hightlighting and folding for RomeAst #2917

Merged
merged 6 commits into from
Jul 26, 2022

Conversation

IWANABETHATGUY
Copy link
Contributor

@IWANABETHATGUY IWANABETHATGUY commented Jul 22, 2022

Summary

  1. Resolved 📎 Add rome_ast debug grammar for codemirror #2896
  2. Add Syntax Highlighting and folding for RomeAst

Test Plan

  1. Run the playground locally, and check if everything else is alright.

@IWANABETHATGUY IWANABETHATGUY requested a review from a team July 22, 2022 14:48
@IWANABETHATGUY
Copy link
Contributor Author

rome-lang-ast.mp4

@IWANABETHATGUY
Copy link
Contributor Author

grammar definition see https://github.com/IWANABETHATGUY/lang-rome-ast

@IWANABETHATGUY
Copy link
Contributor Author

Bundle Size

Main

dist/assets/favicon.5e112f83.svg               1.10 KiB
dist/assets/rome_playground_bg.e1d31b08.wasm   2223.35 KiB
dist/assets/romeWorker.276a0a9f.js             6.61 KiB
dist/assets/prettierWorker.811eafcc.js         753.31 KiB
dist/assets/success.4a59e56f.svg               0.82 KiB
dist/assets/failed.13568d2b.svg                0.92 KiB
dist/assets/copy.184a94f2.svg                  1.08 KiB
dist/index.html                                0.48 KiB
dist/assets/index.074b2a9c.css                 13.77 KiB / gzip: 3.78 KiB
dist/assets/index.699ca3cd.js                  1320.72 KiB / gzip: 403.06 KiB

Current

dist/assets/favicon.5e112f83.svg               1.10 KiB
dist/assets/rome_playground_bg.e1d31b08.wasm   2223.35 KiB
dist/assets/romeWorker.276a0a9f.js             6.61 KiB
dist/assets/prettierWorker.811eafcc.js         753.31 KiB
dist/assets/success.4a59e56f.svg               0.82 KiB
dist/assets/failed.13568d2b.svg                0.92 KiB
dist/assets/copy.184a94f2.svg                  1.08 KiB
dist/index.html                                0.48 KiB
dist/assets/index.074b2a9c.css                 13.77 KiB / gzip: 3.78 KiB
dist/assets/index.cfeded99.js                  1323.17 KiB / gzip: 404.21 KiB
  • 3KB before gzip, 1KB after gzip

Copy link
Contributor

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome!

Can you explain what errors you get when you move the source of lang-rome-ast into the playground rather than having its own npm package?

The playground is using it the same way as any other module which is why I don't see much reason why it should cause issues. It may need a couple of additional steps to integrate it in our build chain though.

@IWANABETHATGUY
Copy link
Contributor Author

I have tried to move the codemirror-lang-rome package to our playground directory, but the code folding and highlight will not work after that, I am still not figured out why.

@IWANABETHATGUY
Copy link
Contributor Author

I will transform the code to the playground directory once I found the solution.
You could merge it now, and the version of codemirror-lang-rome-ast is locked in a specific version, we don't need to worry about the upstream issue.

@IWANABETHATGUY
Copy link
Contributor Author

https://github.com/IWANABETHATGUY/lang-rome-ast, the repo is public feel free to review it.

@MichaReiser
Copy link
Contributor

MichaReiser commented Jul 26, 2022

I have tried to move the codemirror-lang-rome package to our playground directory, but the code folding and highlight will not work after that, I am still not figured out why.

Do you get any errors if you do so?

You could merge it now, and the version of codemirror-lang-rome-ast is locked in a specific version, we don't need to worry about the upstream issue.

Sounds good to me.

Since you're at it. Do you think it would be possible to implement something similar for Rome's formatting IR?

@MichaReiser MichaReiser merged commit 64108cd into rome:main Jul 26, 2022
@IWANABETHATGUY IWANABETHATGUY deleted the feat/codemirror-lang-rome branch July 26, 2022 06:40
@IWANABETHATGUY
Copy link
Contributor Author

IWANABETHATGUY commented Jul 26, 2022

Do you get any errors if you do so?

Let me open another issue to track it

Since you're at it. Do you think it would be possible to implement something similar for Rome's formatting IR?

Let me try

@ematipico
Copy link
Contributor

Maybe we can move the repository under Rome's org?

IWANABETHATGUY added a commit to IWANABETHATGUY/tools that referenced this pull request Aug 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📎 Add rome_ast debug grammar for codemirror
4 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载