8000 angular2-product-app: simplify KeycloakHttp by tsabirgaliev · Pull Request #3855 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

angular2-product-app: simplify KeycloakHttp - #3855

Merged
ssilvert merged 5 commits into
keycloak:masterfrom
tsabirgaliev:master
Feb 24, 2017
Merged

ssilvert merged 5 commits into
keycloak:masterfrom
tsabirgaliev:master

Conversation

@tsabirgaliev
@tsabirgaliev tsabirgaliev commented Feb 9, 2017 •
Copy link
Copy Markdown
Contributor

Implement Angular 2 example from scratch using latest and greatest Anglular 2.4.x and angular-cli

@tsabirgaliev tsabirgaliev changed the title WIP angular2-product-app: simplify KeycloakHttp WIP: angular2-product-app: simplify KeycloakHttp Feb 10, 2017
@ssilvert
Copy link
Copy Markdown
Contributor

Sorry it has taken so long to look at this. I tried your code and it's not fetching the data when you click "Reload". I get a 401 "Unauthorized" error in the console when it tries to get http://localhost:8080/database/products.

@tsabirgaliev
Copy link
Copy Markdown
Contributor Author

@ssilvert can you please provide some guidance on how to test this code? Can't figure out how to build the demo apps

@ssilvert
Copy link
Copy Markdown
Contributor

How did you test your code before you submitted the PR?

@tsabirgaliev
Copy link
Copy Markdown
Contributor Author

Ok, I managed to build the app and now see that the example relies on outdated version of angular. So now there are 2 paths I can go:

  1. upgrade dependencies and stay with system.js (less impact on code, but harder to maintain)
  2. replace the build tools with more modern angular-cli approach (more impact, easier to maintain)

What should I do?

@ssilvert
Copy link
Copy Markdown
Contributor

I think #2 would be best. You are thinking WebPack?

@ssilvert
Copy link
Copy Markdown
Contributor

Oh, you said use angular-cli. So that means definitely moving to WebPack. That would be great.

@tsabirgaliev
Copy link
Copy Markdown
Contributor Author

I hoped for that option as well :)

Ok, let me come back with more patches then

- use `frontend-maven-plugin` to pull node/npm automatically
- tie `npm install` to relevant lifecycle (`mvn wildfly:deploy` automatically builds and includes build products into WAR)
- extern keycloak and product database base url, use `--env=war` to build a war colocated with keycloak and database app

Issues/Todos:
- when testing with `ng serve` will have to disable browser web security (product-database doesn’t allow cross-origin requests)
- no unit / e2e / arquillian tests for now
- `src/main/frontend/node_modules` is included in distribution build, this is a portability debt
@tsabirgaliev
tsabirgaliev commented Feb 23, 2017 •
Copy link
Copy Markdown
Contributor Author

@ssilvert please, review :)

Features

  • use frontend-maven-plugin to pull node/npm automatically
  • tie npm install to relevant lifecycle (mvn wildfly:deploy automatically builds and includes build products into WAR)
  • extern keycloak and product database base url, use --env=war to build a war colocated with keycloak and database app

Issues/Todos:

  • when testing with ng serve will have to disable browser web security (product-database doesn’t allow cross-origin requests)
  • no unit / e2e / arquillian tests for now
  • src/main/frontend/node_modules is included in distribution build, this is a portability debt

@ssilvert
Copy link
Copy Markdown
Contributor

Looks good now. Works like a charm.

Did see a couple of things in /frontend that need to be touched up before we merge:

  1. Change license in package.json to Apache 2.0
  2. Update README.md to include detail on how to run with ng serve. Have you tried enabling CORS?

@tsabirgaliev
Copy link
Copy Markdown
Contributor Author

@ssilvert Done!

@tsabirgaliev tsabirgaliev changed the title WIP: angular2-product-app: simplify KeycloakHttp angular2-product-app: simplify KeycloakHttp Feb 24, 2017
@ssilvert
Copy link
Copy Markdown
Contributor

Great. Thanks for the contribution!

@ssilvert
ssilvert merged commit 6ea9581 into keycloak:master Feb 24, 2017
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.

2 participants

0