-
Notifications
You must be signed in to change notification settings - Fork 14k
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(plugin-chart-handlebars): Fixed issue with Helpers #21143
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️
We hope to see you in our Slack community too!
@kgabryje @lyndsiWilliams can you please review? |
Storybook has completed and can be viewed at |
@zhaoyongjie @stephenLYZ @michael-s-molina can you please check this pr? It would be very helpful, it has been open since long. |
Storybook has completed and can be viewed at |
@AAfghahi can you please check this pull request? |
@hughhhh @zhaoyongjie @stephenLYZ @michael-s-molina can you please check this PR? |
@villebro can you please check this? |
Codecov Report
@@ Coverage Diff @@
## master #21143 +/- ##
==========================================
+ Coverage 66.57% 66.61% +0.04%
==========================================
Files 1793 1796 +3
Lines 68493 68339 -154
Branches 7275 7312 +37
==========================================
- Hits 45596 45521 -75
+ Misses 21035 20948 -87
- Partials 1862 1870 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@sinhashubham95 sure thing, will check in a few hours! |
@sinhashubham95 just so I understand this PR correctly, are we essentially copying over the functions from |
@villebro I have updated the package lock file. The idea behind updating the package lock file is-
|
@sinhashubham95 thanks for the clarification. Did I understand correctly that you're getting the export error when running on Windows? While I would like to help support a more diverse se of OSes, currently Superset does not officially support running the application on Windows. So if this is the main reason for removing
Out of curiosity, would running on a Linux server be an option? This is currently the recommended setup. |
@villebro I am facing the issue with both MacOS and Linux. I understand this part that removing the dependency will avoid any fixes to be incorporated automatically in Superset, but this is what I believe around this, the helpers here are very straightforward, and adding any extra dependency for such functions won't add any benefit but just bloat up our core Superset. Using libraries like moment, etc. makes a lot of sense for the vast set of functionalities and the community support it gets. |
Ok, if you're running into trouble on MacOS then this needs additional attention. Can you check what versions of Node and npm you're using? My output below:
I understand the argument about this functionality being simple and I agree - however, if we want to incorporate this logic into Superset, I would strongly recommend adding full unit tests to ensure we have full test coverage for each supported function. Ping @rusackas , any thoughts on this? |
@villebro I am using |
Oh my bad - the tests look great, thanks for adding those 👍 I'm leaning towards your proposed solution, thanks for all the iterations here. Let's also wait if anyone else has any feedback before proceeding. |
@villebro thanks a lot for these iterations, it's just a healthy discussion and learning for me. Sure, lemme know whenever we can merge this, it has kind of been open for long. Another update, after this change I tested both on MacOS and Linux and it works perfectly fine. |
@villebro are we good to merge this? |
I really, really appreciate all the work happening in this PR, but I'm a little nervous about this one... it seems like we're taking on much of the functionality of a whole library in terms of stability/security/maintenance. And not the whole library, including time and currency formatters, for example. I don't think the optimization of removing moment is all that pertinent to the project, but the Last and maybe least (if I'm over-thinking this), but this seems to be a copy/paste of the just-handlebars-helpers codebase, not an original implementation and would be subject to the copyright of the original library. It's MIT licensed, so we would need to include the author's copyright, and I'm not sure how including MIT licensed code directly within an Apache-licensed file works. ¯\_(ツ)_/¯ |
@sinhashubham95 @villebro just checking in on this... wondering if I'm off base in my prior assessment. The build issue was resolved quite some time ago, and I don't think the moment dependency is a big deal, personally. Is anyone still clamoring to get this lib copied/pasted into our codebase, and willing to maintain it? If not, I think we should probably forego this change and close the PR. |
Closing, but still happy to revisit this discussion if/when needed |
SUMMARY
The library
just-handlebar-helpers
previously used as helpers forhandlebars
requires a lot of dependencies likemoment
, etc, which need not be defined necessarily. Also, it expects some globals which are breaking on window machines. Switched to having the necessary helpers in the plugin itself.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
After:
TESTING INSTRUCTIONS
Render any chart using
plugin-chart-handlerbars
on any dataset. It should render without any error.ADDITIONAL INFORMATION