globalizejs / globalizejs/globalize

Validation (internal code): evaluate a single entrypoint API

Open
#362 4 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
JavaScript
Stars
4.8k
Forks
585
PR merge metrics
No merged PRs in 30d

Description

Jörn raised this concern in https://github.com/jquery/globalize/pull/351#discussion_r21466383. Evaluate the pros and cons of this change.

Currently, no final `dist/` have unused validations. So, it's important to determine how this change would affect that and how would it affect its final sizes.

---

src/currency.js @ header

@jzaefferer

> Have you considered making this a single validate module that exports an object with multiple functions? Would help reduce the number of dependencies you need to require in many places, including these modules itself, since most share the same dependencies."

@rxaviers

> Different methods require different validations. Therefore, the dependency of the validate functions across Globalize (core), date module, number module, plural module, etc are different.
>
> How bundling all validations on a single export affect the final dist files? What the gain is?"

@jzaefferer

> There are 103 effective LOC in common/validate, counting only the returned functions, excluding the define wrappers and blank lines. Grouping those 14 files into a single one with about 120 LOC would simplify dependencies in many places and improve the overall understandibility (I may have made that word up, I hope you catch my meaning).
>
> It would also give the potential for other refactorings, as refactorings in general do, for example I suspect that some of the other modules in common are only used in the various validation modules.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.