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

reinstate S.unchecked #518

Merged
merged 1 commit into from
Apr 8, 2018
Merged

reinstate S.unchecked #518

merged 1 commit into from
Apr 8, 2018

Conversation

davidchambers
Copy link
Member

Closes #517

S.unchecked was removed in #206. Two years later, it's time to bring it back. :)

/cc @mwalkerwells

index.js Outdated
@@ -402,7 +406,7 @@
function create(opts) {
var def = $.create(opts);
var S = {
env: defaultEnv,
env: opts.env,
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'll open a separate pull request for this change.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@Avaq Avaq left a comment

Choose a reason for hiding this comment

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

This checks on of the boxes in #471! See #262 (comment)

Copy link

@mwalkerwells mwalkerwells left a comment

Choose a reason for hiding this comment

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

Would love to see what you previously suggested included in this commit. It'd make ES6 imports much cleaner.

src/
├── index.js
├── unchecked/
│   ├── index.js

ES5

const $ = require('sanctuary/unchecked')
// or
const { unchecked: $ } = require('sanctuary') 

ES6

import $ from 'sanctuary/unchecked'

Without this change, ES6 imports would look like the following in every file:

import sanctuary from 'sanctuary'
const { unchecked: $ } = sanctuary

@davidchambers
Copy link
Member Author

Would this work, @mwalkerwells?

import { unchecked as S_ } from 'sanctuary';

@mwalkerwells
Copy link

Oh duh, yeah that works. 😬

@davidchambers
Copy link
Member Author

That's good to hear, @mwalkerwells! Let's stick with the unchecked property in that case because it has the advantage of also working in the browser.

@tomkel
Copy link

tomkel commented Apr 4, 2018

See here for a little discussion on the feature/mistake of node.js automatically resolving index.js.

@davidchambers davidchambers force-pushed the davidchambers/unchecked branch 3 times, most recently from db8d85b to 71ddd84 Compare April 8, 2018 18:24
@davidchambers
Copy link
Member Author

This checks on of the boxes in #471!

I think I know which box you have in mind but I'm not certain, so I'll let you check it, Aldwin. :)

@davidchambers davidchambers merged commit 8529ef1 into master Apr 8, 2018
@davidchambers davidchambers deleted the davidchambers/unchecked branch April 8, 2018 21:22
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.

4 participants