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

feat(build): add peer, standalone and esnext builds #269

Merged
merged 10 commits into from
Jan 31, 2020
Merged

Conversation

Thomaash
Copy link
Member

Closes #67, closes #12.

Copy link
Member

@yotamberk yotamberk left a comment

Choose a reason for hiding this comment

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

Thanks A LOT!!!
Can you add please in the READ.MD how to use each and every build?
I a user wants to import the timeline via npm, how can he consume the full version versus the 'moment-less' version?

@Thomaash
Copy link
Member Author

Yeah, I plan to do this. This isn't done yet. It should've been a draft PR actually.

@Thomaash
Copy link
Member Author

I hope I didn't forget anything. Anyway a changelog:

  • Nothing was removed, that is no breaking changes here.
  • Two new examples how to use the peer and standalone builds respectively.
  • A note in the readme pointing to the examples for more info.
  • A deprecation warning was added pointing people to the new build examples.
  • The old examples have been updated to use the new standalone build.
  • GH Pages in CircleCI now publishes the new dirs.
  • The new builds have a new directory based API which doesn't do much in script tag URLs but is much more pleasant to use in ESM.
  • The size reduction is up to 1/3. There's no reduction for people who will load the stuff anyway but a significant reduction for those who'll no longer end up with two copies of Moment and a bunch of locales they'll never use.

@Thomaash
Copy link
Member Author

There's one thing I forgot. Don't merge this just yet.

This is a pretty small investment on our side but can help a lot to the
users who want to optimize their bundle size. Well, when it will be
deployed in the other projects anyway.
BREAKING CHANGE: The default export is no longer provided.

This doesn't do much anyway.

In ESM it's possible to do:
  `import * as visTimeline from "vis-timeline/standalone";`

In UMD it just adds a property named `default` which contains the same
stuff as the export itself does already. I highly doubt anyone is
actually using this in UMD.
@Thomaash
Copy link
Member Author

Updated changelog:

  • Nothing was removed, that is no breaking changes here.
  • Two new examples how to use the peer and standalone builds respectively.
  • A note in the readme pointing to the examples for more info.
  • A deprecation warning was added pointing people to the new build examples.
  • The old examples have been updated to use the new standalone build.
  • GH Pages in CircleCI now publishes the new dirs.
  • The new builds have a new directory based API which doesn't do much in script tag URLs but is shorter and much more pleasant to use in ESM.
  • The size reduction is up to 1/3. There's no reduction for people who will load the stuff anyway but a significant reduction for those who'll no longer end up with two copies of Moment and a bunch of locales they'll never use. When the other projects are ported to the same design we'll be able to dedupe polyfills etc. for additional reduction.

@Thomaash Thomaash changed the title feat(build): add peer and standalone builds feat(build): add peer, standalone and esnext builds Jan 29, 2020
@yotamberk yotamberk merged commit 73a7e51 into master Jan 31, 2020
@yotamberk yotamberk deleted the issues/67 branch January 31, 2020 08:26
@yotamberk
Copy link
Member

Awesome work!

@vis-bot
Copy link
Collaborator

vis-bot commented Jan 31, 2020

🎉 This PR is included in version 7.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

Network and Graph2d not working in the same app exclude moment from bundle by default?
3 participants