Skip to content

Conversation

kabir
Copy link
Contributor

@kabir kabir commented May 24, 2019

No description provided.

-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
Copy link
Member

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`.
Copy link
Member

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:
Copy link
Member

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) {
Copy link
Member

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.
Copy link
Member

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.
Copy link
Member

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
Copy link
Member

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

@rsvoboda
Copy link
Member

@gsmet / @stuartwdouglas / @emmanuelbernard

Can you look into this blog post ?

It could possibly go out together with 0.16.0 release.

@kabir
Copy link
Contributor Author

kabir commented May 28, 2019

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

@emmanuelbernard
Copy link
Member

emmanuelbernard commented May 28, 2019

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:

  1. what we aim to achieve
  2. ninja survival guide jsut ot get started (for the tl;dr;
  3. a diagram explaining the various problems
  4. the detailed solution that overcomes points in 3

I don't know if it would work best so take it as a proposal.

The other points are more technical:

  1. servlets are a bit passé so having to define some is not awesome but a better solution will have to wait for the router API I suppose CC @stuartwdouglas
  2. you have a lot of "stop quarkus and start it again which is not a nice experience. I wonder if that was mandatory or if that simply was due to you wanting to do step by step and therefore having these stops to update your poms and co?

@kabir
Copy link
Contributor Author

kabir commented May 28, 2019

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:

  • briefly run through the three problems I have seen 'selling' that in a more positive light. Something along the lines of "we can already change the output of the REST endpoint in quarkus:dev. Now let's see the simple steps to be able to do the same in the UI without repackaging the application"?
  • Address them with steps 4-6

Hopefully, once the whole thing is shorter I can make clearer what is actually needed (aka your ninja survival guide)

@rsvoboda
Copy link
Member

I could push steps 1-3 into the example code repositories README

I would push full blog post to README, including steps 4-6

@kabir
Copy link
Contributor Author

kabir commented Jun 6, 2019

Replaced by #223

@rsvoboda
Copy link
Member

rsvoboda commented Jun 7, 2019

Closing as this PR is invalid, followup one is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants