Skip to content
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

Add priority for JavaScript plugins #39359

Merged
merged 1 commit into from
Oct 18, 2021
Merged

Add priority for JavaScript plugins #39359

merged 1 commit into from
Oct 18, 2021

Conversation

JammingBen
Copy link
Contributor

@JammingBen JammingBen commented Oct 15, 2021

Description

JavaScript plugins can now be registered with a specific priority. A higher priority means the plugin will be attached/detached before others.

I noticed this because core registers a plugin for OC.Share.ShareDialogView as well as the files_spaces app. These two conflict with each other because the core plugin needs to be registered first.

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

@JammingBen JammingBen self-assigned this Oct 15, 2021
@owncloud owncloud deleted a comment from ownclouders Oct 15, 2021
@sonarcloud
Copy link

sonarcloud bot commented Oct 15, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

64.3% 64.3% Coverage
0.0% 0.0% Duplication

@AlexAndBear
Copy link

AlexAndBear commented Oct 15, 2021

Nice.
Another possible solution, would be that we enforce core plugins to get loaded first anyways,
I mean we may trap in a lot of problems if the core JS files are not loaded first properly.

What do you think @JammingBen?

@JammingBen
Copy link
Contributor Author

I'd vote for keeping it configurable, just like we do it with storage wrappers. Maybe you want your app to be registered after core. Also I don't see nice a way to determine if a plugin comes from core or from an external app.

@mmattel
Copy link
Contributor

mmattel commented Oct 17, 2021

Should'nt this also be added to the developer docs? @phil-davis fyi

@JammingBen
Copy link
Contributor Author

@mmattel See docs issue: owncloud/docs#4149

@JammingBen JammingBen merged commit b0c8d79 into master Oct 18, 2021
@delete-merged-branch delete-merged-branch bot deleted the js-plugin-prio branch October 18, 2021 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants