Skip to content

refactor: Move non-auth mediator commands to ipc

Paul Slaughter requested to merge 317-move-non-auth-mediator-commands into main

Issue: #317 (closed)

Description

This MR moves the non-auth mediator commands to the messagePassingProtocol API. We need to move away from mediator commands and most commands can live in the gitlab.gitlab-web-ide extensions itself, but these commands require the main runtime context. Thankfully, these aren't really commands and are actually meant to be more like postMessages anyway.

How to test

To test startRemote message:

  1. Start Web IDE example app
  2. Open the terminal (CTRL + ` ) and click Configure a remote connection.
  3. Enter example.com, /example/proj, and 123456 for the configuration parameters.
  4. The Web IDE should restart in "Remote" mode. This doesn't need to actually work. It just needs to respond.

To test preventUnload message:

  1. Start Web IDE example app
  2. Open a file and make a change
  3. Try to close the tab
  4. The Web IDE should show the prevent unload warning
  5. Revert the change
  6. Try to close the tab

To test ready message:

  1. Start Web IDE example app
  2. In browser console look for [web-ide-example-app] Web IDE ready! message

Screenshots

web_ide_message_refactor_demo

Edited by Paul Slaughter

Merge request reports