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

Refactor RendererBridge #94

Merged
merged 2 commits into from
Apr 29, 2021
Merged

Refactor RendererBridge #94

merged 2 commits into from
Apr 29, 2021

Conversation

ewc340
Copy link
Collaborator

@ewc340 ewc340 commented Apr 29, 2021

Extracted RendererBridge changes from #86 just to make that PR smaller

@ewc340 ewc340 requested a review from HaileyJang April 29, 2021 02:46
Copy link
Collaborator

@HaileyJang HaileyJang left a comment

Choose a reason for hiding this comment

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

LTGM

@ewc340 ewc340 merged commit b828c65 into dev Apr 29, 2021
@ewc340 ewc340 deleted the rendererBridge-refactor branch April 29, 2021 03:54
ewc340 added a commit that referenced this pull request Jun 17, 2021
* Refactor release.ts and update electron-packager

* Change yarn build and yarn start

* Add dist to .gitignore

* Remove dist

* Fixed run mode sagas connection, cleaned up other bits

* Changed ./main/MenuTemplate

* Changed ./main/networking

* Changed main-process.js and RendererBridge.js

* Changed ./renderer/actions

* Changed ./renderer/components/periperals and App.js and ConfigBox.js

* Changed ./renderer/components

* Changed ./renderer/reducers

* Changed ./renderer/utils

* Added packet header functions, add comments and modifications

* Update tsconfig.json, change ts to tsx, and add @types/react

* Implemented typescript parser for ESLint

* Add more build options in tsconfig.json

* Remove dist from .gitignore

* Revert DNav.tsx changes

* Remove extra spaces in DNav.tsx

* Progress towards fake runtime fix

* Remove ansible-protos folder - already on dev branch

* Fixed null quit bug and params proto bug, brought back console logs

* Fixing restart fc null bug

* Refactor .eslintrc.json

* Fixed fake runtime to now be functional

* Caching protobuf root

* More updates to .eslintrc.json

* Add .prettierrc.js

* Updates in dependencies and tsconfig.json

* Add object params for FieldActions updateTimer

* Add temporary rules for linting and lint fixing actions and types in renderer folder

* Move types from actions to parent directory (renderer)

* Add example for new action/reducer pattern - alerts and console

* Add lint support for reducers

* Remove types that were originally derived from actions folder

* Remove .prettierrc.js - already in package.json

* Modified EditorActions and FieldActions + Fixed any types in FieldActions

* Update utf-8-validate and socket.io-client dependencies

* Fixing package json

* Fixed Capitalization and GamepadsAction

* Finished InfoActions

* Finished PeripheralAction

* Finished SettingsAction

* Lint actions

* Rename some parameters for some action dispatch functions

* Remove export defaults in reducers

* Upgrade redux to version 4.0.5

* Minor fixes in reducers

* Lint reducers

* Rename dawnApp to rootReducer

* Refactor constants folder

* Lint consts

* Lint types

* Edit in webpack.config.babel.ts

* Add 1st round of .eslintrc.json config

* More updates to .eslintrc.json

* Updates in tsconfig.json, package.json, yarn.lock, and .eslintrc.json

* Add prettier to package.json

* Update eslint and .eslintrc.json edit

* Lowercase files for fieldStore and timerStore

* Adding starter typing for ansible

* Added proto Typescript defs. Changed Ansible to Runtime and added most types. Changed gamepad and peripherals

* Fixed the build-protos yarn script

* Add types in ConfigBox.tsx

* Small edit to componentDidMount in ConfigBox component

* Fix electron-json-storage types

* Edited Dashboard.tsx

* Edited DNav.tsx

* Type return type of info reducer

* Add blueMasterTeamNumber and goldMasterTeamNumber to field store state

* Edited EditorContainer.ts

* Edited TooltipButton.tsx

* Fixed minor import errors

* Edited Gamepad.tsx

* Adding typescript types and fixes for compilation

* Fixing sensor data typing

* Changed ConsoleOutput.tsx

* Divided the props interface for reuse in GamepadList.tsx

* Edited StatusLabel.tsx

* Fixed any type for state generic type

* Edited UpdateBox.tsx

* Change the type of gamepads to GamepadObject array

* - Updated gamepad and peripherals with Protobuf definition

- Updated sagas and removed ansible disconnect
- Updated lodash to new version

* Getting battery params with indexes now. Commented version peripheral

* Added types to menus. Installed more types packages. Made webpack file js

* Edited App.tsx

* Fixing version peripheral again.

* Fixed socket typing in FieldControl

* Changed the types of the props and made some parameters optional

* Deleted redundant props

* Worked on editors.tsx. Didn't fix all the type mismatches yet

