Commit graph

60 commits

Author SHA1 Message Date
Isiah Meadows
9f0dc2ab46
Runtime-deprecate ospec, change change-log to changelog, fix a few assorted bugs (#2578) 2020-09-29 13:27:07 -07:00
Isiah Meadows
31d1df5caa
Fix #2601 (#2603)
Fix issue where ending a stream in the middle of a stream callback would result in erroneous parent stream state for the rest of that emit.
2020-06-16 08:36:40 -07:00
Isiah Meadows
d4551f49f5
Add streams to releases again, include minified bundle, drop in… (#2539)
* Minify stream, add stream stuff to releases again

* Kill off a lot of tech debt, drop internal utilities from npm

1. Kill `module/`, internalize `bundler/`, privatize `test-utils/`

We've been telling people to move elsewhere from these for a while, and
it's about time we just pull the plug here and finally remove them.

- We officially removed the bundler from the public API in v2.0, and
  that was the only one of these that was ever publicly documented.
  Usage should be low enough by now it shouldn't break anyone- I'm not
  seeing bundler bugs being reported anymore, either.
- The `module/` utility was so narrow and caveat-filled that I'm not
  sure anyone really used it (even us core Mithril devs never really
  used it), and we only had it documented in the repo folder it lived
  in. I think only one bug was ever filed, and it's because it somehow
  ended up completely non-functional without any of us realizing it.
- The test utilities were meant to be internal from day 1, but people
  started using it despite us core developers constantly telling people
  to look elsewhere and even the docs recommending specific alternatives
  without mention of our internal mocks. (Now if people would RTFM,
  that'd be nice...)

2. Add dedicated HTML test files to verify ospec and the promise
   polyfill, and ensure the promise tests are in pure ES5.

These are made specially for those and should be much easier to just run
now.

3. Fix the benchmark script to use the real DOM in browsers and to not
   require as many dependencies to create. Also, tweak them to be much
   more effective and precise on what's being tested.

Previously, it was rendering to the HTML file itself, while now it's
rendering to the `body`. This means in browsers, it's triggering layout
and everything, benchmarking how well Mithril optimizes for style and
layout recalcs, too. It also puts some pressure on the hyperscript
parser attribute application, so that can be noticed as well.

* Update dependencies
2019-10-03 04:58:14 -04:00
Isiah Meadows
b98ab29efd
Make errors and their messages more accurate and helpful (#2536)
Also, I normalized them to all be sentences for consistency, and I moved
the reentrancy check from `m.mount` to `m.render` to be a little more
helpful. The router change during mounting is inconsequential and only
to avoid the new modified error, and the change to the update loop is to
send the original error if an error occurred while initializing the
default route. (This is all around more useful anyways.)

And while I was at it, I fixed an obscure bug with sync redraws.
2019-09-30 16:08:04 -04:00
Már Örlygsson
8ef0c2cd79 docs: Add release dates to all change-log files (#2513)
* docs: Add release dates to all change-log files

* docs: Add dates for the most recent releases

[skip ci]
2019-08-21 18:55:34 -04:00
Isiah Meadows
234b1c9302 Update migration, fix various minor issues
- Lot of people couldn't migrate to v1 and plan to reevaluate when v2 is
  released.
- It's "npm" not "NPM". It doesn't stand for anything, and it never
  has - it was initially chosen simply because it was easy to type.
  It has a lot of unofficial backronyms with "Node Package Manager"
  being one of the most common ones, but it's never officially stood
  for anything as an acronym *or* initialism.
- Fixed a few errors in the change log, like non-breaking changes being
  included in the "Breaking Changes" section and an inaccuracy in the
  summary of a particular change.
- Fixed RawGit URLs to point to GitHack, which is a lighter proxy that
  offloads caching to Cloudflare instead of also implementing it itself.
  (It also just uses nginx for all the important server logic, so it
  scales better.)
- Add a few more v0.2 references as appropriate
2019-07-24 05:01:20 -04:00
spacejack
61b087ea20 Conform stream.map to FL spec and clarify stream internal properties (#2481)
* Conform stream.map to FL spec. Clarify stream internal properties.

* Streamline ignoreInitial logic, code style edit
2019-07-23 02:35:50 -04:00
Isiah Meadows
0306401a76
Add missing line
Drive-by: fix formatting error in v2.0.0 section

Fixes #2418
2019-05-30 21:06:52 -04:00
Isiah Meadows
b17b00e9eb
Drop ESM support (#2366)
* Drop ESM support

* Add `"unpkg"` field
2019-05-29 09:24:10 -04:00
Isiah Meadows
beb129c5fb Prepare ospec@3.1.0, mithril-stream@2.0.0
Also, correct the change logs to be much more consistent between each
other and ensure the ospec and stream change logs are linked to from
Mithril's primary change log.
2019-02-07 04:10:12 -05:00
Gandalf-the-Bot
b33f10d29b Bundled output for commit 7eea1b1e62 [skip ci] 2019-02-07 08:46:35 +00:00
Ivan Kupalov
7eea1b1e62 Fix Stream.end() (#2369) 2019-02-07 03:44:31 -05:00
Isiah Meadows
08feb1795e Fix linter error 2019-02-05 11:27:54 -05:00
Gandalf-the-Bot
de2e60acb3 Bundled output for commit 2a9b3964ca [skip ci] 2019-02-05 16:06:41 +00:00
Isiah Meadows
2a9b3964ca Fix the Stream.HALT warning's condition
Previously, it warned on all *but* the first use, which is obviously
wrong. This corrects it to correctly fire on only the first use.
2019-02-05 11:03:50 -05:00
Gandalf-the-Bot
722a4f4af9 Bundled output for commit f30cf0afaa [skip ci] 2019-01-17 08:32:04 +00:00
Isiah Meadows
f30cf0afaa
Streams should be in ES5 2019-01-17 03:29:50 -05:00
Gandalf-the-Bot
ee232f00ff Bundled output for commit 23fe0a5ab1 [skip ci] 2019-01-10 04:12:06 +00:00
Adam Gamble
23fe0a5ab1 Fixed scan with skip (#2357)
* Fixed bad test for scan

The previous test didn't catch the fact that the accumulator had been
broke, it's value became the special value `SKIP`.

* Fixed Stream.scan() to accept SKIP value

* Update stream/stream.js

Dropped unnecessary ternary as suggested by @isiahmeadows

Co-Authored-By: gamb <adam@gamb.co>
2019-01-09 23:10:02 -05:00
Gandalf-the-Bot
843f420291 Bundled output for commit 922093f1ba [skip ci] 2018-12-04 20:13:40 +00:00
Gandalf-the-Bot
c6d6afbdfa Bundled output for commit bcc6003bf3 [skip ci] 2018-12-04 17:22:15 +00:00
Rasmus Porsager
58c86f7546 Rewrite stream (#2207)
* Rewrite stream

* Rename HALT to SKIP

* Rename HALT to SKIP

* Remove valueOf and toString

* Update docs for HALT to SKIP

* Rename halt to skip in test

* Add test for combining nested streams atomically

* Update change-log.md

* Test basic SKIP

* Add deprecated HALT

* Combine continues with ended streams

* Fix fantasy-land/of to match spec

* Don't use arrow function

* Improve scan description

* Fix merge artifact
2018-11-27 15:11:24 -05:00
Rasmus Porsager
c3896b92e6 output mithril, stream and ospec esm versions on build - fixes #2112 (#2194)
* output mithril, stream and ospec esm versions on build

* Add esm bundles

* [request] Clearer error message for JSON deserialization failure (#2195)

* Bundled output for commit fd7cf8041e [skip ci]

* Fix #1714 conditionally halting stream (#2200)

* Fix #1714 conditionally halting stream

* Add note in changelog

* Do not include stream as named export in mithril.esm.js

* Rename mithril.min.esm.js to mithril.esm.min.js

* Add esm files to eslintignore

* Add named exports

* Add hyperscript `m` as named export

* Add builds with export changes

* checkout regular bundled files

* Change .esm.js to .mjs

* Update pkg module to point to .mjs

* Fix for export names to avoid collision

* Updated bundled files
2018-11-14 15:37:08 -05:00
spacejack
76e585c523 Add Stream.lift (#1950)
* Add stream.lift and tests

* Add docs

* Add to change-log
2018-11-13 18:55:45 -05:00
Rasmus Porsager
d64e0a950f Fix #1714 conditionally halting stream (#2200)
* Fix #1714 conditionally halting stream

* Add note in changelog
2018-08-08 15:06:21 +01:00
Barney Carroll
e1a50890e9 stream: Removed valueOf & toString methods (fixes #2150) (#2151)
* stream: Removed `valueOf` & `toString` methods (fixes #2150)

* Update stream documentation
2018-05-16 00:01:30 +02:00
Adam Gamble
fb3c344055 Scan with halt (#1957)
* HALT if scan reducer doesn't change value

* Updated docs to reflect new scan behaviour with HALT
2018-05-03 16:52:33 +01:00
magikstm
e64a322bcf Correct test scripts 2017-12-30 04:44:00 -05:00
Pat Cavit
c7d72ba2de chore: mithril-stream@1.1.0 2017-07-12 21:04:09 -07:00
Pat Cavit
14726f7dd4 docs: add basic readme for mithril-stream 2017-07-12 21:04:09 -07:00
Pat Cavit
7abe16cdc9 chore: add license files to sub-packages 2017-07-12 21:04:09 -07:00
Pierre-Yves Gérardy
bc21be0880 Move "use strict" directive inside the stream IIFE #1831 2017-07-11 10:07:33 +02:00
Pat Cavit
bef58fdfa5 chore: Update repo references (#1834) 2017-05-02 09:24:12 -07:00
Pierre-Yves Gérardy
f272e36de0 Merge pull request #1738 from pygy/fix-stream-end-map
Fix stream end map
2017-03-26 21:31:13 +02:00
calainos
9d3d8774ac docs: Remove m.prop reference in error message (#1742)
Changing m.prop.combine and m.prop.merge to stream.combine and stream.merge
2017-03-24 15:32:11 -07:00
Pierre-Yves Gerardy
f22f884b1e Unregister the end streams after their dependents have run fix #1736 2017-03-24 22:29:43 +01:00
eladzlot
3578d0ffb3 added test for stream.end.map
Tests for issue #1736

Any maps set to the end stream do not get called.
In fact, for some reason adding a map to and end stream throws an error:

```
Cannot read property '_state' of undefined
    at updateDependency (/Users/eladzlot/www/mithril.js/stream/stream.js:46:20)
```
2017-03-24 11:53:54 +03:00
spacejack
683d85a952 refactor: Move scan and scanMerge to stream module (#1718) 2017-03-15 17:22:06 -07:00
Gyandeep Singh
daf5a64697 Chore: Fix lint issues and add indent with tabs 2017-03-11 15:54:41 -06:00
Isiah Meadows
934e0ac55e Merge branch 'next' into strict-mode 2017-03-09 11:54:32 -05:00
Pierre-Yves Gerardy
c3d015be28 IICE => IIFE 2017-03-04 23:24:21 +01:00
Pierre-Yves Gérardy
273d3d4740 Merge branch 'next' into next 2017-03-04 16:34:15 +01:00
Patrik Johnson
59ed3c7d48 Always expose stream on m.stream, use unpkg for docs (#1535)
... and document how streams are exposed in when loaded as <script> in global context
2017-03-04 16:27:02 +01:00
RobertAKARobin
23e4a57114 Put Stream in IIFE so variables aren't global
...when imported into the browser via <script> tags.
2017-03-03 20:44:41 -06:00
Isiah Meadows
1cc5fa5ba7 "use strict" and other linty fixes 2017-03-03 18:24:38 -05:00
Pat Cavit
e324cf6b91 feat: Make streams publishable to NPM (#1635) 2017-02-17 13:01:32 -08:00
Mikkel Bergmann
d1a3f7fe9b Make it work in a browser 2016-12-21 10:02:21 +11:00
eladzlot
3a1124f3ec simplify array operators in stream 2016-11-20 14:13:35 +02:00
Leo Horie
439cf95673 expose promise polyfill in a way that won't need code migration later 2016-11-16 21:15:23 -05:00
Leo Horie
5552ef31b1 lint 2016-11-15 23:20:22 -05:00