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

Upgrade to DataTables.net v2 and swap out @types/datatables.net for the built-in types #1780

Closed
pbarranis opened this issue Mar 25, 2024 · 4 comments
Labels
feature request Use to ask for feature request

Comments

@pbarranis
Copy link

🚀 Feature request: DataTables.net v2 Support

DataTables.net v2.0.0 shipped in early March. This issue is to track progress towards support. Here's what's new in v2.

This issue was started based on a discussion, but choosing to copy all that text into this issue seems like it would just make things messy.

It's worth noting that, at this time, my project is about to target both angular-datatables 17.0.0 and datatables.net 2.0.2 in NPM and successfully build and deploy. The problem is in using the new v2 APIs (more on that in a comment below).

@pbarranis pbarranis added the feature request Use to ask for feature request label Mar 25, 2024
@pbarranis
Copy link
Author

I think the only problem here is going to be that v2 overhauled many parts of their API with a ton of new features. People are going to want to use those new features. However, the necessary types to use those features are included in datatables.net, per the project owner's comment here. Here's a link to the published types in the source.

Since the project now publishes their own types, @types/datatables.net should be deprecated, and angular-datatables will need to update to use the new included types. But from what I can see, many of the names are different and there's no namespace. I'm not knowledgeable at dealing with how TypeScript types work, but they look incompatible to me.

@pbarranis
Copy link
Author

I know @shanmukhateja said he wanted to keep angular-datatables backwards compatible with v2, but I don't think that's possible. The owner of the datatables.net project commented in the discussion that v1 is no longer supported.

I think the modern solution of simply creating a v1 branch and, if necessary, publishing an update to angular-datatables v1 on that branch, under a 1.17.x version number, would suffice.

Aside from this issue of compatibility with angular-datatables, my experience is that an update from datatables.net v1 to v2 is almost completely painless and error-free. Unfortunately, I spent a lot of time trying to figure out these type issues while trying to use the v2 API and almost no time fixing breaking changes in my use of datatables.net itself.

@l-lin
Copy link
Owner

l-lin commented Apr 21, 2024

The PR #1783 has been merged. Sorry for the delay.

Thanks again @shanmukhateja for the huge rework 👍

I know @shanmukhateja said he wanted to keep angular-datatables backwards compatible with v2, but I don't think that's possible. The owner of the datatables.net project commented in the discussion that v1 is #1777 (comment).

We have decided to follow suit and only support DT v2 starting from v17.1.X, and as you mentioned, the migration to DT v2 should not be painful.

On a side note, the versioning of angular-datatables is a bit awkward as we are only trying to have the major version to be synchronized with Angular, so no link with DT version, which was ok until now. (Maybe semver is not the right answer for this project? It's another debate...)

Hopefully, the updated documentation should be clear enough that angular-datatables is now only supporting DT v2 (if it's not, maybe we should add a huge warning in the README.md for a few months).

@shanmukhateja
Copy link
Collaborator

shanmukhateja commented Apr 21, 2024

Unfortunately we are breaking semver for this instance.

v17.1.0 is not backwards compatible.

Thanks to @l-lin for helping me review the code.

The new version is tagged and release is up on NPM.

The documentation will follow suit in minutes.

EDIT: Documentation is now up :-)

Cheers :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Use to ask for feature request
Projects
None yet
Development

No branches or pull requests

3 participants