* Fix imports in FakeRuntime and delete line in App.tsx

* Adding types to params in FakeRuntime

* Fixing typing issues UDP recv of runtime ts

* Upgrade redux saga

* Fix types in sagas.ts

* Add underscore prefix to unused parameters in main-process and Runtime

* Fixed gamepad buttons in sagas

* Add types in ConfigBox.tsx

* Small edit to componentDidMount in ConfigBox component

* Fix electron-json-storage types

* Edited Dashboard.tsx

* Edited DNav.tsx

* Type return type of info reducer

* Add blueMasterTeamNumber and goldMasterTeamNumber to field store state

* Edited EditorContainer.ts

* Edited TooltipButton.tsx

* Fixed minor import errors

* Edited Gamepad.tsx

* Changed ConsoleOutput.tsx

* Divided the props interface for reuse in GamepadList.tsx

* Edited StatusLabel.tsx

* Fixed any type for state generic type

* Edited UpdateBox.tsx

* Change the type of gamepads to GamepadObject array

* Edited App.tsx

* Changed the types of the props and made some parameters optional

* Deleted redundant props

* Worked on editors.tsx. Didn't fix all the type mismatches yet

* Changed the type of gamepadobject to GPstate

* Changed the class name and fixed some props

* Changed types of props

* Changed the types of some function parameters to react events

* Fixed merge conflicts

* Add FieldControlConfig interfaces

* Fixed typing for onFCUpdate

* Add FieldControlConfig to export

* Add types for numeral module

* Refactor Gamepad.tsx

* Allow gamepads to be undefined

* Add outerDiv property to ConsoleOutput class component

* Fixed typing errors:

* Edited the param names and added proto interface to types

* Edited Peripheral.tsx

* Started working on PeripheralList.tsx

* Added Joyride

* Changed import and optional typings

* Started working on Editor.tsx

* Changed prop names and typings

* Rename types.d.ts for ApplicationState to app-state.d.ts

* Update some dependencies

* Fix webpack loading

* Fix types in FakeRuntime, protos, index.tsx

* Add module resolution for smalltalk dependency

* Fix react joyride typing

* Add peripheral list type

* Fixed type issues (changing OwnProps and mapStatetoProps)

* Fix storage.get for editorFontSize and editorTheme

* Changed React FormEvent

* Fixed bootstrap issue:

* Fix PeripheralList type and refactor PeripheralList.tsx

* Fixed dialog.showmessagebox

* Fixed import issue

* Fixed typing and bootstrap issue

* Remove I* proto types from renderer and FakeRuntime

* Lint and refactor protos.d.ts

* package.json and lint App.tsx

* Remove brace imports and use ace-builds

* Fix onEditorPaste function argument type

* Added types for AceEditor

* Fixed typing for onEditorPaste

* Fix Dawn runtime errors

* Merge Conflict changes

* Fix smalltalk import error

* Fix electron build

* Add brace back as dependency

* Fix electron-json-storage typing

* Fix storage.get FieldControlConfig

* Fix yarn build command

* Updated Runtime.ts wsocket architecture, fixed gamepad state

* Refactor networking module and tweak Runtime object variables/methods

* Refactor TCPConn and related methods

* Refactor UDPConn

* Change RendererBridge methods to arrow functions

* Added error handler for TCP socket

* Fix default export

* Update ssh2

* Fix runtime disconnect bug

* Fix TCP connection

* Added check for only connecting after first IP update. Added socket.pending back

* Fix uid bug

* Changed Runtime update location. UI has bugs

* Fixed UpdateBox choosing .zip package

* Working run modes and code upload

* Updates in UpdateBox.tsx

* Removed unnecessary code and imports

* Ignore pending socket error

* Use patch package to fix pending socket type error

* Remove unnecessary changes in Runtime.ts

* Fix peripheral display bug and fake runtime (#46)

* Create and use Peripheral type and add peripheral logging

* Working peripheral list, still UI issues

* Change Peripheral component prop id to uid

* Change exec style for FakeRuntime.ts

* Fix fake runtime

* Tweaks

* Add comment about Peripheral type

Co-authored-by: Ashwin Vangipuram <ashwinvangipuram@gmail.com>

* Fixed run mode starting and stopping (#58)

* Added IDLE mode in dropdown

* Removed ESTOP button and enums

* Added isRunning and fixed play buttons

* Fix some spacing

Co-authored-by: ewc340 <edwardc1028@berkeley.edu>

* Fixed crash when loading a file from filesystem (#57)

* Fixed crash when loading a file from filesystem

* Fixing other readFile calls for downloadCode and dragFile

* Fix eslint config (#54)

* Fix eslint config

* Tweak

* Fixed Runtime TCP connection and moved run_mode to reducer callback (#67)

* DNav - converted to functional component (#50)

* DNav - converted to functional component

* Remove unused createMaster function and linting

Co-authored-by: ewc340 <edwardc1028@berkeley.edu>

* Converted ConfigBox Class to Functional Component (#49)

* Converted classes to hooks

* Lint and small changes

Co-authored-by: ewc340 <edwardc1028@berkeley.edu>

* Install rimraf and mkdirp

* Fix release script and packaged app errors (#51)

* Fix release script

* Fix release script

* Some tweaks

* Shift some dependencies to be dev

* Update electron-packager and add back better-npm-run build

* fix gamepad bitmask

* fix package scripts & gamepad bitmask

* Fix ipAddress local storage issue

* Remove string casting for peripheral uid and key

* Revert backslashes on start and build commands

* Add rimraf and mkdirp

* Fix script commands with rimraf and mkdirp

* Fix peripheral uid and peripheral type display bug

* Fix peripheral param val display issues

* Fix device type 0 display error

* Add ParamComponent memoized

* Add comments and small code styling fixes

* Disable animation on modals due to performance reasons on long list of peripherals

* Change FakeRuntime device send frequency to 20Hz

* Lint Dashboard

* Small refactor in peripherals reducer

* Remove unneeded type assertion for connect in PeripheralList component

* Add comment about param argument for getParamValue function in Peripheral.tsx

* Remove input.proto

* Change FakeRuntime send interval variable name

* Fix some styling in Gamepad.tsx

* Tweak comment

Co-authored-by: Lance Jackson <lanceisajackson@berkeley.edu>

* Convert Gamepad proto to Input proto to match Runtime update (#70)

* WIP: Replaced gamepad.proto with input.proto. pbts isn't autogenerating properly

* Fixed input interfaces by moving enum. See protobufjs #1222

* Properly fixed proto generation using jsdoc patch

* Refactored GpState into Input proto

* Fixed bugs with displaying robot state. Fixed IP handling for ngrok. Fixed log decode bug

* Merging and squashing branch origin/dev into input_proto

* Moved dawn package to inside repo

* Fixed ngrok IP splitting and IP changing

* Addressed PR comments

* Tweaks

Co-authored-by: ewc340 <edwardc1028@berkeley.edu>

* Added argument passing and fixed zipping for release.ts (#72)

* Added argument passing and fixed zipping for release.ts

* Add eslint disable to release.ts

Co-authored-by: ewc340 <edwardc1028@berkeley.edu>

* Add udp tunneling connection for Sp21 Comp (#73)

* Add TCPTunneledConn

* Change TCPTunneledConn to �[200~UDPTunneledConn~

* Add Inputs msg type and tweaks

* Add udpTunnelingIpAddress to redux state

* Add UDP Tunneling field in ConfigBox

* Add udpTunnelIpAddress change listener and add propert TCP packet splitting

* Perform some cleanup and add ipcMain.on ip address change listener to BaseTCPConn

* Add custom numbering to MsgType enum

* Tweak comment to span 2 lines

* Tweak comment

* Tweak some logic for on data handler for reg TCP conn

* Removed BaseTCPConn and added SSH address to ConfigBox and Redux

* Linting

* Add try/catch for udpForwarder send to UDP connection

* Add comment

* Remove comment

* Fix message length

Co-authored-by: Ashwin Vangipuram <ashwinvangipuram@gmail.com>

* Implement keyboard handler (#74)

* Added map for the buttons and the file for keyboard

* store key being pressed with hooks

* uncommented handleButtonChange to get rid of angry red lines

* Delete Keyboard and add toggleKeyboardControl beta version

* Add the keyboard button dictionary

* Add imports

* togglekeyboard

* minor warnings fixed

* addEventListener debug

* Added Redux

* send characters on interval

* keyboard input refreshes after interval

* change keyboard input from interval to event based, send single character on press

* Working on the sagas

* Set it as array

* Fixed the sendInput

* updated keyboard input bool for keyup/down

* added bitmap to redux

* Fix merge conflict

* Fixed the editorSavedState

* Fixed the button alignment issue

* Delete unused line

* moved bitmap logix to editor.tsx

* Removed Bool and KeyboardChar from the redux

* remove bitmap logic from sagas

* remove characterBool from state

* remove characterBool from state

* Remove unused vars

* StatusLabel unused

* change bitmap from number to bigint

* Changing color of the button

* updated arrow key names in mapping

* update proto to include big int

* Added KeyboardToggle to Redux

* Ok idk what I am doing but here we go

* reset to bigint have to convert to long

* Spliced the bits

* Fixed the bitmap error

* Oh oops

* Fixed intermittent input msgs, but keyboard doesn't disconnect

* Fixed counting of keyboard keys

* made changes that Edward said to

* fixed bitmap on/off

* Linting and various small fixes

* Fix Redux isKeyboardModeToggled

* Fix isKeyboardModeToggled name change in sagas

* Small tweak

Co-authored-by: Hailey Jang <hailey_jang@berkeley.edu>
Co-authored-by: Thomas Lee <tcl171@gmail.com>
Co-authored-by: Hailey Jang <hailey.jang.01@gmail.com>
Co-authored-by: Ashish Pandian <pandianashish0@gmail.com>
Co-authored-by: uthmanmomen13 <livininthemomen13@gmail.com>
Co-authored-by: Ashwin Vangipuram <ashwinvangipuram@gmail.com>

* Fix keyboard connected (#79)

* updated keyboard connect/disconnect

* removed unnecessary bitmap change in editor.tsx

* Change buttons back to 0

* Tweaks

Co-authored-by: ewc340 <edwardc1028@berkeley.edu>

* Bump y18n from 3.2.1 to 3.2.2

Bumps [y18n](https://github.com/yargs/y18n) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>

* Implement latency check for communication with Runtime  (#85)

* need to display latency on ui

* worked on displaying latency on ui

* added some prints

* it was runtimes fault >:(

* Add Latency status label

* Add the delay and color changes

* Modify the latency seconds

* Accidentally deleted something

* Probably 5 seconds is better

* Style fixes

* More minor style fixes and remove unused import

* Add TODO

Co-authored-by: uthmanmomen13 <livininthemomen13@gmail.com>
Co-authored-by: Hailey Jang <hailey.jang.01@gmail.com>

* Fixed the negative latency issue (#89)

* Change latency calculations to be one-way as per Runtime's request (#91)

* Change latency calculations to be one-way

* Remove rounding

* Remove extra spaces

* Add units for latency display (#92)

* Add units for latency display

* Variable renaming

* Refactor RendererBridge (#94)

* Fix merge conflicts

* Some styling fixes

* Added staff code button (#95)

* button works need to test

* change button text

* Small tweaks

Co-authored-by: ewc340 <edwardc1028@berkeley.edu>

* updated staff code from akshit (#98)

* Add new robot staff code (#99)

* Bump lodash from 4.17.20 to 4.17.21 (#106)

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.20...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump hosted-git-info from 2.8.8 to 2.8.9 (#107)

Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](npm/hosted-git-info@v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump ua-parser-js from 0.7.22 to 0.7.28 (#104)

Bumps [ua-parser-js](https://github.com/faisalman/ua-parser-js) from 0.7.22 to 0.7.28.
- [Release notes](https://github.com/faisalman/ua-parser-js/releases)
- [Commits](faisalman/ua-parser-js@0.7.22...0.7.28)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump codecov from 3.6.5 to 3.7.1 (#19)

Bumps [codecov](https://github.com/codecov/codecov-node) from 3.6.5 to 3.7.1.
- [Release notes](https://github.com/codecov/codecov-node/releases)
- [Commits](codecov/codecov-node@v3.6.5...v3.7.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump ini from 1.3.5 to 1.3.8 (#62)

Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](npm/ini@v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump postcss from 7.0.34 to 7.0.36 (#113)

Bumps [postcss](https://github.com/postcss/postcss) from 7.0.34 to 7.0.36.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](postcss/postcss@7.0.34...7.0.36)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Changed the version number to 3.0.0

Co-authored-by: Lawrence Chen <lawrencechen14@gmail.com>
Co-authored-by: Hailey Jang <hailey_jang@berkeley.edu>
Co-authored-by: HaileyJang <55821834+HaileyJang@users.noreply.github.com>
Co-authored-by: Ashwin Vangipuram <ashwinvangipuram@gmail.com>
Co-authored-by: Ashwin Vangipuram <AVSurfer123@users.noreply.github.com>
Co-authored-by: Meshan Khosla <meshan02@gmail.com>
Co-authored-by: andrewecd <46904210+andrewecd@users.noreply.github.com>
Co-authored-by: lancejackson <ltjackson32@gmail.com>
Co-authored-by: Lance Jackson <lanceisajackson@berkeley.edu>
Co-authored-by: Thomas Lee <tcl171@gmail.com>
Co-authored-by: Hailey Jang <hailey.jang.01@gmail.com>
Co-authored-by: Ashish Pandian <pandianashish0@gmail.com>
Co-authored-by: uthmanmomen13 <livininthemomen13@gmail.com>
Co-authored-by: Uthman Momen <34070661+uthmanmomen13@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Meshan Khosla <meshankhosla@gmail.com>
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.

2 participants