-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Migrate to mjs #276
Conversation
I've labelled this a breaking change, because the primary file names have changed. For users who would have had something like 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 Report
@@ Coverage Diff @@
## master #276 +/- ##
======================================
Coverage 100% 100%
======================================
Files 48 48
Lines 978 984 +6
Branches 0 210 +210
======================================
+ Hits 978 984 +6
Continue to review full report at Codecov.
|
You're unlikely to run out of major version numbers. 😄 |
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.
This is (kind-of) the long-awaited followup of 96e1b95!
This change allows Node 9+ and
esm
users toimport {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..js
file extensions renamed to.mjs
.mjs
files, nor can Istanbul. So the unit tests will now be run usingesm
with the approach suggested in Issue upgrading to 3.0.57 - "Must use import to load ES module" standard-things/esm#498 (comment).Closes #274