-
Notifications
You must be signed in to change notification settings - Fork 394
Blog post about Angular and Quarkus development. #210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
-DprojectArtifactId=blog-quarkus-ui-development \ | ||
-DprojectVersion=0.1.0 \ | ||
-DclassName="org.kabir.quarkus.ui.SampleResource" \ | ||
-Dextensions=io.quarkus:quarkus-resteasy,io.quarkus:quarkus-resteasy-jsonb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-Dextensions=io.quarkus:quarkus-resteasy-jsonb
is sufficient
quarkus-resteasy is already added in template - https://github.com/quarkusio/quarkus/blob/master/devtools/common/src/main/resources/templates/basic-rest/java/pom-template.ftl#L31
Right now user will see warnings like:
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique:
io.quarkus:quarkus-resteasy:jar -> duplicate declaration of version (?) @ line 46, column 17
|
||
If we go to `/rest`, we end up in `RestComponent` which displays data from the `SampleResource` we saw above and also has a link back to `DefaultComponent`. | ||
|
||
Finally if we go to `/clientCallback` (which is triggered via `/servlet/callback` in `/SampleServlet` we end up in `ClientCallbackComponent`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/SampleServlet
=> SampleServlet
---- | ||
If you go to http://localhost:8080 you will get a page with links to `Other`, `Rest` and `Default`. Click on the `Other` and `Rest` ones, and it should all work. | ||
|
||
However while in the `Other` component, so that the address in the browser is http://localhost:8080/other, if you try to refresh the page you will end up with the following error message: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message look a bit strange. What about following version?
However while in the Other
component (http://localhost:8080/other), if you try to refresh the page you will end up with the following error message:
} | ||
} | ||
|
||
private boolean isIndexHtmlRequest(HttpServletRequest request) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change the method name, it's confusing.
assumeAngularRoute()
or isAngularRoute
sound better to me
|
||
== Quarkus and Angular UI Development | ||
|
||
In this blog post we will look at how to take advantage of the respective development modes of both Quarkus and Angular CLI and see how we can develop a zero turnaround web application backed by a RESTful API on Quarkus. While I am using Angular, the concepts should be the same for other web application frameworks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the concepts should be the same for other web application frameworks.
Mention you looked at React and Vue and they support proxying API requests.
So the reader familiar with above two doesn't give up reading when not familiar with Angular
$mvn clean | ||
$mvn package quarkus:dev | ||
---- | ||
to start the Quarkus application. Note how we did not pass in `-Dui.dev` so we will no longer bundle the web application which saves us a significant amount of time. If you go to http://localhost:8080 you will get an error since we have no web application this time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you will get an error
That's true if you remove webapp/dist/webapp
first.
Finally, to run this in production you need to run: | ||
[source,bash] | ||
---- | ||
$mvn package -Dui |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add section about native image, this is very important part of Quarkus story.
mvn package -Dui -Pnative
works fine and you see awesome
Quarkus 0.15.0 started in 0.007s. Listening on: http://[::]:8080
@gsmet / @stuartwdouglas / @emmanuelbernard Can you look into this blog post ? It could possibly go out together with 0.16.0 release. |
I will address @rsvoboda 's comments, but as it is a slight pain to retag all the code when I make changes I will wait for further comments from people. Or if someone lets me know it looks ok once I've incorporated those changes, I can do so then |
General comments as the front end is not my forte. To me, the blog feels like you went through a lot of pains and hitting snatches but by luck recovered every time. Not sure that's the feeling we want to give. It looks like you want to explain the various points and then find a solution but I had this negative reading. Also it looks very complicated to setup :) Have you tried and explored the idea of wording it with the following sections:
I don't know if it would work best so take it as a proposal. The other points are more technical:
|
The stop and start is to do all this step by step, yes. So it leads up to being able to do everything without needing to stop and start it. To have something to demo (steps 1-3), it became quite lengthy for something which is not really that interesting, and which is where the bulk of the stop/start stuff is. I could push steps 1-3 into the example code repositories README and just refer to that from the blog. Then I can:
Hopefully, once the whole thing is shorter I can make clearer what is actually needed (aka your ninja survival guide) |
I would push full blog post to README, including steps 4-6 |
Replaced by #223 |
Closing as this PR is invalid, followup one is merged. |
No description provided.