Comments (17)
@Kiarash-Z module bundlers won't load type definition files and consequently type definitions will not appear in the JS bundle files. In fact, the package size will grow but the bundle size will not.
Type definitions only will be load by TypeScript compiler from types
property in package.json
file.
from react-modern-calendar-datepicker.
I added new branch for this feature and after merge, your package need a new version(like 1.1.0) and need to publish on npm
@thebrodmann
@Kiarash-Z
from react-modern-calendar-datepicker.
@Kiarash-Z @thebrodmann
There is another way and its i add this index.d.ts file as a package to DefinitelyTyped so developers can install types (like @types/react-modern-calendar-datepicker).
Im glad to do that too.
from react-modern-calendar-datepicker.
@Kiarash-Z can you share statistics? It should not affect the JS part of the package!
There is another way and its i add this index.d.ts file as a package to DefinitelyTyped so developers can install types (like @types/react-modern-calendar-datepicker).
I don't recommend this solution. Usually, It's a plan B when maintainers of a module don't wanna accept the maintenance of the type definition.
from react-modern-calendar-datepicker.
Hi @arminyahya,
Does this index.t.ts file need to be published on NPM? or it just gets fetched automatically by the repo connected to the package?
from react-modern-calendar-datepicker.
@Kiarash-Z it should publish. I can work on this.
from react-modern-calendar-datepicker.
@thebrodmann @arminyahya Wouldn't this result in extra bundle size?
from react-modern-calendar-datepicker.
@Kiarash-Z
No, this is only for developer experience and doesn't effect the main bundle
from react-modern-calendar-datepicker.
@arminyahya just tried it, and it adds up to bundle size 😶
from react-modern-calendar-datepicker.
Gotta do some research to find an efficient way to add this 🤔
from react-modern-calendar-datepicker.
@thebrodmann I just considered it simple. When it's gonna get published, it will be there on node_modules/react-modern-calendar-datepicker, and that means it would add up to bundle size, wouldn't it? If it's not going to be there then how developers would detect the types?
from react-modern-calendar-datepicker.
@thebrodmann Got it! thanks for the clear explanation. You can work on a PR for this if you wish. By the way, is adding types by an index.d.ts file the best way for adding types?
from react-modern-calendar-datepicker.
@Kiarash-Z @thebrodmann
I did a PR for this before.
Didn't you Receive that?
from react-modern-calendar-datepicker.
@arminyahya Nope. Nothing in Pull Requests section:/
from react-modern-calendar-datepicker.
@Kiarash-Z @thebrodmann
Hmm
I finished this last week,maybe i forget something.
Let me back home and create a PR.
from react-modern-calendar-datepicker.
By the way, is adding types by an index.d.ts file the best way for adding types?
Yeah, I think so. It's our plan A. :D
from react-modern-calendar-datepicker.
Resolved in #64
from react-modern-calendar-datepicker.
Related Issues (20)
- dates are wrong and no last day, even on your demo page
- ????? HOT 1
- some buttons css is not working HOT 1
- When do you release new update? HOT 2
- Trying Simple Implementation HOT 3
- Making the datepicker required
- Locale should accept Multiple language. For now it only accept 'fa' and 'en'
- Calendar should be support JS calendar Locale
- Calendar should be support JS calendar Locale
- Is there any way of calling a function on blur?? HOT 1
- Simple examples in typescript doesn't work HOT 4
- days outside at component Calandar? HOT 2
- Just pick month and year
- After selecting date range I got type error "Unhandled Runtime Error TypeError: Cannot read properties of null (reading 'removeEventListener')" HOT 16
- Navigate to Today HOT 2
- Angular version
- Nexjs some issue: typeError: Cannot read properties of null (reading 'removeEventListener') HOT 4
- error how to solve it
- Warning: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
- How can I disabled previous years in the calendar?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-modern-calendar-datepicker.