-
Notifications
You must be signed in to change notification settings - Fork 285
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
feat(structuredClone): drop lodash.clonedeep in favor of structuredClone #517
feat(structuredClone): drop lodash.clonedeep in favor of structuredClone #517
Conversation
✅ Deploy Preview for cornerstone-3d-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Although the builds and tests passed locally, the tests here failed. From the logs I see there is one of the errors:
I double checked the MDN docs for structuredClone() and by looking at supported types it seems that HTML and SVG elements are not present. A quick test in the a JS console confirmed that: I'm leaving the draft PR open in case if anyone wants to investigate different solutions to these cases. |
…into feature/migrate-to-structuredClone
@StefanNedelchev - could you add the transfer option with a reference to the SVG object contained in it? I believe that should allow removing the SVG object from the old spot and creating it in the new spot. |
…into feature/migrate-to-structuredClone
|
…into feature/migrate-to-structuredClone
@@ -37,7 +37,7 @@ | |||
"packages/**/dist", | |||
"packages/**/lib", | |||
"packages/**/lib-esm", | |||
"packages/adapters", | |||
"packages/adapters/**/*.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to do this because of a new error that started appearing after the latest sync with main:
Parsing error: ESLint was configured to run on `<tsconfigRootDir>/packages/adapters/src/adapters/Cornerstone3D/EllipticalROI.ts` using `parserOptions.project`: <tsconfigRootDir>/tsconfig.json
@wayfarer3130 check the solution I did with the structuredClone in the sate store. Passing the svg elements to the transferable items didn't work (it wasn't even accepted because it's for binary objects) so I had to use this funky solution of excluding the element when passing it to the |
…into feature/migrate-to-structuredClone
@sedghi sorry for leaving this PR behind. I took some time to sync it with the latest cornerstone 3d and remove some leftovers of lodash.cloneDeep. The CI seems successful now but I have to point out that for some reason I had to add 2 rules in the ESLint ignore configuration due to questionable lint errors ("ESLint was configured to run ... However, that TSConfig does not include this file") when trying to commit. |
…/StefanNedelchev/feature/migrate-to-structuredClone
* chore(beta): release beta for v2 * chore(beta): release beta for v2 (#715) * chore(beta): release beta for v2 again (#716) * chore(version): version.json [skip ci] * chore(version): Update package versions [skip ci] * fix(camera initial zoom): make the image fit the canvas for initial reset * fix: Render to pixel exact positioning, and add a zoom setting * api-check * PR updates - mostly docs and some cleanup * fix: Offset positions sometimes render moire patterns * fix: Fractional positioning for center point * Fix the center offset * PR review comments * API check * chore(version): version.json [skip ci] * chore(version): Update package versions [skip ci] * chore(version): version.json [skip ci] * chore(version): Update package versions [skip ci] * feat(structuredClone): drop lodash.clonedeep in favor of structuredClone (#517) * drop lodash.clonedeep in favor of structuredClone * copy svgNodeCache outside structured clone when resetting state * remove clonedeep leftovers * api --------- * chore(version): version.json [skip ci] * chore(version): Update package versions [skip ci] * api * new stack images * Revert changes * Add synchronizer and test configuration for scale * Fix positioning * fix zoom * Fix pan for scale to fit * Fixes for resize * Changes to make tests pass again * Fix scale display * Fixes for resize viewport * Fix centering/positioning without needing initial camera setting * Fix resize issues with rotation * Cleanup for build * Add todo for fuzzy fit to viewport scaling issue * Cleanup of types/values * fix: render annotations without plane normal on viewports and update default svg colors (#1159) * chore(version): version.json [skip ci] * chore(version): Update package versions [skip ci] * fix(cine): playclip to allow loop config (#1163) * chore(version): version.json [skip ci] * chore(version): Update package versions [skip ci] * fix(DicomImageLoader): Returns options.loader (#1154) * chore(version): version.json [skip ci] * chore(version): Update package versions [skip ci] * docs: Update getAnnotation Api (#1169) annotations' S word should be removed and getAnnotations method parameters are written in reverse order * chore(version): version.json [skip ci] * chore(version): Update package versions [skip ci] * examples: Add better helper method for adding tools dropdown (#1150) * test: Add better helper method for adding tools dropdown. * Add stack annotation example * Add labelmap tools as well * Add contour tools import as well. * PR review comment fixes * api-check * chore(version): version.json [skip ci] * chore(version): Update package versions [skip ci] * Make the size work for positioning * Fix ES6 change * update * Add color utility module to core package * Add color utility module to core package * revert structured clone * Fix cloning of lastSliceAnnotation in ContourInterpolation_test.js * Fix lodash import in addSegmentations.ts * PR comments
…one (#517) * drop lodash.clonedeep in favor of structuredClone * copy svgNodeCache outside structured clone when resetting state * remove clonedeep leftovers * api ---------
Resolves #503
Notes:
@types/node
had to be updated to v18 because the minimal version of the type definitions that supportstructuredClone
is 17.typescript
had to be updated as well to a version that supportsstructuredClone
lib
option in tsconfig was set toES2021
instead ofES2022
because withES2022
I'm getting errors duringbuild:update-api
(any help with that is welcome)Settings.ts
had to be done due to TypeScript error after updating to the newer versioncreateLabelmapVolumeForViewport.ts
had to be done because the use ofstructuredClone
type checks the input (unlike lodash.clonedeep)