graphhopper: JS development cycle is broken after dropwizard merge
In order to develop JS code we did:
cd web
npm run watch
and then we were able to refresh the browser. Now the changes take effect only if we repackage the jar e.g. via
mvn clean install -DskipTests=true
It is possible to load assets directly from disc instead of looking inside the jar. I found this plugin
With a changed npm-watch
task one can use it if the server was started from an IDE:
watchify src/main/resources/assets/js/main-template.js -o target/classes/assets/js/main.js --debug --verbose
but this is ugly as we don’t want to force JS devs to mess around with IDEs.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 31 (31 by maintainers)
Commits related to this issue
- serve static content from disc instead from classpath, #1330 — committed to graphhopper/graphhopper by karussell 6 years ago
- Revert "serve static content from disc instead from classpath, #1330" This reverts commit b0c6e5755943ffd6a6786cd6f274a9dbb64cdbfa. — committed to graphhopper/graphhopper by karussell 6 years ago
- serve static content from disc instead from classpath, #1330 — committed to graphhopper/graphhopper by karussell 6 years ago
- serve static content from disc instead from classpath, #1330 (#1331) — committed to graphhopper/graphhopper by karussell 6 years ago
- Use ConfigurableAssetBundle to aid development of the web client #1330 Signed-off-by: Michael Zilske <michael.zilske@tu-berlin.de> — committed to graphhopper/graphhopper by michaz 6 years ago
- change script and docs, #1330 — committed to graphhopper/graphhopper by karussell 6 years ago
- use directory relative to root for asset reloading, #1330 — committed to graphhopper/graphhopper by karussell 6 years ago
Can confirm that this works - have changed the script and docs accordingly.
Yes I agree, I think we could even think about completely separating the web-demo part from this repo. This would IMHO make it easier for web developers to work with the demo. We could try to set this up using the standard node style so that developers have an easy time to find what they are looking for and don’t be scared off by this huge java project?
Please ignore me. Have to try this tomorrow 😉
Maybe we could restate the default logging configuration in config.yml (and an entries under ‘loggers’ for com.graphhopper) to make this clear ? Something like this :
I was able to make it working through a new application class:
And called
java -cp gh.jar com.graphhopper.http.GraphHopperDebugApplication server config.yml
But is this the way to go? I would have thought I could just use a different command likeserver-debug
but wasn’t able to get it working as the initialize method only offer a configfactory somehow.