Skip to content

Conversation

@floryst
Copy link
Contributor

@floryst floryst commented Aug 12, 2021

In reference to #28, we should not bundle @kitware/vtk.js. Additionally, this directly impacts vtkMapper, as setting global/static coincident topology parameters is done at a module level, and bundling vtk.js with react-vtk-js means it's impossible to set global parameters for react-vtk-js.

This will mean all consumers must install @kitware/vtk.js alongside react-vtk-js. Should this be a breaking change, or are we okay having people realize this once npm/yarn complains about missing peer deps?

In reference to Kitware#28, we should not bundle `@kitware/vtk.js`. Additionally, this directly impacts `vtkMapper`, as setting global/static coincident topology parameters is done at a module level, and bundling vtk.js with react-vtk-js means it's impossible to set global parameters for react-vtk-js.

This will mean all consumers must install `@kitware/vtk.js` alongside react-vtk-js. Should this be a breaking change, or are we okay having people realize this once npm/yarn complains about missing peer deps?
@jourdain
Copy link
Collaborator

Hum, I think we need to talk about it... I originally made that lib so it can be standalone with the proper tree-shaking. Also your comment is not fully true as you can get your hand on the vtk.js that is bundled inside the react-vtk-js to set the coincident topology parameters.

@floryst
Copy link
Contributor Author

floryst commented Aug 13, 2021

I'm not sure how to @kitware/vtk.js/Rendering/Core/Mapper through react-vtk-js, unless it's something like react-vtk-js/dist/esm/node_modules/@kitware/vtk.js/.... That's doable, but kind of messy.

@jourdain
Copy link
Collaborator

It is more about getting a ref on GeometryRepresentation.mapper.

@floryst
Copy link
Contributor Author

floryst commented Aug 16, 2021

I'm not sure how a ref on GeometryRepresentation will give me the internally used vtkMapper module. I can see how it will expose the mapper instance, but some of the coincident topology parameters are on the mapper module itself.

@jourdain
Copy link
Collaborator

jourdain commented Aug 16, 2021

Are the static methods on both, the class and instance? If just class, then yes I agree with you.

I mean if we change that behavior, we will need to fix dash-vtk.

@floryst
Copy link
Contributor Author

floryst commented Aug 17, 2021

After some discussion, I think the move forward is to have the ESM build truly use vtk.js as a peer dep (vtk.js as external). The CJS and UMD builds can still bundle vtk.js.

@agirault
Copy link
Contributor

Is this resolved?

@floryst
Copy link
Contributor Author

floryst commented Aug 27, 2021

Nope, not yet. AFAIK it doesn't block anything, but it's a nice-to-have.

@jourdain
Copy link
Collaborator

This should be taking care thanks to #41

@jourdain jourdain closed this Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants