Closed Bug 1636418 Opened 5 years ago Closed 5 years ago

Rename WebSockets codebase to Messages

Categories

(DevTools :: Netmonitor, enhancement, P3)

enhancement

Tracking

(firefox79 fixed)

RESOLVED FIXED
Firefox 79
Tracking Status
firefox79 --- fixed

People

(Reporter: Honza, Assigned: farooqbckk)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Support for SSE will reuse the existing UI for WebSockets. So, let's rename the existing code base to make it more generic. Use "message" instead of "frame", "Messages" instead of "WebSockets", etc.

Detailed instructions:

  • Actions (web-sockets.js)
    web-sockets.js ➤ messages.js

  • Constants
    WS_ADD_FRAME ➤ MSG_ADD
    WS_SELECT_FRAME ➤ MSG_SELECT
    WS_OPEN_FRAME_DETAILS ➤ MSG_OPEN_DETAILS
    WS_TOGGLE_FRAME_FILTER_TYPE ➤ MSG_TOGGLE_FILTER_TYPE
    WS_RESET_COLUMNS ➤ MSG_RESET_COLUMNS
    WS_CLOSE_CONNECTION ➤ MSG_CLOSE_CONNECTION
    Etc.

  • Functions
    addFrame ➤ addMessage
    openFrameDetails ➤ openMessageDetails
    toggleFrameFilterType ➤ toggleMessageFilteType
    resetWebSocketsColumns ➤ resetMessageColumns
    toggleWebSocketsColumn ➤ toggleMessageColumn
    closeConnection ➤ closeConnection
    selectMessageDelta ➤ selectMessageDelta
    Etc.

  • Reducer (web-sockets.js)
    web-sockets.js ➤ messsages.js
    getWebSocketsDefaultColumnsState ➤ getMessageDefaultColumnsState
    WebSockets ➤ Messages (reducer function)

  • Reducer fields
    frames ➤ Messages
    frameFilterText ➤ messageFilterText
    frameFilterType ➤ messageFilterType
    showControlFrames ➤ showControlFrames (can remain the same since it’s only relevant to WS)
    selectedFrame ➤ selectedMessage
    frameDetailOpen ➤ messageDetailOpen

  • Components (websockets folder)
    websockets ➤ messages
    FrameFilterMenu ➤ MessageFilterMenu
    FrameListColumnData ➤ ListColumnData (for columns: just remove the Frame prefix entirely)
    FrameListColumnOpCode ➤ ListColumnOpCode

  • Styles (websockets.css)
    websockets.css ➤ messages.css
    ws-frame- ➤ message-
    ws- ➤ msg-

  • Other constants (in constants.js)
    WS_FRAMES_HEADERS ➤ MESSAGE_HEADERS

  • Actors
    WebSocketActor ➤ WebSocketActor (remains the same)
    SSEActor

  • Localization
    netmonitor.ws.toolbar.filterFreetext.key ➤ netmonitor.msg.toolbar.filterFreetext.key
    netmonitor.ws.toolbar.filterFreetext.label ➤ netmonitor.msg.toolbar.filterFreetext.label

  • StatusBar.js
    WS_FRAMES_HEADERS ➤ MESSAGE_HEADERS
    FRAMES_COUNT_EMPTY ➤ MESSAGE_COUNT_EMPTY
    TOOLTIP_FRAMES_COUNT ➤ TOOLTIP_MESSAGE_COUNT
    UPDATED_WS_SUMMARY_PROPS ➤ UPDATED_MSG_SUMMARY_PROPS

  • Toolbar.js
    WS_TOOLBAR_CLEAR ➤ MSG_TOOLBAR_CLEAR
    WS_SEARCH_KEY_SHORTCUT ➤ MSG_SEARCH_KEY_SHORTCUT
    WS_SEARCH_PLACE_HOLDER ➤ MSG_SEARCH_PLACE_HOLDER

  • event-telemetry.js
    WS_SELECT_FRAME ➤ MSG_SELECT
    selectWSFrame ➤ selectMessage
    Telemetry event "select_ws_frame" remains the same and we want to introduce a new one "select_sse".

  • Tests
    File names can remain the same since we need new tests for SSE
    Content of WS tests can remain the same (they are supposed to test SW)

Assignee: nobody → farooqbckk
Status: NEW → ASSIGNED
Pushed by hmanilla@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/90fb6ec67a4f Rename WebSockets codebase to Messages. r=Honza,bomsy
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 79
No longer blocks: 1642034
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: