-
-
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
Speed up the CKEditor 5 development environment #13643
Comments
That won't speed up anything (at least not significantly) if it's still a single thread. Running two Chrome instances may also be prone to these focus issues unless the headless Chrome can take care of detaching focus/selection from the OS in which it operates. |
48 minutes for automated tests and 25 minutes for other validation tasks. This indicates that we should indeed focus now on optimizing how automated tests are executed. Here, the main thing to blame is that every package tests are run completely separately. The reason for this is that we wanted to have separate coverage for each of them. But this means that testing every package start everything from scratch – build everything (transpile TS, run webpack, instrument coverage), start the env (Karma, Chrome), finally: execute the tests. It'd be great to know which part of that process take how much time. Whether this is the building or execution step (starting the env is most likely fairly cheap). So, the imporant question to answer: What's percentage cost of the build and execution steps for a typical package? If building is costly: Look for options to speed this up. We saw already how e.g. using Vite can help. Any progress here would also benefit our dev environment, so it'd be awesome to have meaningful improvements here, even if the build step is <40% of total time. Some ideas:
If the execution of tests is the major problem, then we have fewer options, unfortunately.
|
I agree that using promises will not help us much, but will probably increase the complexity of our tools. In the current state of the JavaScript ecosystem, we have to run TypeScript ( I did some quick tests with promising results, but it (obviously) requires much more research. I ran the
Then I replaced the
Then I did the same with With this configuration, the In my experience, if we went even further and replaced What we can probably do in a reasonable amount of time is to prebuild all the TypeScript code before running the tests, so that Webpack doesn't have to handle it. There are some improvements we can make in this area as well. I ran
Another small win might be the caching of yarn dependencies. |
Thanks @filipsobol for the detailed research. I am fine with replacing |
swc-loader seems to be quite problematic, as it causes many failed tests and coverage issues. esbuild-loader caused less problems, as there are only minor gaps in code coverage, but the tests pass. Additionally, it is stricter than We need to find a solution to the broken coverage with the |
Some progress was achieved with esbuild-loader and CI is green now.
To fix those errors I used 4 new
There are 2 PRs to merge: |
Internal: Added the `-- @preserve` annotation to code coverage instructions to preserve these comments while processing the code using `esbuild-loader`. See #13643. Tests: Write a few additional tests to keep the 100% code coverage to enable migration to `esbuild-loader`.
Feature (utils): Exports a new object called `loaders` containing several methods for configuring webpack. Available helpers present as follow: * `getTypeScriptLoader()` – returns a configuration for processing TypeScript files using esbuild, * `getJavaScriptLoader()` – returns a configuration for enabling `CK_DEBUG` flags in JavaScript files, * `getStylesLoader()` – returns a configuration for processing CSS files using PostCSS, * `getIconsLoader()` – returns a configuration for loading SVG icons using `raw-loader`, * `getFormattedTextLoader()` – returns a configuration for loading rich text files using `raw-loader`, * `getCoverageLoader()` – returns a configuration that installs instruments for measuring the code coverage. Other (tests): Use loader helpers exported by the `@ckeditor/ckeditor5-dev-utils` package to create webpack configurations for automated and manual tests. Other (tests): The `source-map` option is enabled by default due to converting TypeScript into JavaScript. MAJOR BREAKING CHANGE (tests): Replaced `ts-loader` with `esbuild-loader` in manual and automated tests to improve the build time. See ckeditor/ckeditor5#13643.
Other: Switched from `ts-loader` to `esbuild-loader` when processing the TypeScript sources. It significantly reduces the build time when processing automated and manual tests or preparing snippets in the documentation. Closes #13643.
📝 Provide a description of the improvement
Why
What / ideas
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: