GoelBiju / Visualising-Optimisation-Data

COMP3000 Final Year Project - Visualising Optimisation Data
0 stars 0 forks source link

Load external libraries via CDNs in plugins #71

Open GoelBiju opened 2 years ago

GoelBiju commented 2 years ago

Description:

It seems any libraries we use via CDN defined in the public/index.html in plugins do not load. Instead, it has to be placed on the front-end in order for it to load. The libraries that a plugin uses need to be able to be used as packages or loaded from CDN in the plugin.

This is not an exact bug since the "index.html" in each plugin is for it to run independently of the frontend in development i.e. this is why we have separate React CDN links in there. However, for libraries like Plotly where the example we are using require a CDN, we may need to use another method to fetch the library.

GoelBiju commented 2 years ago

Description:

It seems any libraries we use via CDN defined in the public/index.html in plugins do not load. Instead, it has to be placed on the front-end in order for it to load. The libraries that a plugin uses need to be able to be used as packages or loaded from CDN in the plugin.

This is not an exact bug since the "index.html" in each plugin is for it to run independently of the frontend in development i.e. this is why we have separate React CDN links in there. However, for libraries like Plotly where the example we are using require a CDN, we may need to use another method to fetch the library.

Since the example for Plotly is unique we would generally assume all the relevant plugins are packaged with webpack but instead we want to make use of a CDN should we provide a configuration with links which is injected into the frontend? Or could we use Externals (possibly very similar to this question?