-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Monkey-patching window instead of giving a full new instance #4
Conversation
Thanks! But i can't accept this PR for few reasons:
Can you change it to modifying only |
@nolimits4web To answer your questions and issues in order:
I can definitely change the PR to only change the few parts but I cannot even test nor build the project and I'm afraid I might break something. Ping me back as soon as you can. Thanks |
Ok, can you then just keep changes in |
You're a life saver! I will do it right now. |
@nolimits4web do you want me to leave the |
Yes, keep it, I’ll tweak it if needed |
@nolimits4web right now it builds in the |
@rgolea i just released sir-window 2.x beta, can you try if it works for you:
|
@nolimits4web I'll try it this weekend. Thank you sooo much! |
Hi there!
I see that this project is a dependency of swiper.js and I had an issue with Ionic because of swiper.js and angular universal. You can check the full issue right here: #21138.
It seems like somewhere along the lines,
window
is defined for SSR and swiper depends on this repo to get the screen size. Since there might already be a partially injected window, I thought that the best course of action is, instead of using one or the other, it should be monkey-patching the values so any other values can be added to another partial window interface.I also had to switch to webpack/typescript. Had some issues with the version of gulp that it was used here. This gives also some benefits of having type safety when using the library.
Hope it helps and if this is not the way to fix the issue, please help me into pointing me in the right direction. Thank you!