Skip to content
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

fix(rtl-demo): fix rtl/lrt demo in docs #663

Merged
merged 5 commits into from
Jun 8, 2017
Merged

Conversation

emoralesb05
Copy link
Contributor

there were issues when navigation between views or when using the td-layout.. state was lost and sidenavs were not working as intended.

Test Steps

  • ng serve
  • Go to docs and go to rtl mode

General Tests for Every PR

  • ng serve --aot still works.
  • npm run lint passes.
  • npm test passes and code coverage is not lower.
  • npm run build still works.
Screenshots or link to CodePen/Plunker/JSfiddle

there were issues when navigation between views or when using the td-layout.. state was lost and sidenavs were not working as intended.
@emoralesb05 emoralesb05 added this to the Beta.5 milestone Jun 7, 2017
@jerryorta-dev
Copy link
Contributor

Refreshing the browser while in rtl mode throws this error:

ERROR TypeError: Cannot read property 'toArray' of undefined
    at MdSidenavContainer._validateDrawers (material.es5.js:11389)
    at material.es5.js:11287
    at SafeSubscriber.schedulerFn [as _next] (core.es5.js:3842)
    at SafeSubscriber.__tryOrUnsub (Subscriber.js:238)
    at SafeSubscriber.next (Subscriber.js:185)
    at Subscriber._next (Subscriber.js:125)
    at Subscriber.next (Subscriber.js:89)
    at EventEmitter.Subject.next (Subject.js:55)
    at EventEmitter.emit (core.es5.js:3816)
    at Dir.set [as dir] (material.es5.js:341)

@jerryorta-dev
Copy link
Contributor

This scenario takes a very long time ( 3s ) to transition views - I thought it was a dead link at first:

  1. Load the browser in the Home View: http://localhost:4200/#/
  2. Select RTL mode.
  3. Navigate to templates - http://localhost:4200/#/templates

@jerryorta-dev
Copy link
Contributor

jerryorta-dev commented Jun 7, 2017

Edit: my bad, went back to the wrong command line instance to test... all good on this

Unit tests pass, but there is a lot of console log output.

ERROR: 'ERROR', TypeError{ngDebugContext: DebugContext_ ...

@emoralesb05
Copy link
Contributor Author

emoralesb05 commented Jun 8, 2017

The 3 seconds thing happens with lazy module loading + JIT, it doesnt really happen in production (AoT).

That being said, found a weird behavior where since /templates is the last route, when trying to access it, it loads all the chunks when it shouldnt, so good find.

… not needed

this still will happen when trying to access any other chunk though.. for some reason they load anything before them.
@emoralesb05
Copy link
Contributor Author

Fixed issue with rtl refresh since its the material sidenav was trying to check its children before it has any. Had to do the change to rtl once everything is safely injected

@jerryorta-dev
Copy link
Contributor

I realized the lazyload issue once I saw the routes.

The site https://teradata.github.io/covalent is production, correct? It's still a little slow on route changes there too.

I have a selective-preload-strategy I can implement if you want to give it a go. It lazy loads immediately, after the first module loads.

@jerryorta-dev
Copy link
Contributor

Since lazyload is not a part of this issue, this is approved.

@emoralesb05
Copy link
Contributor Author

We can discuss that approach offline. 👍

@emoralesb05 emoralesb05 merged commit 7874b5b into develop Jun 8, 2017
@emoralesb05 emoralesb05 deleted the feature/fix-rtl-demo branch June 8, 2017 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants