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

Modular usage #60

Closed
shrpne opened this issue Feb 9, 2018 · 8 comments
Closed

Modular usage #60

shrpne opened this issue Feb 9, 2018 · 8 comments

Comments

@shrpne
Copy link

shrpne commented Feb 9, 2018

I want to use only those parts of v-calendar what I really need.
For example, if I need only calendar without date-picker and day-popovers, I don't want to load js and styles of unused components.

Would be great if you make it possible in some of the future releases.
BTW thanks for this great package, it is the best among vue calendars!

@nathanreyes
Copy link
Owner

I have considered splitting the packages, with v-calendar as a dependency for a potential v-date-picker plugin. And perhaps even breakout out v-popover into its own package.

Until now, it has been very convenient to build them out together in a single package, but as the project stabilizes, who knows.

@nathanreyes
Copy link
Owner

Not sure on how to accomplish this yet. Could include the calendar and picker by default, but allow for importing from v-calendar/core to just pull in the calendar. Or could set it up to only pull in the calendar by default and force importing from v-calendar/picker to get the date picker. Open for suggestions here.

@EricMcRay
Copy link
Contributor

I vote for splitting package. This way package size much more less for anyone who want to use only calendar and date picker over this calendar package is also better that using different datepicker package.

It would be better for development too. While changing some thing for calendar there is a possibility to break date picker and vise versa. I believe decoupling things brings more flexibility and stability. I know it also brings some maintaining difficulties but "great power comes with great responsibility" 😄

@shrpne
Copy link
Author

shrpne commented Apr 3, 2018

I think it's better to keep everything in one package.

Could include the calendar and picker by default, but allow for importing from v-calendar/core to just pull in the calendar.

I like this approach, It will be backward compatible with the previous implementation

@EricMcRay
Copy link
Contributor

@shrpne is this #105 what you want? If It is, you can actually use components from VCalendar object but there is some bug right now. some details at #112

Possible usage with current structure:

import VCalendar from 'v-calendar'

new Vue({
  el: '#app'
  components: {
    'v-calendar': VCalendar.Calendar,
    'v-datepicker': VCalendar.DatePicker,
   'v-popover': VCalendar.Popover
  }
});

@nathanreyes
Copy link
Owner

Yep. This is next on the list. One drawback to the import approach, I believe, is that the CSS is still all bundled together. Still, there isn't an unusually large amount of CSS just for the picker and popover.

@nathanreyes
Copy link
Owner

nathanreyes commented Apr 5, 2018

This issue will get closed with #105.

@nathanreyes
Copy link
Owner

Resolved by 19b8d6f.

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

No branches or pull requests

3 participants