Comments (4)
Hi @davidgraeff,
Thanks for your interest into contributing!
As I add features the code base is getting bigger and bigger and I agree it would be nice to split it into multiple files now. I actually had this in mind for a while.
But there is a tradeoff: code will be more complex and not significantly shorter in the main index.
The reason for that:
- some logic needs to be shared across the different components and remain in the index
- increased complexity because of nested slots, passing down props, calling parent methods
I have split the header into a different file in the refactoring
branch I will think it over to see what can be improved and moved but if you want to have a look and give me some feedbacks, please do so!
from vue-cal.
some logic needs to be shared across the different components
Use ES6 modules and move utility methods into own files. The build system will care about joining everything. The "updateMutableEvents" method is a good candidate for example. Basically all methods that are not "reactive".
if you want to have a look and give me some feedbacks
Sounds promising, I'll have a look.
As I add features the code base is getting bigger and bigger
I have seen your ToDo list. If you are done with that, this component will be the most complete component for Vue that I've seen so far. But don't do the charts.js mistake, they are now in the second year of refactoring, from their original one-file monstrosity.
Vue provides you with a lot of tools to create small re-usable pieces. You can design (additional) features as Mixins for example (like Drag&Drop, Editable-cells, different View modes) and allow the user to add Mixins as he needs them. That way an ES6 ready build system will tree-shake your component for smaller file sizes (your component with all its features, non-gzipped is close to 100kb).
Cheers, David
from vue-cal.
Hi @davidgraeff,
I did a good refactoring and will stop here for the big part. Now merged into master.
I will keep improving as I develop new features but I am closing the refactoring branch.
- Header is moved into a new component
- Weekday headings is moved into a new component
- Styles are split where it belongs into new components
- Some of the logic is moved into the new components
- The main big file is now down to less than 900 lines
I will keep in mind modularising the features into mixins, but it is not the priority now.
Thanks for your advice!
from vue-cal.
Thanks :)
from vue-cal.
Related Issues (20)
- Changing the date of Vue-Cal to Jalali(Persian) when the language is fa-IR
- returning false on event-drag-create but the event creation is not rejected
- special-hours per split-days
- Event resize
- How to listen to the mouse hover event when hovering over cells
- How to change the position for the time and date? HOT 1
- min-split-width and sticky-split-labels conflict
- Build with multiple files
- Events disappear on month-crossing drag & drop
- Nuxt 3 HOT 1
- Weekview hide day number. HOT 1
- Feature Request: option: hideDayOfMonth
- Feature Request: update displayed time when dragging an event
- Setting scroll top, only finds querySelector with multiple events.
- Invalid Date on increasing size of multi day event HOT 1
- Incorrect weekday in week view. HOT 1
- Miscalculation of event widths
- This project is deprecated? HOT 3
- Alot of console verbose log: "Added non-passive event listener to a scroll-blocking..." HOT 3
- Request change sequence of @view-change and @choose-date HOT 1
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 vue-cal.