Skip to content

refactor: scope global state to major version of library#1492

Merged
susnux merged 1 commit intomainfrom
feat/scope-globals
Feb 9, 2026
Merged

refactor: scope global state to major version of library#1492
susnux merged 1 commit intomainfrom
feat/scope-globals

Conversation

@susnux
Copy link
Contributor

@susnux susnux commented Feb 9, 2026

Problem

In the past when we did breaking changes on the API we could not ensure that all apps loaded are already migrated and so some of them were still using the old files integrations.
Because the global scope was not versioned those apps registered e.g. invalid actions on the files app causing the files app to break.

Solution

With the changes on this PR we versioning the global state of the files integrations. So we know that the files app will only load integrations that are using the same major version of the library so prevent breaking the whole app.

Note: This is not a breaking change API wise as no exposed API has changed, but any app now needs to use at least this version of the library to properly integrate into the files app.

Problem
-------

In the past when we did breaking changes on the API we could not ensure
that all apps loaded are already migrated and so some of them were still
using the old files integrations.
Because the global scope was not versioned those apps registered e.g.
invalid actions on the files app causing the files app to break.

Solution
--------

With the changes on this PR we versioning the global state of the files
integrations. So we know that the files app will only load integrations
that are using the same major version of the library so prevent breaking
the whole app.

Note: This is not a breaking change API wise as no exposed API has
changed, but any app now needs to use at least this version of the
library to properly integrate into the files app.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux added this to the v4.0.0 milestone Feb 9, 2026
@susnux susnux added type: enhancement 🚀 New feature or request 3. to review 3️⃣ Waiting for reviews type: refactor ♻️ Refactor code (not a bug fix, not a feature just refactoring) labels Feb 9, 2026
@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

❌ Patch coverage is 91.07143% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.93%. Comparing base (b39e111) to head (cc6e894).

Files with missing lines Patch % Lines
lib/sidebar/SidebarAction.ts 0.00% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1492   +/-   ##
=======================================
  Coverage   85.93%   85.93%           
=======================================
  Files          29       30    +1     
  Lines         661      661           
  Branches      193      192    -1     
=======================================
  Hits          568      568           
  Misses         81       81           
  Partials       12       12           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@susnux susnux changed the title feat: scope global state to major version of library refactor: scope global state to major version of library Feb 9, 2026
@susnux susnux removed the type: enhancement 🚀 New feature or request label Feb 9, 2026
@susnux susnux merged commit 2ef1d67 into main Feb 9, 2026
12 checks passed
@susnux susnux deleted the feat/scope-globals branch February 9, 2026 16:23
*
* @internal
*/
export const scopedGlobals = window._nc_files_scope.v4_0 as InternalGlobalScope
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: This is not a breaking change API wise as no exposed API has changed, but any app now needs to use at least this version of the library to properly integrate into the files app.

Could we at least fallback to _nc_files_scope? So that apps on v4.0.0-beta.X are still working

Suggested change
export const scopedGlobals = window._nc_files_scope.v4_0 as InternalGlobalScope
export const scopedGlobals = (window._nc_files_scope.v4_0 ?? window._nc_files_scope) as InternalGlobalScope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review 3️⃣ Waiting for reviews type: refactor ♻️ Refactor code (not a bug fix, not a feature just refactoring)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants