Closed filipsobol closed 4 months ago
Failing tests are related to our migration from Enzyme to React Testing Library. They will be fixed in other PR and merged into this branch.
Totals | |
---|---|
Change from base Build f69e3b88-1a21-4a49-b767-e752203d3308: | 0.0% |
Covered Lines: | 539 |
Relevant Lines: | 539 |
@filipsobol @pomek That's a very nice cleanup of the repo and I like that you managed to get rid of demos
directories. Please have a look at the minor comments that I left and this should be ready to merge :)
Why are we removing all the demos? Are we sure they didn't serve some purpose?
At least one of them is frequently visited.
@Reinmar demos are still there
@Reinmar demos are still there
Where?
:point_up: this was a an honest question, but I realized that since you asked they are probably somewhere...
I would never think to look for them in src/demos/
:open_mouth: And I don't get the purpose of ./index.html
. Who and how is supposed to open that file in the browser? Is this a common pattern among React libraries?
@Reinmar I get your point. Yep, src/
placement might be misleading. It's not the biggest problem. I'm sure that there will be accidential imports between manuał/ and production code which we don't want for sure.
I talked about this with @filipsobol too.
We also saw the need to update https://github.com/ckeditor/ckeditor5-react/tree/master?tab=readme-ov-file#contributing
TODO: Check Vite target
I addresses all comments and suggestions. The demos were moved from /src/demos/*
to /demos/*
so they are more visible.
fyi, I discovered one issue related to incorrect detection of Context in useMultiRootEditor
hook. Long story short - our enzyme tests were not testing context forwarding at all, and it was possible to use the wrong context while having the test suite succeed. That was introduced in React 19 integration fixes, and it was not released. It's not a huge issue, and it was much easier to do that in the scope of this PR due to lack of proper enzyme testing. I added proper RTL testing.
I can see that you changed the convention of file names in tests. Why did you make that change? Did you document this decision in any logbook?
This is an easy way to find the files with tests and ignore test utils - 'tests/**/*.test.[j|t]sx'
. If you don't like these changes, I can revert them and just add a proper exclude
in Vitest config.
As discussed, I added the UMD build for better backward compatibility, following the configuration recommendations from the Vite documentation: https://vitejs.dev/guide/build#library-mode.
Suggested merge commit message (convention)
Internal: Migrate from webpack and Karma to Vite and Vitest. See ckeditor/ckeditor5#16616.
Internal: Fix test coverage which only covered a small portion of the codebase.
MINOR BREAKING CHANGE: Migrate to ESM. Related to ckeditor/ckeditor5#16616.
Additional information
For example – encountered issues, assumptions you had to make, other affected tickets, etc.