[BUG] How to replace CDN urls from components' json files?
See original GitHub issueEnvironment
Please provide as many details as you can:
- Hosting type
- [] Form.io
- Local deployment, own backend
- Formio.js version: 4.12.6
- Frontend framework: React
- Browser: Google Chrome
- Browser version: Version 88.0.4324.150 (Official Build) (64-bit)
Issue details
We have recently been struggling to make FormIO (mostly FormBuilder) not using libraries loaded from external CDNs. Our environment allows only fetching files from localhost because of security policy. For some parts we managed applying solution from this item: https://github.com/formio/formio.js/issues/1649
This works fine for all libraries that are loaded using Formio.requireLibrary
function.
However, it turns out that there are some external files hard-coded in JSON files. Examples:
- https://cdn.ckeditor.com/4.14.1/standard/ckeditor.js
- https://cdn.form.io/quill/quill-table.js
- https://cdn.form.io/timezones.json
You can find these links inside files located in formio.js\src\components.
For example the link https://cdn.form.io/timezones.json
is placed directly in JSON definition in DateTime.edit.display.js
. When using this DateTime component and expanding time zones list, the timezones.json
file is fetched from cdn.form.io
.
Is there any way to make these files loaded from localhost instead of using CDN?
If not I guess it’s a bug, and it should be possible like with other libraries loaded using Formio.requireLibrary
.
Thanks foryour help.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (6 by maintainers)
Top GitHub Comments
It’s a pity that Formio is so nailed down. Even if you find the right place in code its very hard to change certain things like the layout of editor modal or removing the cdn urls.
We are working on changes for the renderer to lazy load these libraries only as needed, and I am taking your feedback for consideration on our roadmap for how this is implemented to ease adoptability and implementation of any changes needed. I appreciate the feedback.