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

feat: monaco editor for console #2040

Merged
merged 10 commits into from
Aug 28, 2023
Merged

feat: monaco editor for console #2040

merged 10 commits into from
Aug 28, 2023

Conversation

markphelps
Copy link
Collaborator

@markphelps markphelps commented Aug 22, 2023

Fixes: FLI-390

Adds https://github.com/microsoft/monaco-editor for request console so we can get proper JSON formatting support

  • Currently, the JSON syntax highlighting still doesn't work.. not sure why but it highlights everything as plain text in the request box :(
  • Note: I also removed the Reset button because im not sure how useful it is, it actually was kind of annoying that it cleared the flagKey selected IMO, as you most likely want to keep the same flagKey but play with the entityID and or `context.
  • I think before this ships I'll add a button in the entityID field to regen/get a new entityID only

2023-08-22 16 47 01

CleanShot 2023-08-22 at 17 00 31@2x

CleanShot 2023-08-24 at 09 06 12

@markphelps markphelps requested a review from a team as a code owner August 22, 2023 21:05
@codecov
Copy link

codecov bot commented Aug 22, 2023

Codecov Report

Merging #2040 (0c9f0f3) into main (1a495e1) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #2040   +/-   ##
=======================================
  Coverage   70.41%   70.41%           
=======================================
  Files          70       70           
  Lines        6820     6820           
=======================================
  Hits         4802     4802           
  Misses       1741     1741           
  Partials      277      277           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@markphelps markphelps added the needs docs Requires documentation updates label Aug 23, 2023
@markphelps markphelps marked this pull request as draft August 23, 2023 13:42
@markphelps markphelps marked this pull request as ready for review August 24, 2023 01:27
…to mp/monaco-redo

* 'mp/monaco-redo' of https://github.com/flipt-io/flipt:
  chore: fix nightly build; add footer to release notes on GH (#2041)
  chore: bump changelog for 1.25.2
  fix(internal/ext): add 1.1 to versions and validate explicit 1.2 (#2042)
  chore: update go mod
  fix(internal/ext): add 1.1 to versions and validate explicit 1.2 (#2042)
  chore(deps): bump github.com/aws/aws-sdk-go-v2/service/s3 (#2037)
  chore(deps-dev): bump postcss from 8.4.27 to 8.4.28 in /ui (#2028)
  chore: change parameter name of PKCE
  feat(oidc): Add parameters for pkce flow
@@ -0,0 +1,21 @@
// @ts-ignore
self.MonacoEnvironment = {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

these workers still dont actually work.. im going to create an issue once this is merged to see if anyone with more knowledge of react/vite/monaco/web workers can help

Copy link
Contributor

Choose a reason for hiding this comment

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

You probably tried all these things, but thought I would link just incase:
https://github.com/microsoft/monaco-editor/blob/main/docs/integrate-esm.md#using-vite
vitejs/vite#1791 (comment)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yah i did, i think those docs are from an older version of vite, like 2.0 and they don't seem to work for the later version we are using , 4.0

@markphelps markphelps enabled auto-merge (squash) August 28, 2023 13:14
Copy link
Contributor

@yquansah yquansah left a comment

Choose a reason for hiding this comment

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

Great!

}

export default function Console() {
const [flags, setFlags] = useState<FilterableFlag[]>([]);
const [selectedFlag, setSelectedFlag] = useState<FilterableFlag | null>(null);
const [context, setContext] = useState<string | null>(null);
Copy link
Contributor

Choose a reason for hiding this comment

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

context seems a bit overloaded with React.Context etc. You can take it or leave it but wonder if we should name this:

Suggested change
const [context, setContext] = useState<string | null>(null);
const [evaluationContext, setEvaluationContext] = useState<string | null>(null);

@markphelps markphelps merged commit 0266072 into main Aug 28, 2023
25 checks passed
@markphelps markphelps deleted the mp/monaco-redo branch August 28, 2023 13:33
@markphelps markphelps removed the needs docs Requires documentation updates label Sep 24, 2023
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.

3 participants