Closed mwouts closed 2 years ago
I've covered some points about this in my comment here, but to keep this topic here - in a Require environment DataTables does not automatically expose itself in the global scope, which I think it typical and correct for AMD modules.
I'm not sure what the correct thing to do here is. Require is loaded, but it isn't being used. If it were used, then it would work. If it weren't loaded, the above would work. It is the combination of the two - Require being loaded, but expecting it to work globally, that is the issue.
I've opened an issue to see if we can get feedback about this from the Require JS folk.
Yes, that's it. Thank you Allan!
We've had a reply in that thread now noting:
if require.min.js is loaded in a page, then the assumption is that module loading via require/define are supposed to be used, particularly if the script supports UMD.
So at this time, I won't be making any changes to our UMD to register DataTables globally and with AMD at the same time.
Sure, makes sense... and also I agree that my question (the heterogeneity of the environments in which Jupyter notebooks are rendered) is very specific. Anyway, thank you so much for considering it!
On the plus side, I've been making good progress with ES modules recently. Going on to be in holiday next week, but should have something to show after that.
Awesome! Keep me posted... and have a great holiday!
This is a follow-up on this comment.
In some cases (and I don't have control on that), require.js is present in my HTML document. When this is the case I am not able to load datatables as a simple script element. (I know I could use a
require.config
file, but I'd prefer not to make an exception on whether require.js is there or not)A minimal example that reproduces the issue is this one:
(the example works when the "require.min.js" library is removed)
Thanks!