Closed deepu105 closed 6 years ago
@deepu105 I got HMR working but there is a problem. When we change angular 2 files like html or ts the whole angular 2 module is refreshed causing a blink in the screen. I thought it was i18n loading but in reality I'm pretty sure it's ui-router that causes it because I tried angular/router and everything works fine.
If you want to test iit I made a repo : https://github.com/VictorADS/ngHmr
The branch master contains the version with angular/router and the branch hmr-uirouter contains the version with ui-router.
To test you need to run the server and run npm run webpack:hmr
ok lets do it after our release when we move to angular router
@VictorADS maybe this could be avoided by importing all deps in vendor.ts so that main bundle contrains only jhipster code
Hi @deepu105 What is plan when you move to angular router?
@gmarziou I tried but the blink is still there. Besides this little visual issue the HMR works great and it reloads the page really fast. So can I make a PR ?
Yes we can live with the blinks I guess
Thanks & Regards, Deepu
On Mon, Jan 9, 2017 at 12:06 PM, VictorADS notifications@github.com wrote:
@gmarziou https://github.com/gmarziou I tried but the blink is still there. Besides this little visual issue the HMR works great and it reloads the page really fast. So can I make a PR ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/4794#issuecomment-271258963, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDlF2d00Y-th0FUh3gKrpJZQWNFeIl9ks5rQhTKgaJpZM4LYiFe .
Could you also try to do some lazy chunks?
Thanks & Regards, Deepu
On Mon, Jan 9, 2017 at 12:07 PM, Deepu K Sasidharan d4udts@gmail.com wrote:
Yes we can live with the blinks I guess
Thanks & Regards, Deepu
On Mon, Jan 9, 2017 at 12:06 PM, VictorADS notifications@github.com wrote:
@gmarziou https://github.com/gmarziou I tried but the blink is still there. Besides this little visual issue the HMR works great and it reloads the page really fast. So can I make a PR ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/4794#issuecomment-271258963, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDlF2d00Y-th0FUh3gKrpJZQWNFeIl9ks5rQhTKgaJpZM4LYiFe .
@deepu105 What I understood about lazy chunks loading is that we load the modules when we try to access a specific state. Wouldn't it be better to migrate to angular-router then add lazy loading ?
Yes you are right. I was talking more about webpack chunks sorry for the confusion
Thanks & Regards, Deepu
On Mon, Jan 9, 2017 at 5:59 PM, VictorADS notifications@github.com wrote:
@deepu105 https://github.com/deepu105 What I understood about lazy chunks loading is that we load the modules when we try to access a specific state. Wouldn't it be better to migrate to angular-router then add lazy loading ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/4794#issuecomment-271340559, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDlF3uT3YtjA8_Y_oj61DCSvxQvcU1jks5rQmdtgaJpZM4LYiFe .
What part of the app do you want to lazy load ? I was thinking about admin / account / entities module but that would be done within the routing files.
I'm not very sure. I think now the majority of the time is spent in compiling stuff. can we try to make sure that the vendor files are not compiled during file changes in app first.
Thanks & Regards, Deepu
On Tue, Jan 10, 2017 at 2:50 PM, VictorADS notifications@github.com wrote:
What part of the app do you want to lazy load ? I was thinking about admin / account / entities module but that would be done within the routing files.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/4794#issuecomment-271579966, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDlF6xB3i060lBAeXc8s0TW6hAPO5Y5ks5rQ4zBgaJpZM4LYiFe .
I'm looking into DLL webpack plugin which might be what you want
Yes I missed it
Thanks & regards, Deepu
On 18 Jan 2017 1:28 a.m., "Gaël Marziou" notifications@github.com wrote:
Maybe an additional task:
- add some needles for modules, for instance in vendor.ts.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/4794#issuecomment-273345388, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDlF_99N6wDMfxhiBv2KLsG9BGhm5fDks5rTVyxgaJpZM4LYiFe .
Regarding lazy loading sub modules, I have few comments:
User
and related services (an entity can have a relationship with User). Looking at features that require ROLE_ADMIN may help refactor our modules.What about adding analytics? https://github.com/angulartics/angulartics2/
I think we already have GA setup in index.html and I think it should work same as we had earlier
Thanks & Regards, Deepu
On Tue, Jan 31, 2017 at 2:20 PM, Gaël Marziou notifications@github.com wrote:
What about adding analytics? https://github.com/angulartics/angulartics2/
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/4794#issuecomment-276360832, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDlF3p7RTWI8fB-bNNJ_WrQMQAD99Agks5rXzURgaJpZM4LYiFe .
I think GA will only catch access to '/', angulartics2 knows about the router and can report all route changes to GA.
Isnt this something better suited for a Module?
Thanks & Regards, Deepu
On Tue, Jan 31, 2017 at 3:15 PM, Gaël Marziou notifications@github.com wrote:
I think GA will only catch access to '/', angulartics2 knows about the router and can report all route changes to GA.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/4794#issuecomment-276373660, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDlFwZ58Zzlk1PCoq9A6JjHt54nOkWNks5rX0IFgaJpZM4LYiFe .
OK
In fact, it seems really simple to do by subscribing to route changes: https://blog.thecodecampus.de/angular-2-google-analytics-google-tag-manager/
@jhipster/developers guys is anybody working on the TODO items here?
@deepu105 no I don't think anybody does, and there is a lot of stuff here. AOT is specifically annoying to me, as we really need this for production.
@deepu105 what should we do about this list? It looks to me like we are stucked...
We need help on this. More hands and feedback
On 13 Apr 2017 11:15 am, "Julien Dubois" notifications@github.com wrote:
@deepu105 https://github.com/deepu105 what should we do about this list? It looks to me like we are stucked...
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/4794#issuecomment-293836500, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDlF1DBr1rLux23R9hzWw2rsgwaBs3Hks5rveeogaJpZM4LYiFe .
I can do lazy loading of modules.
Yes please. Please note that for entities its trickier when they have relationships with other entities
On Fri, 14 Apr 2017, 9:04 am tezcane, notifications@github.com wrote:
I can do lazy loading of modules.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/4794#issuecomment-294104073, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDlFyLTzgJaFoL9erD4XM7AX_0k4RgBks5rvxqWgaJpZM4LYiFe .
Indeed lazy loading entity modules seems too complex, what about just lazy-loading the user management part?
Yeah, that would be a great start.
We could lazy load entire admin modules actually
On Sat, 15 Apr 2017, 6:13 am Sendil Kumar N, notifications@github.com wrote:
Yeah, that would be a great start.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/4794#issuecomment-294270884, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDlF6Vn0iMqSbOrv1S4W4pyYoX8RbPRks5rwEQBgaJpZM4LYiFe .
Yes we should, as it will soon become optional !
I will not be able to get to this for 3 weeks, is that OK?
I just lazy loaded my entire Ionic 3 app (~20 components). It consisted of adding another @IonicPage() decorator over the @Component() then making a .module.ts file:
import {NgModule } from "@angular/core";
import {IonicPageModule} from "ionic-angular";
import {TranslateModule} from "@ngx-translate/core";
import {SuperTabsModule} from 'ionic2-super-tabs';
import {PageTerms} from "./terms";
@NgModule({
declarations: [PageTerms],
imports: [TranslateModule.forChild(),
SuperTabsModule,
IonicPageModule.forChild(PageTerms)],
exports: [PageTerms]
})
export class ModulePageTerms {}
I'd imagine the NG4 updates to do lazy loading is similar, JHipster code is already full of .module.ts files.
I added lazy loading you can check the repo
https://github.com/Alwan/generator-jhipster/tree/lazy-loading
and sample project
https://github.com/Alwan/jhipster-lazy-loading-sample
the changes are:
need more testing. two things not working 1- the translation not showing in the lazy loaded modules when you refresh the page. 2- the urls for popup dialog not working properly.
What are the benefits of lazy loading entities?
You don't need to load all entities when you browsing the home page.
In production my application start up time improved and the bundle size went from 600k+ to 350k.
In fact, I imagine that some developers may keep generated entity views for managing data as an admin user but most of them may probably write custom views for normal users while using generated data services.
Please excuse my ignorance but what is really lazy-loaded for an entity route? If the full entity module (component, template, service, routes) is lazy-loaded, does it mean that user will encounter an error if I try to use an entity service from another view that is not already loaded?
as I understand it the whole module will be in a separated file. You can check it in Chrome dev tools.
Yes if you try to use an entity service you have to add it to your module providers. for example If you want to use an entity in home page go to HomeMudule providers and add entityService.
OK, so it looks great.
@Alwancan you do a PR?
target/www/dev
) and prod builds (in `target/www/prod') so they don't get mixed upvendor.dll.js
), and put them in a specific directory: let's keep the one we used before, app
. That will make them easy to cache on the browser.mvn -Pprod package
does a prod package (great!), but running mvn -Pprod
still runs the Angular part in dev mode@jdubois ill check those over the weekend.
Le 24 mai 2017 8:09 AM, "Deepu K Sasidharan" notifications@github.com a écrit :
@jdubois https://github.com/jdubois ill check those over the weekend.
- Lazy loading is good but not a necessity so that can even wait if we are unable to merge it soon.
- Btw why do you want them in separate folders? If we clean the www directory before prod build it works fine. Im doing the same with my prod app and works fine. It also simplifies packaging as we dont have to handle any profile specific stuff. Can you let me know what is the issue you foresee? 3.ill check that probably something minor in config
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/4794#issuecomment-303627128, or mute the thread https://github.com/notifications/unsubscribe-auth/AATVo4QF_jqhB3LZMmvSMxd_qbn_h0FDks5r88mPgaJpZM4LYiFe .
@jhipster/developers I know some of you are testing angular 2+ to get it out of Beta, could you please update the first entry in this thread with issue you find and also tick of items in the list that works.
@jdubois I saw in another thread that you mentioned you found issues could you please put them up here so that I can try to close items. I have some time today and on weekend
@jhipster/developers Also plz put your name beside any issue if you are working on it so that we dont do double work on same items
@deepu105 I added 3 items from my latest tests. I don't have my laptop until Sunday but I'm of course available for help/discussions (anything I can do with m'y mobile phone)
Just following up here, I did not implement this because Alwan looks to have taken it over.
I took this one:
But I think we should not do it because it raises many problems about how to determine whether a URL belongs to server namespace or to client namespace. I implemented it as a servlet filter based on request method and some regexp (see below). Maybe it could be improved if there's a way to get the list or mappings from Spring MVC.
Anyway this implementation looks brittle with our current URI design, conflicts between server and client routes could happen quite easily with customizations of generated code and could be confusing. Things could be even worse for users who setup a context path or who get one by deploying to a server like WebLogic, etc...
We could avoid many of these traps by using a prefix like '/app/' for all client routes but is it a better solution than a '#' ?
@gmarziou yes its tricky. Anyway its not a must for making angular out of BETA so lets take it out from the list for now. We didnt do it for ng1 as well anyway
I have descoped some items as they are not required to get Angular out of BETA
Yes, I'll try to write it as a tip with some words of warning.
This ticket is to track TODO items after the angular2 release as per #4549
Items with - to verify first needs to be checked/tested first to see if already implemented
Angular
./mvnw -Pprod
uses a prod build (and do the same with Gradle) [ SK It is working as intended ]/app
(for the Angular files) and/content
(for the static assets) and validate that there is a hash for all of them (they will get cache headers from the server-side) -[sk] hash applicable only forprod
#5878AlertService
andInterceptableHttp
which have warningsThis will become an error in Angular v5.x
@JulienMrgrdwebpack
General