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

update nextcloud-vue v8 #2861

Merged
merged 1 commit into from
Nov 9, 2024
Merged

Conversation

wofferl
Copy link
Collaborator

@wofferl wofferl commented Nov 7, 2024

Related: #2503

Summary

In preparation for alternative view modes like compact or hopefully the old non-compact mode an update to nextcloud-vue v8 is needed.

This enables the use of different layouts for NcAppContent (vertical-, horizontal- and no-split).

no-split came with nextcloud-vue 8.10.0, hoizontal-split with 8.11.0.

The needed changes were straightforward (nextcloud-libraries/nextcloud-vue#4223).

There are small visible changes:

Light theme v7:
news-light-v7
Light theme v8:
news-light-v8
Dark theme v7:
news-dark-v7
Dark theme v8:
news-dark-v8

Unit test problem (js-test)

The new library causes a problem with the unit-test (jest), which I bypassed with moduleNameMapper in package.json.

The problem seems that the new libraries have a wrapper and use the commonjs (.cjs) or esm (.mjs) version depending the import. The included library from the nextcloud-vue unist-util-visit only uses esm.

Besides the fact that the news app uses esm the jest tool uses commonjs and include the .cjs files, which results in the error SyntaxError: Unexpected token 'export' (see new stub file tests/javascript/helpers/unist-stub.js).

ESM support in jest would be experimental ECMAScript Modules

Maybe @devlinjunker has more insights here and can check if my way to workaround is ok, because I'm not really familiar with the javascript unit tests yet.

Checklist

@wofferl wofferl added dependencies Pull requests that update a dependency file frontend impact Javascript/Frontend code Skip-Changelog No changelog update is required, minor change major labels Nov 7, 2024
@SMillerDev
Copy link
Contributor

Wow, great work!

@devlinjunker
Copy link
Contributor

devlinjunker commented Nov 7, 2024 via email

@@ -146,7 +145,9 @@
"moduleNameMapper": {
"^@/(.*)$": "<rootDir>/src/$1",
"^Components/(.*)$": "<rootDir>/src/components/$1",
"^.+\\.(css|less|svg)$": "<rootDir>/tests/javascript/helpers/CSSStub.js"
"^.+\\.(css|less|svg)$": "<rootDir>/tests/javascript/helpers/CSSStub.js",
"^unist-util-visit$": "<rootDir>/tests/javascript/helpers/unist-stub.js",
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems like the easiest solution to me, good fix!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this seems like the easiest solution to me, good fix!

@devlinjunker thanks for the review

@wofferl wofferl merged commit 8bb4096 into nextcloud:master Nov 9, 2024
24 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file frontend impact Javascript/Frontend code major Skip-Changelog No changelog update is required, minor change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants