Skip to content

Conversation

@bennypowers
Copy link
Collaborator

The purpose of this PR is to move work on the es-modules branch from my fork to the main repo, in order to facilitate collaboration.

@bennypowers bennypowers merged commit 4aee6d9 into evilsoft:es-modules Apr 18, 2018
@karthikiyengar
Copy link
Collaborator

@bennypowers - I was wondering what the status of this PR is. Anything I could do to help get this to master?

@bennypowers
Copy link
Collaborator Author

I would love to revive this project.

Last I recalled this was slated for the next breaking change, but I'm not sure when that Is @evilsoft can help estimate?

I made some attempts at publishing an esm build of crocks, but they've fallen short for the time being (see esm-bundle/crocks#11 (comment))

So I'd really like to see crocks shipping esm sooner rather than later, as it remains a blocker for some at apollo-elements/apollo-elements#57

If there's consensus, we can try a non-breaking in-place transform by undertaking the following steps:

  1. Rewrite all src to es modules, as per this PR
  2. Use rollup to output CJS in-place as *.cjs files. e.g. under predicates, we'd have:
  • hasProp.js - es module
  • hasProp.cjs - cjs module
  • hasProp.spec.cjs - cjs tests
  1. Publish a point release

That last point I'm not 100% sure about. It may require (pun!) cjs-only users to require('crocks/**/*.cjs') with extension. We can experiment and try it out.

Having poked around a little bit, we could supply a snippet, or a side-effecting module which registers .cjs for older node versions in require.extensions

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.

2 participants