sanctuary-def dependency
See original GitHub issueSanctuary depends on sanctuary-def, as specified in package.json. Furthermore, Sanctuary is only compatible with certain versions of sanctuary-def. @codedmart recently brought it to my attention on Gitter that the example for create
does not work if one uses the current version of Sanctuary (v0.11.1) with the current version of sanctuary-def (v0.9.0).
There are (at least) two things we should consider:
- specifying this constraint in package.json, if possible; and
- versioning the two packages such that
sanctuary@X.Y.Z
always depends on and works withsanctuary-def@X.Y.Z
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
sanctuary-def - npm
Run-time type system for JavaScript. Latest version: 0.22.0, last published: 2 years ago. Start using sanctuary-def in your project by ...
Read more >sanctuary-def | Yarn - Package Manager
Fast, reliable, and secure dependency management. ... sanctuary-def is a run-time type system for JavaScript. It facilitates the definition of curried ...
Read more >sanctuary-js/sanctuary: Refuge from unsafe JavaScript - GitHub
Sanctuary functions are defined via sanctuary-def to provide run-time type checking. This is tremendously useful during development: type errors are reported ...
Read more >Sanctuary Definition & Meaning - Merriam-Webster
noun ; (1) · a place of refuge and protection ; (2) · a refuge for wildlife where predators are controlled and hunting...
Read more >What Is a Sanctuary City Anyway? - Learning for Justice
A sanctuary city is a place that has decided to keep local resources to solve local problems. Some people think “sanctuary” means the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here’s what I think we should do:
sanctuary
into small modules, each with a peer dependency onsanctuary-def
(and possiblysanctuary-type-identifiers
and other shared dependencies):sanctuary-either
to contain the Either type, its Repr, and associated functionssanctuary-maybe
to contain the Maybe type, its Repr, and associated functionssanctuary-list
for list related functionssanctuary-string
for string related functionssanctuary-strmap
for the StrMap type, its Repr, and related functionssanctuary-prelude
library which takes from each of the above libs to provide a set of common tools.sanctuary
library will have a single function. To loadsanctuary-prelude
and the shared peer dependencies likesanctuary-def
, and instantiate the prelude with a defaultdef
.People who want an out-of-the-box experience will use
sanctuary
, people who want a customized one will usesanctuary-prelude
, people who want only parts of the functionality will assemble their own utility belt from the available underlying libs.This tackles several problems:
sanctuary-maybe-type
,sanctuary-maybe-from-nullable
. This package structure is “composable” all the way down tosanctuary
.require('sanctuary')
directly, which defeats the point of disabling type-checking”: Now, I will depend only onsanctuary-prelude
, and provide my own assembly which they have to use.sanctuary-def
is not compatible with yours”: Since all packages butsanctuary
have it as a peer dependency, they will all use the same version and NPM will show it when one is not compatible and should be down or upgraded.ENV_X
to determine whether to check types”: The community is now free to provide many Sanctuary assemblies, since it’s very easy to set up. Just depend on the compatiblesanctuary-*
packages andexport create(myDef)
.I really don’t know the internals of sanctuary so I have no idea what is possible but I assume that each of those packages would need sanctuary-def (78 kb) and sanctuary-type-classes (45kb). Right now sanctuary is 100kb, let’s say sanctuary-maybe would me 15kb. Would it make sense to have a separate package of 15kb with 123kb of dependencies? In that case, me as a user, I would prefer to download an es6 modularized sanctuary and tree shake it myself. Other option is to ask if you are downloading a single package probably you are working on a small project and you would not need type checking, so remove type checking on individual packages -if possible.