Skip to content

refactor(comments): migrate to Vue 3#58353

Draft
edward-ly wants to merge 3 commits intomasterfrom
refactor/55428/comments
Draft

refactor(comments): migrate to Vue 3#58353
edward-ly wants to merge 3 commits intomasterfrom
refactor/55428/comments

Conversation

@edward-ly
Copy link
Contributor

Summary

TODO

Currently, npm run dev/build fails with this error. I suspect it has something to do with the CommentInstance class requiring a Vue 2 options object which I'm not yet sure how to cleanly migrate to Vue 3.

error during build:
[vite:css-post] object null is not iterable (cannot read property Symbol(Symbol.iterator))
    at assetFileNames (file:///home/edward/projects/nextcloud/nextcloud-docker-dev/workspace/server/node_modules/.vite-temp/vite.config.ts.timestamp-1771208851828-a019a06c76d568.mjs:95:33)
    at Object.assetFileNames (file:///home/edward/projects/nextcloud/nextcloud-docker-dev/workspace/server/node_modules/@nextcloud/vite-config/dist/plugins/CSSEntryPoints.js:28:65)
    at generateAssetFileName (file:///home/edward/projects/nextcloud/nextcloud-docker-dev/workspace/server/node_modules/rollup/dist/es/shared/node-entry.js:21662:25)
    at FileEmitter.finalizeAdditionalAsset (file:///home/edward/projects/nextcloud/nextcloud-docker-dev/workspace/server/node_modules/rollup/dist/es/shared/node-entry.js:21955:28)
    at FileEmitter.emitAssetWithReferenceId (file:///home/edward/projects/nextcloud/nextcloud-docker-dev/workspace/server/node_modules/rollup/dist/es/shared/node-entry.js:21899:18)
    at FileEmitter.emitAsset (file:///home/edward/projects/nextcloud/nextcloud-docker-dev/workspace/server/node_modules/rollup/dist/es/shared/node-entry.js:21884:18)
    at FileEmitter.emitFile (file:///home/edward/projects/nextcloud/nextcloud-docker-dev/workspace/server/node_modules/rollup/dist/es/shared/node-entry.js:21745:25)
    at Object.renderChunk (file:///home/edward/projects/nextcloud/nextcloud-docker-dev/workspace/server/node_modules/vite/dist/node/chunks/config.js:29806:32)
    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
    at async transformChunk (file:///home/edward/projects/nextcloud/nextcloud-docker-dev/workspace/server/node_modules/rollup/dist/es/shared/node-entry.js:20311:16)

Checklist

@edward-ly edward-ly added this to the Nextcloud 34 milestone Feb 16, 2026
@edward-ly edward-ly added 3. to review Waiting for reviews feature: comments technical debt javascript ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) labels Feb 16, 2026
package.json Outdated
"pinia": "^3.0.4",
"sortablejs": "^1.15.7",
"vue": "^3.5.27",
"vue-web-component-wrapper": "^1.7.7",
Copy link
Contributor

Choose a reason for hiding this comment

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

Not needed anymore with Vue 3, Vue now has the native defineCustomElement method.

Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

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

thank you for taking care of this :)

$this->initialState->provideInitialState('activityEnabled', $this->appManager->isEnabledForUser('activity'));
// Add comments sidebar tab script
// Add comments sidebar tab script/style
Util::addStyle(Application::APP_ID, 'comments-tab', 'files');
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Util::addStyle(Application::APP_ID, 'comments-tab', 'files');
Util::addStyle(Application::APP_ID, 'comments-tab');

styles do not have an order like scripts :)

Vue.use(PiniaVuePlugin)
import logger from '../logger.ts'

__webpack_nonce__ = getCSPNonce()
Copy link
Contributor

Choose a reason for hiding this comment

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

Not needed with vite anymore

@susnux
Copy link
Contributor

susnux commented Feb 22, 2026

Currently, npm run dev/build fails with this error.

Fix for this: #58505

@susnux susnux force-pushed the refactor/55428/comments branch 2 times, most recently from a3c227e to 560576f Compare February 23, 2026 09:28
@susnux
Copy link
Contributor

susnux commented Feb 23, 2026

^ rebased to see if #58505 fixed it.

Signed-off-by: Edward Ly <contact@edward.ly>
Signed-off-by: Edward Ly <contact@edward.ly>
@edward-ly edward-ly force-pushed the refactor/55428/comments branch from 560576f to 80613d8 Compare February 25, 2026 07:19
@edward-ly
Copy link
Contributor Author

Currently, npm run dev/build fails with this error.

Fix for this: #58505

It looks like that did the trick. All suggestions so far have now been applied as well.

Although, I am currently seeing this in the comments tab, and I'm not sure how to fix it. I'm guessing it has something to do with the fact the NcRichContenteditable component is dynamically loaded.

Screenshot 2026-02-24 at 23-18-38 Media - All files - Nextcloud

Signed-off-by: Edward Ly <contact@edward.ly>
@edward-ly edward-ly force-pushed the refactor/55428/comments branch from 80613d8 to 5ffc49b Compare February 25, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews feature: comments javascript ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) technical debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants