model-viewer icon indicating copy to clipboard operation
model-viewer copied to clipboard

allow three access

Open makc opened this issue 3 years ago • 1 comments

for the case when the page using model-viewer needs three to do some other job, since it is already bundled with model-viewer - it would be a shame to have to download three.js twice.

I see somebody have thought about it before but having official support for this would be nice.

makc avatar Sep 10 '22 21:09 makc

Agreed! I just need to find the proper way to expose it and ensure the bundler doesn't tree-shake anything out. For this reason, I think we'll make a separate bundle for this, like model-viewer-three.min.js.

elalish avatar Sep 12 '22 16:09 elalish

@makc Have you looked at #3948? The proposal is to distribute an additional mv package without three.js at all - then you would pull that in along with three using an import map along with whatever other code you need it for. Does that look like a workable solution for you?

elalish avatar Mar 31 '23 22:03 elalish

@elalish that does sound reasonable, but then would you not have false bug reports in mv if the user imports incompatible three revision?

makc avatar Mar 31 '23 22:03 makc

Yeah, but at least we aren't claiming to validate versions like with npm. I prefer no handrail to a handrail you can't trust. We'll just have to put it in the docs and remind people to post their versions in the issue template.

elalish avatar Mar 31 '23 23:03 elalish

This happened as part of v3.2, try model-viewer-module.min.js, and follow the import map instructions at https://modelviewer.dev/examples/postprocessing/#setup

elalish avatar Nov 09 '23 19:11 elalish