You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JS development cycle is broken after dropwizard merge #1330
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.
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 like server-debug but wasn't able to get it working as the initialize method only offer a configfactory somehow.
changed the title [-]Usual JS development cycle is broken after dropwizard merge[/-][+]JS development cycle is broken after dropwizard merge[/+]on Apr 10, 2018
I tried this but no matter what I did the assets were always picked up from the jar/classpath (although I verified that GraphHopperDebugApplication was running). I would have liked to check the FileAssetServlet debug logging as mentioned here, but then I did not manage to configure log4j with dropwizard :( ? It does not let me pass -Dlog4j.configurationFile via the command line and it seemingly did not pick up any log4j.xml files from the class path (I tried putting it in core/src/main/resources), either. I also did not find out where dropwizard picks up the logging configuration from (?).
Oh, this was a stupid mistake and is now fixed: 4d95eb5
@ammagamma would you try again if hot reloading works for you? @michaz I'll format all files according to new IntelliJ (see linked commit and also stumbled over it here) or will this break some of your branches?
Now we are not including the webapp at all anymore in the non-debug-version.
Bad. Maybe we should then use the configurable asset and include UI by default (to serve via classpath or disc) and offer a separate api action without this for stricter security.
Activity
karussell commentedon Apr 10, 2018
Using the linked plugin and
works as intended with and without an IDE and without other changes.
@michaz can we make this line configurable somehow and avoid as default (for production) to increase security?
We could use another plugin: https://github.com/dropwizard-bundles/dropwizard-configurable-assets-bundle#getting-started
But this makes us dependent on the security of this external plugin.
karussell commentedon Apr 10, 2018
I was able to make it working through a new application class:
And called
java -cp gh.jar com.graphhopper.http.GraphHopperDebugApplication server config.ymlBut is this the way to go? I would have thought I could just use a different command like
server-debugbut wasn't able to get it working as the initialize method only offer a configfactory somehow.serve static content from disc instead from classpath, #1330
Revert "serve static content from disc instead from classpath, #1330"
serve static content from disc instead from classpath, #1330
[-]Usual JS development cycle is broken after dropwizard merge[/-][+]JS development cycle is broken after dropwizard merge[/+]serve static content from disc instead from classpath, #1330 (#1331)
easbar commentedon Apr 12, 2018
I tried this but no matter what I did the assets were always picked up from the jar/classpath (although I verified that GraphHopperDebugApplication was running). I would have liked to check the FileAssetServlet debug logging as mentioned here, but then I did not manage to configure log4j with dropwizard :( ? It does not let me pass -Dlog4j.configurationFile via the command line and it seemingly did not pick up any log4j.xml files from the class path (I tried putting it in core/src/main/resources), either. I also did not find out where dropwizard picks up the logging configuration from (?).
michaz commentedon Apr 12, 2018
Log4j is gone -- Dropwizard uses logback. It's configured in-line in the
config.yml, see http://www.dropwizard.io/1.3.1/docs/manual/core.html#log-formatmichaz commentedon Apr 12, 2018
(Could you perhaps contribute whatever you put into your configuration as an example, for
config-example.yml, please?)16 remaining items
karussell commentedon Apr 20, 2018
Oh, this was a stupid mistake and is now fixed: 4d95eb5
@ammagamma would you try again if hot reloading works for you?
@michaz I'll format all files according to new IntelliJ (see linked commit and also stumbled over it here) or will this break some of your branches?
michaz commentedon Apr 20, 2018
@karussell Sure, go ahead!
michaz commentedon Apr 20, 2018
Now we are not including the webapp at all anymore in the non-debug-version.
karussell commentedon Apr 21, 2018
Bad. Maybe we should then use the configurable asset and include UI by default (to serve via classpath or disc) and offer a separate
apiaction without this for stricter security.Use ConfigurableAssetBundle to aid development of the web client #1330
michaz commentedon Apr 21, 2018
Here we go. See
config-example.yml. No separate class or command necessary. I don't have security concerns. I think this is done.karussell commentedon Apr 21, 2018
Thanks!
karussell commentedon Apr 23, 2018
Can confirm that this works - have changed the script and docs accordingly.
change script and docs, #1330
easbar commentedon Apr 27, 2018
to be honest it does not, but I will try again...
karussell commentedon Apr 27, 2018
Tested it again and when editing the JS file in IntelliJ I didn't even need to save and just refreshed in the browser. Steps I did:
./graphhopper.sh clean; ./graphhopper.sh web /home/peter/Downloads/berlin-latest.osm.pbfcd web; npm run watcheasbar commentedon Apr 28, 2018
Ok it works :) I think the overrides path in my config.yml was not correct relative to the working directory.
karussell commentedon Apr 28, 2018
Ah, ok. Maybe we should change it relative to the root.
use directory relative to root for asset reloading, #1330