-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Make CKEditor 5 packages valid ESM #13673
Make CKEditor 5 packages valid ESM #13673
Comments
Thanks @pomek . It does seem like that would resolve the problem. It makes sense too. |
Is there any workaround regarding this issue? File: test: {
...
+ deps: {
+ inline: [
+ 'ckeditor5'
+ ]
+ }
} doesn't seem to work. |
Noticed the same, I'm not sure why inlining For now, it's a good workaround if you're not using Collaboration: export default {
test: {
deps: {
inline: [
"ckeditor5",
/ckeditor5/
],
},
},
}; |
Adding With Another problem was caused by webpack requiring file extensions in imports in manual and automated tests. Manual tests can be fixed by updating the return {
test: /\.js$/,
...getDebugLoader( debugFlags ),
+ resolve: {
+ fullySpecified: false,
+ }
}; The same problem can be fixed for automated tests by adding the following objects to {
test: /\.js$/,
type: 'javascript/auto',
},
{
test: /\.js$/,
resolve: {
fullySpecified: false,
}
} Unfortunately, this doesn't solve all problems in automated testing - webpack will throw a bunch of errors that it can't find node-specific modules (e.g. Alternatively, we could rename all tests to For now, the easier way would probably be to add |
@pomek what do you think? |
The errors with node-specific modules might actually be caused by the setup of my local environment. I'll test this further next week, as the steps above may be enough to get it working. |
I prepared two PRs:
TypeScript files don't need file extensions in import paths because we use I'd consider releasing alpha/beta/nightly/whatever so folks using Vite can test it. This will help us make sure we don't break anything for |
Changes in cke5-dev need tests not to break things in the future. |
Done ✔️ |
Other (tests): A file extension is not required when resolving modules within a package marked as `type: module`. See ckeditor/ckeditor5#13673.
…-extensions-in-imports Feature (eslint-plugin-ckeditor5-rules): Added a rule requiring file extensions in imports. See ckeditor/ckeditor5#13673.
…-for-import-file-extensions-2 Docs: Explain the eslint rule requiring file extensions in imports. See #13673.
Fix (tests): Fixed processing of the ESM packages when running automated and manual tests. See ckeditor/ckeditor5#13673. MINOR BREAKING CHANGE (utils): Removed `getJavaScriptWithoutImportExtensions()` loader introduced in #885.
…-extensions-in-exports Other (eslint-plugin-ckeditor5-rules): Improved the `ckeditor5-rules/require-file-extensions-in-imports` to require a file extension in both imports and exports. See ckeditor/ckeditor5#13673.
…es-valid-esm Fix: Make all ckeditor packages valid ES Modules. Related to #13673.
Changes to make our packages valid ESM are merged and will be released in January. Next week I will test our nightly releases in Vite and Vitest. |
The nightly releases seem to be working fine and be a valid ESM package. arethetypeswrong.github.io:Before: publint.dev:Before: |
Together with @kubaklatt, we've finished testing the I've also run CKE5 E2E tests using |
📝 Provide a description of the improvement
To use CKEditor 5 sources in Node without processing it by any bundler, we can mark our packages as
type:module
inpackage.json
.Originally posted by @Inviz in #11704 (comment)
As it is unrelated to TypeScript migration (our sources were modules before migration), I extracted the discussion to another issue.
If you'd like to see this improvement implemented, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: