Solveduniversal List browser global that we need to support in Universal

The next version of Universal can support/mock any browser global so please list out any of the that are the most important ones for me to make sure you can use it.

It's worth noting there is a best practice way of dealing with 3rd party services that should be considered before falling back to these supported globals

Browser

  • document
  • document.querySelector
  • document.querySelectorAll
  • document.cookie
  • XMLHttpRequest
  • fetch
  • localStorage
  • navigator
  • history
  • location
  • navigator
  • localStorage
  • sessionStorage
  • window (please list out which properties you're using on window and how you use it)
  • window.pageYOffset
  • window.pageXOffset
  • window.scrollTo
  • window.addEventListener
  • {{ list_your_global }}

Common Libs (with globals)

  • jQuery
  • {{ list_your_global }}

Research (we need to determine if possible)

  • Polymer
  • Foundation
  • d3
  • videojs
  • angularfire2
  • firebase
  • @angular2-material

Supported (so far)

  • {{ }}

Twitter Poll
https://twitter.com/gdi2290/status/776893828045246466

The reason for this is to allow faster adoption of Universal JavaScript with components that the developer may or may not have control over

Please leave a comment of a browser global that you use (if window make sure to include some of the properties or functions used) and what you're using it for to make it in the next release

update:
added research list
added polymer

38 Answers

✔️Accepted Answer

Also Angular 2 Material

Other Answers:

Supporting window would change the game for me

-localstorage
-location
-scroll
-onload

I just find a workaround to avoid if (typeof window === 'undefined') { return; } in every case when dom is used directly. just use jsdom-global package as require('jsdom-global')(); in in the main module or somewhere. no need to worry about workarounds anymore.

3rd party:

Related Issues:

42
universal update to rc5/rc6/rc7
@gdi2290: Any estimate on when @angular/universal will be published? rc6/rc7 update create NodeDomEv...
11
universal List browser global that we need to support in Universal
Also Angular 2 Material The next version of Universal can support/mock any browser global so please ...