preactjs / preact-router

:earth_americas: URL router for Preact.
http://npm.im/preact-router
MIT License
1.02k stars 155 forks source link

docs(readme): Note added for history v5's types #387

Closed rschristian closed 2 years ago

rschristian commented 4 years ago

What kind of change does this PR introduce? Expounding upon documentation

Summary

385 brought up history v5's types being incompatible with preact-router's. If a new user were to read the custom history section and use the latest version of history along with TypeScript then they would not be able to build their application.

I figure that adding a note is a simple and quick temporary solution for anyone else who comes across this. Let me know if I should change the verbiage in any way.

janybravo commented 3 years ago

It is not only types from history@5 npm package that are incompatible. Also interfaces are incompatible causing incorrect behavior when using custom history@5 without an error. So I think is important to clarify that or even better to upgrade to latest history.

rschristian commented 3 years ago

@janybravo Thanks for the extra info.

What do mean by "...or even better to upgrade to the latest history"? This lib doesn't actually use history, just used to be compatible. I'm not sure whether it's a goal to be compatible or not either, as undoubtedly this lib updates less frequently than history which would make it difficult to stay compatible as time went on.

janybravo commented 3 years ago

@rschristian. I know that is just and interface. I assumed that history that could be provided to Router via customHistory, should be compatible with history@5, by which I mean latest version of it.

I see what you mean. If it helps, I have PR ready to have preact-router work better with history@5 if it helps. It would break compatibility with history@4 since they changed their interface.

rschristian commented 2 years ago

Support for v5 was added in #410