Hey Arkadi, a couple of questions regarding Decomp...
# mvikotlin
n
Hey Arkadi, a couple of questions regarding Decompose project that I forked. ( trying to modernize React samples ) 1. How can I update dependencies? After updating the value in
deps.versions.toml
it doesn't seem to be reflected anywhere 2. How can I run specific projects eg,
./gradlew :sample:master-detail:browserRun
task doesn't exist. 3. Have you had the chance to think about the Browser Routing issue? Any pointers on how to recreate configuration? As the part of getting the data and manipulating the URL is simple enough
a
Hello and thanks for your contributions! 1. Not sure which dependencies you are referring to. But the
deps.versions.toml
is the place where versions are defined. After Gradle sync it should be updated. 2. The browser sample project is
:sample:master-detail:app-js
There is a task named
browserRun
, but I usually use
browserDevelopmentRun
. You can enable task list in the Gradle side panel as follows: File -> Settings -> Experimental and and uncheck
Do not build Gradle task list ...
3. I started working on it already and will provide some updates soon. In general - it is definitely possible. The only task is to come up with a convenient API. So you can also play with it on your own, in your own project. The idea is: 1. to update the browser history when the backstack changes; 2. to hook to the URL changes and
navigate
the Router; 3. to supply initial configuration and backstack when the page is first loaded.
👍 1
n
Thank you for the swift response! It's great to hear you're working on 3) the more I develop for the browser the more I feel like I miss this feature
a
Yeah, I totally agree. At the moment I think that we don't need any existing API change for this feature. Just something js specific on top. So you actually can do something already for your needs!
And this should be a one-time job
n
That would ideal, was hoping for something like that
@Arkadii Ivanov Looking amazing! Can't wait to try it out. For your question. From my understanding, the
HashRouter
variant basically tells the browser that the path after the
#
is client side only and doesn't require a refresh. But this is pretty much useless as we ourselves handle the history and path, and
browser.history.push()
(whatever the function is called) doesn't force a refresh either. So all in all, go for the
BrowserRouter
as it's far more widespread and common, not sure if
HashRouter
is much of a thing nowadays.
a
I tried the HashRouter and it does affect the history. E.g. I'm able to click on the back button and go to the previous hash path. But agree, the BrowserRouter-ish implementation is more important, will try to release it first.
❤️ 1