Skip to content

Conversation

stevenhao
Copy link
Owner

What kind of change does this PR introduce?

Bugfix

What is the current behavior?

Issue: codesandbox#5587

What is the new behavior?

  • js, jsx, ts, and tsx files support nullish coalescing operator syntax highlighting

What steps did you take to test this? This is required before we can merge, make sure to test the flow you've updated.

Checklist

  • Documentation
  • Testing
  • Ready to be merged
  • Added myself to contributors table

Notes

  1. I manually updated the following files (editing the strings manually)
packages/app/src/embed/components/Content/Monaco/grammars/tmGrammars/TypeScriptReact.tmLanguage
standalone-packages/vscode-extensions/out/extensions/javascript/syntaxes/JavaScript.tmLanguage.json
standalone-packages/vscode-extensions/out/extensions/javascript/syntaxes/JavaScriptReact.tmLanguage.json
standalone-packages/vscode-extensions/out/extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json
standalone-packages/vscode-extensions/out/extensions/typescript-basics/syntaxes/TypeScriptReact.tmLanguage.json

The files now contain updated regexes for ternary-expression.begin and keyword.operator.logical.tsx. According to microsoft/TypeScript-TmLanguage#768, these are the two syntax rules that are affected by the nullish coalescing operator syntax.

  1. I loosely followed the instructions in https://github.com/codesandbox/codesandbox-client/tree/master/standalone-packages/vscode-extensions/out/bundles to regenerate standalone-packages/vscode-extensions/out/bundles/main.min.json: deleted the file, ran the app in development mode, loaded the app in the browser and grabbed the entirety of global.fileReads through the browser js console, and minified the json using an online tool, and re-created the file
  2. I followed the instructions in https://github.com/codesandbox/codesandbox-client/tree/master/standalone-packages/vscode-extensions/out/bundles to bump the versions: vscode-extensions/v17 -> vscode-extensions/v18, vscode31 -> vscode32 (applying a global find/replace on the codebase, including minified files)

Caveats

@stevenhao stevenhao closed this Oct 17, 2021
@stevenhao
Copy link
Owner Author

stevenhao commented Oct 17, 2021

Accidentally created two PRs, oops. Use this one: codesandbox#6205

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.

1 participant