Closed gkwan-ibm closed 4 years ago
~mvn generate-resources~
~For Fetchdata.js
I originally wanted to create it, but ran into issues when the file was missing while building. Looking into it again.~
rearranged steps in guide and Fetchdata.js
is now initially created.
mvn liberty:run
and then run the frontend service by mvn generate-resources
react
package,..."<httpEndpoint/>
and align <cors/>
:4020
.@DannyS03
httpsPort=
should be indented by 4 spaces as well as the attributes of cors/>
src/main/webapp
if it no usenew feedback addressed. @gkwan-ibm can verify changes again.
the artist.json
includes the same data from the application in the rest client java, angularjs, angular guides, with some additions. The album
data for each artist currently does not display on the react table... only the additional artists attributes do.
@DannyS03
@DannyS03
mvn generate-resources
got errorswill review again after address the above
addressed feedback.
finish
dir will be ran from just starting the OL server and the required production build static files are already configured in webapp/static
. This favours the approach that the app in the finish
dir should be "finished", and the user does not need to worry about generating the node resources to create the frontend build when they are in the twyb section.CORS filter removed from server.xml
as the frontend and backend are now being hosted off of the OL server and not needed. README also updated.
The reason mvn generate-resources is failing in start
is because the npm run build
resource cannot execute as it is looking for the Fetchdata.js
file, which is to be created in the guide rather than updated.
Fetchdata.js
included in the start dir as it used to be, or initially update multiple files.The angular guide does not "create" it's module files but rather updates them throughout the guide... see, https://openliberty.io/guides/rest-client-angular.html#importing-the-http-client & https://github.com/OpenLiberty/guide-rest-client-angular/blob/master/start/src/main/frontend/src/app/app.module.ts
@gkwan-ibm
* [ ] app not work on finish and start * [ ] restructure the flow, just create Fetchdata.js once and explain the detail by multiple subsection - run mvn generate-resources later * [ ] or precreate a simple Fetchdata.js and ask readers to replace (still replace one) - then we can ask readers to run the mvn generate-resources before liberty:dev * [ ] add more content to showcase the change of the artists.json
tried on another machine with fresh env and clone in finish (mvn liberty:run) and start (generating the resources later) and it works.
other feedback has been addressed. Ready for review and retesting.
flow rewritten and feedback addressed.
tested on mac os and windows.
draft site being updated but lgdev has latest changes.
@DannyS03
unregistered
does not highlight correctlyindex.js
at the endAddressed your feedback @gkwan-ibm. You can review changes.
Draft site is updated with latest changes.
return
statement ..." The hotspot of return
should cover the line );
toosrc\main\webapp directory
* **Project Configuration** * [ ] rewrite both statements to explain clearly * "The static files" readers may not know what you are talking about * in general, I guess readers may not understand the first statment * in second statement, readers may not know target directory, should say something like "copy the generated ReactJS files to the web content of the application" * [ ] The subsection "**Creating the default page**" should be a main section * [ ] the path in "Create the index.js file." is still wrong * **Creating the React components** * [ ] "The `return` statement ..." The hotspot of `return` should cover the line `);` too * [ ] don't know why the start directory not work again by following the instruction * the static directory with other files were not copied to the `src\main\webapp directory`
src/main/frontend/src
?start
dir. mvn package
will execute all the required phases and includes generate-resources already. Originally, when running mvn generate-resources
the files were still being copied from the main/frontend/build dir to main/webapp but it looks like this is not the reliable/appropriate method.
generate-resources
goal alone is still explained. Ready for review.
frontend-maven-plugin
to .... Use maven-resources-plugin
to ..."src/main/frontend/src
-> src/main/frontend/src/ index.js
columns
and return
mvn package
at the end to make the app work is not the best approach and package
has a sense of completion (not for developing). Would you study and make the following order?
mvn package
) to generate/copy the static directory to the src\main\webapp directorymvn liberty:dev
In that case, I will use mvn process-resources
which is exactly what we are trying to achieve with generating the node resources and copying the files into the web content. The steps will stay the same in this case as they do not need to be altered.
I think Project Configuration can be combined with Building and packaging the frontend, @gkwan-ibm
frontend-maven-plugin
is used to [hotspot as is]install
Node.js/Node in your [hotspot to workingDirectory]project directory
and [hotspot as is]produce
the frontend production build at the src/main/frontend/build
directory.maven-resources-plugin
copies the static content from the frontend [hotspot as is]build
directory to the [hotspot as is]web content
of the application.<failOnMissingWebXml/>
<!-- Support for JDK 9 and above -->
and the dependecyjunit-jupiter
(not junit-jupiter-engine
)frontend
directory." Should update the frontend
to src/main/frontend
?frontend-maven-plugin
plugin is used to [hotspot]install
Node.js in the [hotspot]working
directory, and [hotspot]produce
the production files to the src/main/frontend/build
directory."maven-resources-plugin
copies the static
content from the [hotspot]build
directory to the [hotspot]web content
of the application."index.js
file should be the main entry point of the frontend of the application as it coincides with the index.html
file. ..."React library
imports the default export
from the react package. " -> "The [hotspot]React
library imports the default export from the [hotspot]react
package. "
frontend/src.
" frontend/src
is incorrect nowcreate-react-app
?React library
imports the default export
..." -> "The React
library imports the default export
..."React Component
. " -> "... an inheritance of the React
component`. "???axios library
..." -> "Add the axios
library ..."create-react-app
what does it mean?frontend/src
. " frontend/src
is incorrect nowNote: Overall comments for the above
frontend
directory changed, so make sure the content updated correctlycreate-react-app
in the readme several times but I cannot find out what it is? how it relates?create-react-app
is explained in What you'll learn
better to keep
React Component
. "To simplify and not go into detail about default exports
and named exports
, I changed to:
The [hotspot=import-react]`React` library imports the [hotspot=import-react]`react` package.
The [hotspot=react-library file=1]`React library` imports the `react` package for you to create the [hotspot=class file=1]`Fetchdata` component as an inheritance of the `React Component`, and use its values.
Create React App
is a comfortable environment for learning React, ...", WhyCreate React App
is backticked? Is following better?mvn generate-resources
beforemvn liberty-run
?mvn generate-resources
?