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

Fix chart.js plugins imported as defaults not loading #2369

Merged
merged 4 commits into from
Jun 27, 2022

Conversation

MadsBuchmann
Copy link
Contributor

Which issue does this PR close?

This PR closes no issue

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Are there any additional context?

In DRB the chart.js plugins that are imported as defaults are not loaded.

When the CHART_PLUGINS array is printed it reveals that the plugins are wrapped in an object:

{
__ESModule: true,
default: {...expected plugin object...}
}

Therefore the fix for now is to unwrap it if that is the case. More work is needed to determine why this happens in the consumer project however.

Furthermore the chart.js version used for development has been aligned with the one shipped in libs/designsystem/package.json.

Checklist:

The following tasks should be carried out in sequence in order to follow the process of contributing correctly.

Reminders

  • Make sure you have implemented tests following the guidelines in: "The good: Test".
  • Make sure you have updated the cookbook with examples and showcases (for bug fixes, enhancements & new components).

Review

  • Do a self-review.
  • Request that the changes are code-reviewed
  • Request that the changes are UX reviewed (only necessary if your PR introduces visual changes)

When the pull request has been approved it will be merged to develop by Team Kirby.

The shipped package.json file located in the designsystem library was different from the one in the root package.json that is used for development.
In the context of DRB the annotationPlugin & ChartDataLabels plugin is loaded as objects where the actual value expected by register is located in the default field. It is possible to check the __esModule field of the plugin to see if it is necessary.
@github-actions github-actions bot temporarily deployed to pr-xxxx-chart-js-plugins-not-loading June 26, 2022 17:16 Inactive
@MadsBuchmann MadsBuchmann merged commit f444261 into develop Jun 27, 2022
@MadsBuchmann MadsBuchmann deleted the bug/xxxx-chart-js-plugins-not-loading branch June 27, 2022 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants