-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Plain javascript api to asynchronously load javascript or css files #13407
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
Conversation
go go go 🚀 |
3298dba to
25e658c
Compare
|
@ChristophWurst @skjnldsv I have moved the loader to the webpack build in core/ and made it extend the existing window.OCP object. Should we have this as a separate entrypoint and chunk or keep it in the one bundle for now? Besides that, it is ready for review. |
I think that is fine for now. We should be able to refactor that and move code around if necessary :) |
0dbe21f to
b40dd20
Compare
I agree. Basically the OCP stuff should always be loaded if possible anyway. So makes sense to have this in the dist pack. |
b40dd20 to
6cbd09f
Compare
|
So this can go in? |
|
Yes, please review. |
rullzer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me and will make lazy loading much better :D
ChristophWurst
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good!
|
This will give a nice conflict with #13635 🤐 |
| if (msie > 0 || trident > 0) { | ||
| cssVars(); | ||
| cssVars({ | ||
| watch: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
poor browser will die of exhaustion ⚰️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pff so be it ;) No need to keep everybody stuck with crappy old stuff just ebcause of IE ;)
|
Please rebase and rebuild to resolve the conflict. |
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
6cbd09f to
64b5c0c
Compare
This PR adds a javascript only public API to replace OC.addScript and OC.addStyle (which require jquery) to dynamically load js and css files after the initial loading.
Waiting for #13156 to integrate it into the webpack build.
Uses: