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 fusion-plugin-react-router to make depending on browser history easier #738
Refactor fusion-plugin-react-router to make depending on browser history easier #738
Conversation
e1d53c5
to
86e7236
Compare
c6c1b58
to
28795b6
Compare
28795b6
to
3f2c994
Compare
@@ -174,6 +174,23 @@ app.register(GetStaticContextToken, (ctx: Context) => { | |||
}); | |||
``` | |||
|
|||
##### `BrowserHistoryToken` |
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.
@ganemone – I made my best efforts here in terms of the docs. Let me know if you have feedback.
const simulator = setup(app); | ||
await simulator.render('/'); | ||
|
||
expect(middlewareHistory).toBe(providerHistory); |
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.
I mostly just want to assert that the instance is the same regardless of where you get it.
Is there anything else I should add to the tests?
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.
this is good
There appears to be a lint error, but other than that, LGTM |
The lint error appears to be:
...but this code was present before my change. What is the recommended way to get ahold of |
So the cup/no-undef rule is smart enough to recognize code that exists inside |
Fixed the lint. Does buildkite need to be manually restarted? |
Are you sure you pushed your changes? It doesn't look like anything has been updated |
This makes it a bit easier to write plugins that depend on browser history.
6dc39e9
to
7aacbec
Compare
)" This reverts commit 698e000.
Hello!
I'm creating this PR to follow up on a conversation I had with @ganemone.
tl;dr– I'd like to be able to access browser history in a provider of one of my plugins. Being able to access history in a provider saves me from writing a lot of boilerplate downstream, which greatly simplifies my application and plugin code.
I'm curious if the approach below is something that makes sense–
I pulled apart the router plugin into distinct server and browser plugins, and then I have just the browser plugin depend on the router history.Thanks in advance!