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

Enhance JS require mechanism #5253

Open
sukhwinder33445 opened this issue Sep 2, 2024 · 0 comments
Open

Enhance JS require mechanism #5253

sukhwinder33445 opened this issue Sep 2, 2024 · 0 comments

Comments

@sukhwinder33445
Copy link
Contributor

sukhwinder33445 commented Sep 2, 2024

The method of the PHP class Javascript.php#optimizeDefine() manipulates the JS calls of define.js#define() to insert the full path of the script.

When implementing billboard.js, I came across the limitations of this mechanism. The regex pattern return false positives. Billboard.js (non-minified file) contains some function definitions named define(...). This mechanism also manipulates these function definitions, which leads to JS errors when trying to create charts.

Changing the regex pattern of Javascript::DEFINE_RE constant in such a way that it covers all possible call patterns is not the solution.

After discussion with @nilmerg, we have decided to create an issue so it can be improved at a later date.

To reproduce:

  1. With Introduce chart library billboard.js ipl-web#230, try to render billboard charts with _dev parameter in the url.
  2. Have a look at the browser console.

Billboard charts can be created with the reporting module by adding a report of the type ‘Host/Service Sla Chart’.

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

No branches or pull requests

1 participant