-
Notifications
You must be signed in to change notification settings - Fork 482
universal has too many restrictions #490
Comments
The larger problem is that as you know jQuery manipulates the DOM, also window and document don't exist on the server-side. It's something we would surely love Universal to at least be able to ignore (since / if it can't handle it) but it's a big problem in all server side rendering solutions still. So it's definitely not an easy task unfortunately. Just wondering, why are you using jQuery at the moment? Maybe it's possible to at least start removing those aspects for now? (You'll be happier in the long run that you did) |
In the future I can probably provide a better experience for this at a cost of performance by creating a proxy for these globals. I understand that jQuery is used by 30% of devs so it's important to provide something that works. I have a few ideas but it needs design and a prototype. We can probably provide a solution faster using jsdom rather than parse5 at a huge cost of performance but devs can use it as a prerendering option |
(I'm a total noob so this is by no means to be taken as a viable clue on how to move forward) I haven't quite figured out how universal renders components server-side (at least in .net core) so I'm not sure it is possible, but is there a way to like... build a string on the server-side containing any javascript you want executed on the client, and pass it to the client through a component attribute, and have that component render itself with a script tag containing the string, so it executes? or use eval or whatever that command is to exec a js string? |
I have a new design that would make it very easy to jump in and still support jQuery |
closing for #512 please follow that issue |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Note: for support questions, please use one of these channels: https://github.com/angular/universal/blob/master/CONTRIBUTING.md#question. This repository's issues are reserved for feature requests and bug reports.
feature
Using universal has too many restrictions. At first, I decided to use Universal because of disapproval of adsense since adsense doesn't approve apps which uses ajax loading.
So I immediately dived into universal. But it comes out universal has too many restrictions to be applied my app.
My application uses jQuery things and Pusher (https://pusher.com/). ok. jquery definitely manipulate DOM directly. let's do not talk about this.
But Pusher, even it doesn't manipulate DOM but only does window.addEventListener things and universal doesn't allow it so I can't use this either.
Since Universal inject(or copy) every app.component and relative sources to server codes, there no way to render my app in serverside without not using Pusher of jQuery things. (and I can't use it in node because node has no document or window)
there're some scripts touch document or window object, but It never affects to 'VIEW'.
So, if there's a kind of 'exclusive' items, and universal doesn't copy that code to server code, it will be good.
My app never works with universal :(
The text was updated successfully, but these errors were encountered: