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

Add typescript support #1166

Merged
merged 1 commit into from
Nov 4, 2020
Merged

Add typescript support #1166

merged 1 commit into from
Nov 4, 2020

Conversation

jantimon
Copy link
Contributor

@jantimon jantimon commented Oct 3, 2016

This pull request allows typescript codebases to use selectize:

import selectize from 'selectize';

@joallard
Copy link
Member

joallard commented Oct 3, 2016

I welcome the proposition, can you provide a little more background about this? Personally, I don't know Typescript at all (except by name).

  1. Can you do a little background about how it fits into a Typescript project and how it works?
  2. Any thoughts about whether this could be an external plugin?
  3. As this enters the codebase, it will have to be maintained. What does this entail from maintenance?
  4. How will this have to change as the Selectize code base changes?

Feel free to provide more info as needed.

@jantimon
Copy link
Contributor Author

jantimon commented Oct 3, 2016

Typescript is the microsoft version of babel - it is a ES6/ES7 to ES5 transpiler.

But there is more than just ES6 and ES7 it also adds typing (that's why it is called typescript)

As you see in the merge request I added a index.d.ts file. It's actually only a description of your plugin and explains which methods exist, which parameters you can pass to the function (e.g. the options object) and what they return.

This allows to get error messages if you add call selectize with an unkown option:
components_atoms_type-select_js_type-select_ts__fix_selectize_

It would be cool if it would be part of your codebase as it would be installable using npm and the version of the type definitions would always match with your current api.
So if you would decide to remove an option typescript would tell us that we are using an "unknown" option after we updated your plugin and we can adjust our code.

Maintainence:

The index.d.ts has only to be updated if a new method or option is added but it is really simple now that the base file is already there and you have a good example how to extend it.
I can also assist you if you need help with it.

Do you need more information on one of the topics?

@jantimon
Copy link
Contributor Author

jantimon commented Oct 6, 2016

One Example why it might be good for your library is that Google is using Typescript for Angular2.
So in order to use selectize in an Angular2 app those definitions are required.

@joallard
Copy link
Member

joallard commented Oct 6, 2016

Thanks for the writeup. All right, I'll schedule it for next minor.

@joallard joallard added this to the 0.13.0 milestone Oct 6, 2016
@jantimon
Copy link
Contributor Author

jantimon commented Oct 6, 2016

Cool 👍

Can you already give an estimation when this 0.13.0 will be released?

@joallard
Copy link
Member

joallard commented Oct 6, 2016

Yet I'm not able to, I don't have the means to spend time maintaining the project unfortunately. It's done on free time.

@jantimon
Copy link
Contributor Author

jantimon commented Oct 7, 2016

Why do you create such big releases instead of using semVer - it would be so much simpler and less work to release after every pr and have small change sets instead of gathering large releases.. also people would be motivated to help you even more if they get the feeling that they are involved.. and you could also add a text to the readme "partial maintained looking for full time maintainer" so people know.

(i am maintaining an module in my spare time which is used intensively)

@risadams risadams merged commit 43e452e into selectize:master Nov 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants