Skip to content
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

Add configuration to replace dependencies through jsdelivr #494

Open
raffaeldp opened this issue Sep 9, 2024 · 1 comment · May be fixed by #495
Open

Add configuration to replace dependencies through jsdelivr #494

raffaeldp opened this issue Sep 9, 2024 · 1 comment · May be fixed by #495
Labels

Comments

@raffaeldp
Copy link

Hello,
I am currently using the Online3DViewer library to implement a 3D file viewer on a web project.
This file viewer should be working with as many 3D file format as possible. That's why I choose this library because it is the best I found and it is working very smoothly.

However, I'm running trough some issues with two functions in importerutils.js :
CreateOcctWorker and LoadExternalLibrary.

Theses two functions are importing some libraries via the jsdelivr CDN.

However, this is an issue for my app, because we need to have the hand on all the dependencies, and can't put them in an outsourced CDN, as it is blocked by security policies.

I have read in an other issue that this choice has been made because serving the whole occt / rhino3dm / draco_decoder libs was too expensive, and I totally understand that. But it would be really nice to have some sort of configuration for that, maybe the same way as it is done with the SetExternalLibLocation, but for theses dependencies too.

Is there already a way to do that ?

If not, can we discuss of a way to implement such a thing ?
If you don't have time to implement it yourself I can totally do it and propose a new Pull Request for that.

I have tried to monkeypatch the functions directly in my codebase but without great success. Last solution I will have is fork the project and change it directly inside, but I prefer trying to contribute to the main lib directly, if possible.

Thank you for reading 🤠

@raffaeldp raffaeldp changed the title Dependencies through jsdelivr issue Add configuration to replace dependencies through jsdeliv Sep 9, 2024
@raffaeldp raffaeldp changed the title Add configuration to replace dependencies through jsdeliv Add configuration to replace dependencies through jsdelivr Sep 9, 2024
@raffaeldp raffaeldp linked a pull request Sep 9, 2024 that will close this issue
@raffaeldp
Copy link
Author

I have provided a first implementation that work for me in this pull request #495

By default, it will use the libs provided in the externalLibLocation.
If we set the shouldLoadExternalLibsFromCdn to true, it will take them from cdn.

Do not hesitate to tell me if you can see an issue, or a better implementation. Ty 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant