Skip to content

Conversation

@juliusknorr
Copy link
Member

@juliusknorr juliusknorr commented Jan 7, 2019

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:

  • firstrunwizard: Load only when needed Move to vue firstrunwizard#106
  • richdocuments: Replace use of OC.addScript
  • files_texteditor: Replace use of OC.addScript

@rullzer
Copy link
Member

rullzer commented Jan 10, 2019

Waiting for #13156 to integrate it into the webpack build.

go go go 🚀

@juliusknorr juliusknorr force-pushed the js-async-loading branch 2 times, most recently from 3298dba to 25e658c Compare January 15, 2019 17:11
@juliusknorr
Copy link
Member Author

juliusknorr commented Jan 15, 2019

@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.

@juliusknorr juliusknorr added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jan 15, 2019
@ChristophWurst
Copy link
Member

@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?

I think that is fine for now. We should be able to refactor that and move code around if necessary :)

@juliusknorr juliusknorr force-pushed the js-async-loading branch 3 times, most recently from 0dbe21f to b40dd20 Compare January 15, 2019 20:15
@rullzer
Copy link
Member

rullzer commented Jan 15, 2019

@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?

I think that is fine for now. We should be able to refactor that and move code around if necessary :)

I agree. Basically the OCP stuff should always be loaded if possible anyway. So makes sense to have this in the dist pack.

@juliusknorr juliusknorr added this to the Nextcloud 16 milestone Jan 15, 2019
@rullzer
Copy link
Member

rullzer commented Jan 16, 2019

So this can go in?

@juliusknorr
Copy link
Member Author

Yes, please review.

Copy link
Member

@rullzer rullzer left a 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

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good!

@ChristophWurst
Copy link
Member

This will give a nice conflict with #13635 🤐

if (msie > 0 || trident > 0) {
cssVars();
cssVars({
watch: true
Copy link
Member

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 ⚰️

Copy link
Member

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 ;)

@MorrisJobke
Copy link
Member

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants