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

fix(type-coercion): use Data Pipes #259

Merged
merged 4 commits into from
Jan 25, 2020
Merged

fix(type-coercion): use Data Pipes #259

merged 4 commits into from
Jan 25, 2020

Conversation

Thomaash
Copy link
Member

@Thomaash Thomaash commented Jan 18, 2020

Switch from the deprecated type property of Data Set to Data Pipes. This solves some or maybe all issues from #254.

PS: There is a bug in Vis Data that prevents this from working see visjs/vis-data/pull/78.
PS: I'm not going to change this here as it's off topic but this library has no runtime dependencies. Everything's bundled by Rollup so all the dependencies listed in package.json are completely unnecessary to use this.

@Thomaash Thomaash marked this pull request as ready for review January 19, 2020 11:28
@Thomaash Thomaash requested a review from yotamberk January 19, 2020 11:29
@@ -1143,7 +1140,7 @@ class ItemSet extends Component {
const me = this;

ids.forEach(id => {
const itemData = me.itemsData.get(id, me.itemOptions);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was me.itemOptions removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found no place where it would be altered and it just set the same type coercion as was used everywhere anyway.

* @returns A Data Set like object that saves data into the raw Data Set and
* retrieves them from the coerced Data Set.
*/
export function typeCoerceDataSet(
Copy link
Member

@yotamberk yotamberk Jan 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain better what's the idea again of this function? I still haven;t grasp the idea of 'type coerced' data sets...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some more info about the inner workings. It basically just imitates how it worked with the type constructor parameter but without forcing this functionality into the data set itself.

Switch from the deprecated type property of Data Set to Data Pipes. This
solves some or maybe all issues from #254.

PS: There is a bug in Vis Data that prevents this from working see
visjs/vis-data/pull/78.
@yotamberk yotamberk merged commit 109c121 into master Jan 25, 2020
@yotamberk yotamberk deleted the issues/254 branch January 25, 2020 13:16
@yotamberk
Copy link
Member

PS: I'm not going to change this here as it's off topic but this library has no runtime dependencies. Everything's bundled by Rollup so all the dependencies listed in package.json are completely unnecessary to use this.

Are you sure there is no need for moment? It seems still like a dependency.

@vis-bot
Copy link
Collaborator

vis-bot commented Jan 25, 2020

🎉 This PR is included in version 6.5.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Thomaash
Copy link
Member Author

Dependencies are only things marked as external in Rollup and unless I overlooked something there's no such thing. Moment is simply copy pasted into vis-timeline-graph2d.*.js.

@yotamberk
Copy link
Member

yotamberk commented Jan 25, 2020

So you say we can empty out all dependencies in package.json

    "@egjs/hammerjs": "2.0.17",
    "emitter-component": "1.1.1",
    "keycharm": "^0.3.0",
    "moment": "2.24.0",
    "propagating-hammerjs": "1.4.7",
    "vis-data": "6.3.5",
    "vis-util": "2.1.0"

?
I'm not sure that will work.
We need all those packages. I can try it out later, but highly doubt that's the case.

@Thomaash
Copy link
Member Author

They are necessary when Rollup is running (as dev dependencies) but Rollup will put them into the bundled file. When the bundled file is running it already has all of them included and will never use those from node_modules.

@yotamberk
Copy link
Member

So you mean we can move the dependencies to the dev-dependencies?

@Thomaash
Copy link
Member Author

Yeah exactly.

strazto added a commit to strazto/vis-timeline that referenced this pull request Oct 12, 2020
This bug was introduced in visjs#259 , and constituted a breaking change.

This commit should fix visjs#715.
yotamberk pushed a commit that referenced this pull request Oct 13, 2020
#716)

* fix(util.typecoercedataset): restore timeline.itemsData.clear accessor

This bug was introduced in #259 , and constituted a breaking change.

This commit should fix #715.

* revert "fix(util.typecoercedataset): restore timeline.itemsData.clear accessor"

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

Successfully merging this pull request may close these issues.

3 participants