Repository navigation
Avoid main.js in git repo - #1641
Conversation
|
Nice! Where will |
It is not available for download. But it is included in the jar file like before. (I hope, not verified yet ;) ) So everyone using the release won't notice the change. And everyone using the sources will have to create it before using it. I'm thinking of including a oneliner to prepare everything for that. I have thought about the "downloadable main.js"-option, but everytime we change something, we need to point to a new release in index.html or package.json, which we will likely forget (often) |
| People with IDE knowledge can directly jump to [Start Development](#start-development) | ||
|
|
||
| Now, before you proceed install git and jdk8, then do: | ||
| Now, before you proceed install git and jdk8 or jdk11, then do: |
There was a problem hiding this comment.
Maybe it would make sense to split this in two lines. It's too easy to misread this sentence IMHO :).
Install git and jdk8 or jdk11.
Then do:
| # create main.js via npm, can be omitted if no UI is needed | ||
| cd web && npm install && npm run bundleProduction && cd .. | ||
| # fetches main.js, can be omitted if no UI is needed | ||
| cd web/src/main/resources/ && ZFILE=/tmp/gh.jar && wget -O $ZFILE "https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.graphhopper&a=graphhopper-web&v=LATEST" && unzip $ZFILE assets/js/main.js && rm $ZFILE && cd ../../../.. |
There was a problem hiding this comment.
With this "trick" we fetch the latest snapshot main.js that is bundled in the maven repo of "graphhopper-web" and there is no longer a need to install npm if no JS development is done. I think with this it is again easy enough to install graphhopper and ready to merge - what do you think @boldtrn ?
(Unfortunately nexus does not seem to allow to download just a single file from a zip container unlike e.g. artifactory, so we have to download the whole jar, but better than whole npm and dependencies)
As mentioned above. The main.js is downloadable from the snapshots and releases via fetching the graphhopper-web jar and then unzipping. See docs/core/quickstart-from-source.md for the master Update: should we include a maven plugin? ( https://github.com/eirslett/frontend-maven-plugin suggested from @michaz ) |
|
Please put a hint about uncommenting the assets overrides section in config.yml and/or about how to do it with npm in the developer quickstart. It took me a whole day to figure this out (no blame intended, you are doing an awesome job). |
|
It should be already there :) But yes, we need to improve this as I stumbled also over this although I should know... |
|
Oops, indeed, sorry. I remember having read the first sentence of the paragraph: "When developing the UI ...", thought "Not for me" and skipped it. But when I pointed the browser to localhost:8989, it didn't seem to work. |
|
If you do not intend to change the UI then npm and also this line should not be required. Did you include the following line before running the graphhopper.sh script? cd web/src/main/resources/ && ZFILE=/tmp/gh.jar && wget -O $ZFILE "https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.graphhopper&a=graphhopper-web&v=LATEST" && unzip $ZFILE assets/js/main.js && rm $ZFILE && cd ../../../..
./graphhopper.sh -a web -i europe_germany_berlin.pbf |
|
Yes, I tried that. |
|
Strange. Maybe you have no wget installed or some other error occured for the first command? I tried to reproduce a problem but even if I removed the jar and main.js files: the two lines worked and the main.js was included in the jar, i.e. the UI was properly showned (and the main.js served from classpath). |
|
I retried with a newly downloaded repository. When I run the line you mentioned above before running graphhopper from the Intellij IDE, everything works. So the only thing that needs to be changed in the developer quickstart is deleting the sentence "People with IDE knowledge can directly jump to Start Development." and maybe in the section "Start Development" a hint, that you need to run that line. Not running that line reproduced my problem.
|
Ups, thanks that is a problem that we need to fix! Either by removing or an improved IDE section - maybe you have a minute to improve this :) ? And make it really simple and obvious for starting developers. Because the wget will automatically download the main.js and the graphhopper.sh script will fetch the pbf and copy the config.yml from config-example.yml. |
|
|
|
Would be best, yes |
|
Hey, thank you for the change It helped me get started. |
Fixes #1548
I think this is the easiest way to solve the problem: removing main.js from git and creating it on travis. I.e. in every released jar the main.js will be still included.
TODOs
make sure server restart is not required for JS changes (there seems to be something broken, maybe due to the recent dropwizard upgrade?)I used the config-example.yml where the assets overrides section is uncommented. This is a bit ugly but as we do not want this in production we need to have it as it is.