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

Use NcRichText component from @nextcloud/vue #8904

Merged
merged 4 commits into from
Mar 6, 2023

Conversation

julien-nc
Copy link
Member

🎉 Circular dependency is definitely going down with the next @nextcloud/vue release which will include NcRichText and everything needed for the link picker and the reference widgets.

refs nextcloud-libraries/nextcloud-vue#3841 nextcloud-libraries/nextcloud-vue#3812

I'll update @nextcloud/vue and set this to "ready for review" once the new release is out.

@julien-nc julien-nc added this to the 🚀 Next Beta (26) milestone Mar 1, 2023
@julien-nc julien-nc changed the title Use RichText component from @nextcloud/vue Use NcRichText component from @nextcloud/vue Mar 1, 2023
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
@julien-nc julien-nc force-pushed the enh/noid/use-richtext-from-ncvue branch from 83ea3bf to 2367864 Compare March 2, 2023 12:43
@julien-nc julien-nc marked this pull request as ready for review March 2, 2023 12:44
@julien-nc
Copy link
Member Author

Ready IMO.

@nickvergessen
Copy link
Member

Jest is fully red?

@julien-nc
Copy link
Member Author

Here is the problem.

Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

    Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

    By default "node_modules" folder is ignored by transformers.

    Here's what you can do:
     • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
     • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

@juliushaertl @raimund-schluessler Any hint on why? Would it make sense to ignore some stuff with transformIgnorePatterns like suggested by jest?

@raimund-schluessler
Copy link
Member

@juliushaertl @raimund-schluessler Any hint on why? Would it make sense to ignore some stuff with transformIgnorePatterns like suggested by jest?

Well, by default jest ignores all packages in node_modules and does not transform them. So the transformIgnorePatterns works in the opposite way than one would expect. Setting

		"transformIgnorePatterns": [
			"/node_modules/(?!(.*)/)"
		],

as we do for nextcloud/vue at the moment will lead to everything in node_modules being transformed, which will likely make your tests run and pass, but will increase the runtime by a lot, so not sure you want this.

To be honest, I wonder why this didn't happen with the standalone package nextcloud/vue-richtext as it brought the same dependencies 🤔

@raimund-schluessler
Copy link
Member

To be honest, I wonder why this didn't happen with the standalone package nextcloud/vue-richtext as it brought the same dependencies 🤔

Judging from all the changes in package-lock.json it might have made a difference that for example these packages (which now need to be transformed)
https://github.com/nextcloud/vue-richtext/blob/56cb3f32a70a60e526154f06bfe197ce1463e2db/package.json#L70-L75
were in the devDependencies section, and might not even be installed when installing nextcloud/vue-richtext. But I wonder how that worked anyhow, since the dependencies are required e.g. here
https://github.com/nextcloud/vue-richtext/blob/56cb3f32a70a60e526154f06bfe197ce1463e2db/src/RichText.vue#L27-L31

@nickvergessen
Copy link
Member

But I wonder how that worked anyhow, since the dependencies are required e.g. here

the package was excluded:

'@nextcloud/vue-richtext',

And mainly for that very same reason.

Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
@raimund-schluessler
Copy link
Member

So I adjusted the list of packages to transform for jest in 5593202. It is quite extensive, and might change with a minor update of nextcloud/vue, but it works for now and doesn't require to transform all packages.

Copy link
Contributor

@Antreesy Antreesy left a comment

Choose a reason for hiding this comment

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

@julien-nc julien-nc merged commit 9cf318d into master Mar 6, 2023
@julien-nc julien-nc deleted the enh/noid/use-richtext-from-ncvue branch March 6, 2023 10:42
@julien-nc
Copy link
Member Author

@raimund-schluessler @Antreesy Thanks! 💙

@julien-nc
Copy link
Member Author

/backport to stable26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants