-
Notifications
You must be signed in to change notification settings - Fork 124
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
Redux #183
Redux #183
Conversation
Open devtools with a redux action. Initial work on redux'ing url mappings. Split out proxy and url-mappings from index.
This means that UrlMapper is currently authoritative over redux, however in the end, redux actions should be authoritative. No longer passing anything down from the top, components connect with redux where necessary. index.js is no longer a kitchen sink!
…x actions and store for data. Give Requests component the full request *container*, not just the request. Start to deal with the circular dependency between store <> proxy/urlMapper, because both need to tell the store about updates, and the store wants to query the dbs on actions.
…to be able to manipulate them in middleware when a related action comes in, and the proxy/urlMapper need to notify the store when they have changes. Could have resolved this by adding in an event emitter or something, as long as it could be registered after the store is setup, and reemit the events between that time. Or keep it simple, and take advantage of JS semantics where setTimeout defers until the stack is cleared, well after store is setup.
…l-ish. Update titlebar/footer to disable user-select, to closer resemble an application.
… without worrying about consumers.
…text. Fix lint issues.
Connect uses shallow-render checks to avoid re-rendering. If it's higher up, that leads to props being passed down, and components more likely to be re-rendered. Fix Request components getting re-rendered on active/context of another request. Fix keyboard shortcut for devtools not working.
Brutal conflict resolution; long-standing branches are horrible, kids.
# Conflicts: # package.json
… over IPC. Includes a bit of a hacky workaround to make request objects serializable, since they user getters and functions.
Fix default export derp in Search and RequestDetails.
…eck). Cleanup main process logs. Set menu bar to auto-hide.
Was inconsistent with activeRequest, so that was causing some confusion.
# Conflicts: # package.json
Not much of better way to handle this. Getters on ES classes are defined as non-enumerable on the prototype. Fortunately, most request/response properties are just accessing _data, except for a handful that aren't. Also made it a bit more efficient by combining it into a single reduce pass, rather than filter then map.
Add `proxy-get-request` to fetch the full request with response (used with `SET_ACTIVE_REQUEST`). Revert changes to service/proxy, and move request sanitization into main/proxy instead. Added lodash.throttle as sync is causing the UI to attempt to update more frequently than necessary.
We can speed up the build later by not running main through babel and browserify, as it's not necessary under the node environment (would just need to change import to require).
Wooh, this is a big PR. I'll CR it "soonish" |
…5-6.6.0' into redux # Conflicts: # package.json
@@ -11,6 +11,8 @@ addons: | |||
packages: | |||
- icnsutils | |||
- graphicsmagick | |||
before_script: | |||
- export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments pls. Why 99.0
? Why || true
at the end? if xvfb
fails to start, not sure that we should still try to run tests 'n stuff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, there was a reason for the || true
. Should've left a comment, my bad. I'll go poke around and see if I can find out again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|| true
was to skip OSX, since Xfvb doesn't happen on there. Buut that's definitely a bad idea in case it fails on Linux, so I've made it better. 👌
…tch. Change `UPDATE_BROWSER` to `DISABLE_BROWSER`, as that's what it's used for. Abstract `push` from `react-router` with `navigateToFoo` since it's not really clear what `push` is. Add some consistency under /containers, and make reducers vs selectors a slight bit clearer.
👍, quite a few changes, and I don't grok everything. However, it's working pretty well on Linux, and it's putting James in a good direction |
Notable changes:
Proxy
,UrlMapper
, menu setup, and browser detection were moved into main process; too much was going on in the renderer, which actually slowed down request loads quite a bitremote
), unless it's UI-relatedsrc/electron-app.js
tosrc/main/index.js
require
instead ofimport
), since it's a node environment that supports ES6, but that's a change to be made laterwindowFactory
TitleBar
andFooter
are extracted out ofMainContent
into anApp
container, which RR controls the children ofHome
/Welcome
split out ofMainContent
so the user isn't contained to a single browser session, and can launch as many browsers as they want. URL mappings are also shown the same way instead of the original modalsrc/containers
contains top-level route containers, leaving the smaller components that make up the containers to the originalsrc/component
TitleBar
uses Material-ish tab styling and shows which tab is active.Requests
also have an empty state nowindex.js
is no longer the kitchen sink! Use reduxconnect
to allow a component to use the redux store - dispatch actions for mutations, and make use of selectors kept insrc/reducers
to read store dataMainContent
is nowRequestsContainer
and no longer maintains which request is active or has a context menu (that's in Redux now)proxy
/urlMapper
are in the main process, their states are synced with Redux over IPCproxy
/urlMapper
have changes, they dispatch aSYNC
action over IPC, which a reducer will apply to the state. This allows components to just read their states via redux'sconnect
and not worry about how that data gets there