Skip to content

Comments

feat: add support for universal environment#933

Merged
susnux merged 4 commits intomainfrom
feat/universal-environment
Jul 9, 2025
Merged

feat: add support for universal environment#933
susnux merged 4 commits intomainfrom
feat/universal-environment

Conversation

@susnux
Copy link
Contributor

@susnux susnux commented Jun 3, 2025

Allows to use the library in web workers and similar other places.

  • Adjusted window and document usage (globalThis)
  • Add global state handling as there is no document
  • Added tests for also non-DOM environment

Limitations in non DOM environments:

  • Sanitizing of HTML does not work as DOMPurify needs a DOM
  • loadTranslations needs @nextcloud/router to work

@susnux susnux requested a review from ShGKme June 3, 2025 21:11
@susnux susnux added type: enhancement 🚀 New feature or request 3. to review 3️⃣ Waiting for reviews labels Jun 3, 2025
@susnux susnux force-pushed the feat/universal-environment branch from 0bf4cf7 to da333cf Compare June 3, 2025 21:12
@susnux susnux mentioned this pull request Jul 7, 2025
3 tasks
susnux added 3 commits July 8, 2025 16:57
Allows to use this library in web worker, node or as it was the DOM
environment.

Signed-off-by: Ferdinand Thiessen <[email protected]>
@susnux susnux force-pushed the feat/universal-environment branch from 8afd406 to e9941d5 Compare July 8, 2025 15:07
@susnux susnux requested review from skjnldsv and st3iny July 8, 2025 15:08
@susnux susnux force-pushed the feat/universal-environment branch from e9941d5 to d4557e1 Compare July 9, 2025 13:54
@susnux susnux merged commit f94bd9b into main Jul 9, 2025
10 checks passed
@susnux susnux deleted the feat/universal-environment branch July 9, 2025 14:14
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: enhancement 🚀 New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make library independent from server rendering and web-page context

2 participants