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

Version 1.7.0 #225

Merged
merged 6 commits into from
Feb 9, 2024
Merged

Version 1.7.0 #225

merged 6 commits into from
Feb 9, 2024

Conversation

</script>
<style>dt_css</style>
<script>jquery_src</script>
<script>window._datatables_src_for_itables = "dt_src"</script>
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works and looks much simpler to me than the previous promise. Now window._datatables_src_for_itables is set when itables.init_notebook_mode is called, and its value is the base64 encoding of the datatables.net library.

Then for every table in the HTML document we do

const dt = (await import(window._datatables_src_for_itables)).default;

which might cause some redundancy (unless import has a cache?).

IMO that's worth the simplification, and in practice I don't notice any performance difference. I also have hopes that this can solve an intermittent issue in VS Code (#216 ).

@fwouts may I ask if you see any problem with repeating the import like this?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is likely cached and so would be fine! You could try adding a simple console.log("Hello, World!") statement in the base64-encoded window. _datatables_src_for_itables to make sure it's only logged once for multiple tables.

Don't activate datatables twice
to avoid a `pandas==2.2.0` warning:
FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas.
@mwouts mwouts force-pushed the version_1.7.0 branch 2 times, most recently from 7daaf71 to 118cfb2 Compare February 9, 2024 23:15
Add data-quarto-disable-processing="true"
to the tables that are not generated with to_html
Remove unnecessary dom arguments
@mwouts mwouts merged commit 1e48be4 into main Feb 9, 2024
12 checks passed
@mwouts mwouts deleted the version_1.7.0 branch February 9, 2024 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants