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

Restructure to allow usage without built-in locales #205

Merged
merged 2 commits into from
Oct 26, 2019

Conversation

OrKoN
Copy link
Contributor

@OrKoN OrKoN commented Oct 25, 2019

I am proposing a change to address the issue #204:

The only difference to the plan outlined here #204 (comment) is that I think core.ts would redundant. Instead it's more flexible if every method is separate. I'd use it like this:

import { format } from 'timeago.js/format';
import { register } from 'timeago.js/register'; 

so that realtime.ts and built-in locales can be stripped from my bundle.

What do you think?

__tests__/utils/date.spec.ts Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Oct 25, 2019

Pull Request Test Coverage Report for Build 481

  • 10 of 10 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.3%) to 53.89%

Totals Coverage Status
Change from base Build 479: 0.3%
Covered Lines: 672
Relevant Lines: 1020

💛 - Coveralls

src/register.ts Show resolved Hide resolved
Copy link
Owner

@hustcc hustcc left a comment

Choose a reason for hiding this comment

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

Finally, can you help to show the package size increment?

src/index.ts Outdated Show resolved Hide resolved
__tests__/utils/date.spec.ts Outdated Show resolved Hide resolved
@OrKoN
Copy link
Contributor Author

OrKoN commented Oct 26, 2019

@hustcc how can I see the package size increment? do you mean the size of the resulting bundles? I don't think the size actually changes but it'd be happy to check if you let me know what package size I need to look at and how.

@OrKoN OrKoN requested a review from hustcc October 26, 2019 06:47
@OrKoN
Copy link
Contributor Author

OrKoN commented Oct 26, 2019

Output of npm run build:

> timeago.js@4.0.0 size /home/alex/projects/timeago.js
> size-limit


  gh-pages/timeago.min.js
  Package size: 888 B
  Size limit:   1 KB

  gh-pages/timeago.full.min.js
  Package size: 7.36 KB
  Size limit:   10 KB

  With all dependencies, minified and gzipped

@OrKoN
Copy link
Contributor Author

OrKoN commented Oct 26, 2019

Same before the change:

> timeago.js@4.0.0 size /home/alex/projects/timeago.js-original
> size-limit


  gh-pages/timeago.min.js
  Package size: 888 B
  Size limit:   1 KB

  gh-pages/timeago.full.min.js
  Package size: 7.36 KB
  Size limit:   10 KB

  With all dependencies, minified and gzipped

@hustcc hustcc merged commit d61b327 into hustcc:master Oct 26, 2019
@hustcc
Copy link
Owner

hustcc commented Oct 26, 2019

v4.0.1 released.

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

Successfully merging this pull request may close these issues.

None yet

3 participants