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

Migrate to mjs #276

Merged
merged 1 commit into from
Aug 29, 2018
Merged

Migrate to mjs #276

merged 1 commit into from
Aug 29, 2018

Conversation

Avaq
Copy link
Member

@Avaq Avaq commented Aug 28, 2018

This is (kind-of) the long-awaited followup of 96e1b95!

This change allows Node 9+ and esm users to import {named} from 'fluture'. However, unlike what I said in 96e1b95, I will continue to include a .js build in the published package until all major tooling has caught up with the new .mjs loader. The purpose of this change then becomes solely to support esm properly - something I thought was already the case after 96e1b95.


Closes #274

@Avaq Avaq added the breaking label Aug 28, 2018
@Avaq
Copy link
Member Author

Avaq commented Aug 28, 2018

I've labelled this a breaking change, because the primary file names have changed. For users who would have had something like import 'fluture/index.mjs.js', this will break their builds.

Generally we don't consider changes in file names breaking, unless those names were documented. But I think for the main files a major version bump might be wise.

@codecov
Copy link

codecov bot commented Aug 28, 2018

Codecov Report

Merging #276 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #276    +/-   ##
======================================
  Coverage     100%   100%            
======================================
  Files          48     48            
  Lines         978    984     +6     
  Branches        0    210   +210     
======================================
+ Hits          978    984     +6
Impacted Files Coverage Δ
src/dispatchers/alt.mjs 100% <ø> (ø)
src/encase-n2.mjs 100% <ø> (ø)
src/try-p.mjs 100% <ø> (ø)
src/dispatchers/and.mjs 100% <ø> (ø)
src/dispatchers/lastly.mjs 100% <ø> (ø)
src/cache.mjs 100% <ø> (ø)
src/dispatchers/both.mjs 100% <ø> (ø)
src/internal/utils.mjs 100% <ø> (ø)
src/dispatchers/map-rej.mjs 100% <ø> (ø)
src/future.mjs 100% <ø> (ø)
... and 39 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 489afd2...0aa28b3. Read the comment docs.

@davidchambers
Copy link
Contributor

But I think for the main files a major version bump might be wise.

You're unlikely to run out of major version numbers. 😄

@Avaq Avaq merged commit 7130b91 into master Aug 29, 2018
@Avaq Avaq deleted the avaq/mjs branch August 29, 2018 05:47
Avaq added a commit that referenced this pull request Aug 30, 2018
Breaking changes

- #276 The "module" package file has been renamed from index.mjs.js to index.mjs.
- #277 It is no longer possible to use Future.ap, Future.map, Future.bimap,
  Future.chain, or Future.alt on non-Fantasy Land types.
  If you were using any of these functions from Fluture to treat JavaScript's
  native types as Fantasy Land algebraic types, you should migrate those
  call-sites to use the Ramda or Sanctuary exported dispatchers instead.
- #281 Future.finally no longer runs the cleanup Future when it is cancelled.
  If you rely on this behaviour, I urge you to rewrite the relevant code with
  Future.hook (even if you don't upgrade Fluture).

New features

- #276 The Fluture source is now loadable by Node's experimental module loader,
  and the esm loader (https://github.com/standard-things/esm).
- #280 The Future.of function now has an alias 'resolve', which is exported
  statically as well as exposed as a property on the Future constructor.

Bug fixes and improvements

- #277 Fluture no longer depends on sanctuary-type-classes, reducing bundle size.
- #277 Performance of Fantasy Land dispatchers greatly improved.
- #281 The undesired consequences of the cancellation-related behaviour in
  Fluture.finally are gone now that the behaviour has been removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants