Skip to content

Commit

Permalink
Release Artifacts for v2.1.0
Browse files Browse the repository at this point in the history
 [skip ci]

Release Artifacts for v2.2.0

 [skip ci]

Move the chat to Zulip (#2771)

Release Artifacts for v2.2.1

 [skip ci]

Fix malformed image tag

Turn README images from plain HTML to markdown (#2773)

Release Artifacts for v2.2.2

 [skip ci]

allow trailing slash for routes - fixes #2763

Kick promise polyfill

Remove a stale comment

This hasn't been true since v2.0

Kick jsonp - fixes #2682

inline obsolete factory

Add missing prerelease branch target.

Without specifying target:master the prerelease version calculation would be incorrect.

implement m.domFor() and use it internally to move and remove nodes. Fix #2780

Address review comments, linter and build concerns

Rename dom-for in file paths to domFor

Revert "Rename dom-for in file paths to domFor"

This reverts commit 5ab2752.

Rename dom-for in file paths to domFor

Simplify domFor logic
  • Loading branch information
JAForbes authored and barneycarroll committed Jun 10, 2022
1 parent bbf343b commit 4903234
Show file tree
Hide file tree
Showing 42 changed files with 1,054 additions and 2,264 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ jobs:
name: Setup NPM Auth
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npx pr-release infer-prerelease --preid=next --verbose --publish --minimize-semver-change
- run: npx pr-release infer-prerelease --preid=next --target master --source next --verbose --publish --minimize-semver-change
name: Publish
32 changes: 9 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
# Mithril.js

<p>
<a href="https://www.npmjs.com/package/mithril">
<img src="https://img.shields.io/npm/v/mithril.svg" alt="npm Version" />
</a>&nbsp;
<a href="https://github.com/MithrilJS/mithril.js/blob/next/LICENSE">
<img src="https://img.shields.io/npm/l/mithril.svg" alt="License" />
</a>&nbsp;
<a href="https://www.npmjs.com/package/mithril">
<img src="https://img.shields.io/npm/dm/mithril.svg" alt="npm Downloads">
</a>&nbsp;
<a href="https://www.npmjs.com/package/mithril">
<img src="https://img.shields.io/travis/MithrilJS/mithril.js/next.svg?colorB=brightgreen" alt="Build Status">
</a>&nbsp;
<a href="https://opencollective.com/mithriljs">
<img src="https://img.shields.io/opencollective/all/mithriljs.svg?colorB=brightgreen" alt="Donate at OpenCollective">
</a>&nbsp;
<a href="https://gitter.im/mithriljs/mithril.js">
<img src="https://img.shields.io/gitter/room/mithriljs/mithril.js.svg?logo=gitter" alt="Gitter" />
</a>
</p>
[![npm Version](https://img.shields.io/npm/v/mithril.svg)](https://www.npmjs.com/package/mithril) &nbsp;
[![License](https://img.shields.io/npm/l/mithril.svg)](https://github.com/MithrilJS/mithril.js/blob/next/LICENSE) &nbsp;
[![npm Downloads](https://img.shields.io/npm/dm/mithril.svg)](https://www.npmjs.com/package/mithril) &nbsp;
[![Build Status](https://img.shields.io/travis/MithrilJS/mithril.js/next.svg?colorB=brightgreen)](https://www.npmjs.com/package/mithril) &nbsp;
[![Donate at OpenCollective](https://img.shields.io/opencollective/all/mithriljs.svg?colorB=brightgreen)](https://opencollective.com/mithriljs) &nbsp;
[![Zulip, join chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://mithril.zulipchat.com/)

- [What is Mithril.js?](#what-is-mithriljs?)
- [Installation](#installation)
Expand All @@ -29,7 +15,7 @@

## What is Mithril.js?

A modern client-side JavaScript framework for building Single Page Applications. It's small (<!-- size -->10.05 KB<!-- /size --> gzipped), fast and provides routing and XHR utilities out of the box.
A modern client-side JavaScript framework for building Single Page Applications. It's small (<!-- size -->9.14 KB<!-- /size --> gzipped), fast and provides routing and XHR utilities out of the box.

Mithril.js is used by companies like Vimeo and Nike, and open source platforms like Lichess 👍.

Expand Down Expand Up @@ -71,11 +57,11 @@ You may be interested in the [API Docs](https://mithril.js.org/api.html), a [Sim

## Getting Help

Mithril.js has an active & welcoming community on [Gitter](https://gitter.im/mithriljs/mithril.js), or feel free to ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/mithril.js) using the `mithril.js` tag.
Mithril.js has an active & welcoming community on [Zulip](https://mithril.zulipchat.com/), or feel free to ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/mithril.js) using the `mithril.js` tag.

## Contributing

There's a [Contributing FAQ](https://mithril.js.org/contributing.html) on the Mithril.js site that hopefully helps, but if not definitely hop into the [Gitter Room](https://gitter.im/mithriljs/mithril.js) and ask away!
There's a [Contributing FAQ](https://mithril.js.org/contributing.html) on the Mithril.js site that hopefully helps, but if not definitely hop into the [Zulip stream](https://mithril.zulipchat.com/) and ask away!

---

Expand Down
1 change: 0 additions & 1 deletion api/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

var Vnode = require("../render/vnode")
var m = require("../render/hyperscript")
var Promise = require("../promise/promise")

var buildPathname = require("../pathname/build")
var parsePathname = require("../pathname/parse")
Expand Down
18 changes: 17 additions & 1 deletion api/tests/test-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ var m = require("../../render/hyperscript")
var coreRenderer = require("../../render/render")
var apiMountRedraw = require("../../api/mount-redraw")
var apiRouter = require("../../api/router")
var Promise = require("../../promise/promise")

o.spec("route", function() {
// Note: the `n` parameter used in calls to this are generally found by
Expand Down Expand Up @@ -209,6 +208,23 @@ o.spec("route", function() {
)
})

o("keeps trailing / in rest parameterized route", function() {
$window.location.href = prefix + "/test/d/"
route(root, "/test/:a...", {
"/test/:a..." : {
view: lock(function(vnode) {
return JSON.stringify(route.param()) + " " +
JSON.stringify(vnode.attrs) + " " +
route.get()
})
}
})

o(root.firstChild.nodeValue).equals(
'{"a":"d/"} {"a":"d/"} /test/d/'
)
})

o("handles route with search", function() {
$window.location.href = prefix + "/test?a=b&c=d"
route(root, "/test", {
Expand Down
2 changes: 1 addition & 1 deletion docs/animation.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ var FancyComponent = {

`vnode.dom` points to the root DOM element of the component (`<div class="fancy">`). We use the classList API here to add an `exit` class to `<div class="fancy">`.

Then we return a [Promise](promise.md) that resolves when the `animationend` event fires. When we return a promise from `onbeforeremove`, Mithril.js waits until the promise is resolved and only then it removes the element. In this case, it waits for the exit animation to finish.
Then we return a Promise that resolves when the `animationend` event fires. When we return a promise from `onbeforeremove`, Mithril.js waits until the promise is resolved and only then it removes the element. In this case, it waits for the exit animation to finish.

We can verify that both the enter and exit animations work by mounting the `Toggler` component:

Expand Down
15 changes: 0 additions & 15 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,6 @@ m.request({

---

#### m.jsonp(options) - [docs](jsonp.md)

```javascript
m.jsonp({
url: "/api/v1/users/:id",
params: {id: 1},
callbackKey: "callback",
})
.then(function(result) {
console.log(result)
})
```

---

#### m.parseQueryString(querystring) - [docs](parseQueryString.md)

```javascript
Expand Down
2 changes: 1 addition & 1 deletion docs/buildPathname.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Argument | Type | Required | Descripti

### How it works

The `m.buildPathname` creates a [path name](paths.md) from a path template and a parameters object. It's useful for building URLs, and it's what [`m.route`](route.md), [`m.request`](request.md), and [`m.jsonp`](jsonp.md) all use internally to interpolate paths. It uses [`m.buildQueryString`](buildQueryString.md) to generate the query parameters to append to the path name.
The `m.buildPathname` creates a [path name](paths.md) from a path template and a parameters object. It's useful for building URLs, and it's what [`m.route`](route.md) and [`m.request`](request.md) use internally to interpolate paths. It uses [`m.buildQueryString`](buildQueryString.md) to generate the query parameters to append to the path name.

```javascript
var pathname = m.buildPathname("/path/:id", {id: "user", a: 1, b: 2})
Expand Down
103 changes: 0 additions & 103 deletions docs/jsonp.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h1><img src="logo.svg"> Mithril [archive-docs]</h1>
<nav>
<a href="index.html">Guide</a>
<a href="api.html">API</a>
<a href="https://gitter.im/MithrilJS/mithril.js">Chat</a>
<a href="https://mithril.zulipchat.com/">Chat</a>
<a href="https://github.com/MithrilJS/mithril.js">GitHub</a>
</nav>
</section>
Expand Down
2 changes: 0 additions & 2 deletions docs/nav-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
- [m.mount](mount.md)
- [m.route](route.md)
- [m.request](request.md)
- [m.jsonp](jsonp.md)
- [m.parseQueryString](parseQueryString.md)
- [m.buildQueryString](buildQueryString.md)
- [m.buildPathname](buildPathname.md)
- [m.parsePathname](parsePathname.md)
- [m.trust](trust.md)
- [m.fragment](fragment.md)
- [m.redraw](redraw.md)
- [Promise](promise.md)
- Optional
- [Stream](stream.md)
- Tooling
Expand Down
6 changes: 3 additions & 3 deletions docs/paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Documentation on how to work with paths in Mithril.js

-----

[`m.route`](route.md), [`m.request`](request.md), and [`m.jsonp`](jsonp.md) each have a concept called a path. This is used to generate the URL you route to or fetch from.
[`m.route`](route.md) and [`m.request`](request.md) each have a concept called a path. This is used to generate the URL you route to or fetch from.

### Path types

Expand All @@ -20,7 +20,7 @@ There are two general types of paths: raw paths and parameterized paths.
- Raw paths are simply strings used directly as URLs. Nothing is substituted or even split. It's just normalized with all the parameters appended to the end.
- Parameterized paths let you insert values into paths, escaped by default for convenience and safety against URL injection.

For [`m.request`](request.md) and [`m.jsonp`](jsonp.md), these can be pretty much any URL, but for [routes](route.md), these can only be absolute URL path names without schemes or domains.
For [`m.request`](request.md) these can be pretty much any URL, but for [routes](route.md), these can only be absolute URL path names without schemes or domains.

### Path parameters

Expand All @@ -29,7 +29,7 @@ Path parameters are themselves pretty simple. They come in two forms:
- `:foo` - This injects a simple `params.foo` into the URL, escaping its value first.
- `:foo...` - This injects a raw `params.foo` path into the URL without escaping anything.

You're probably wondering what that `params` object is supposed to be. It's pretty simple: it's the `params` in either [`m.route.set(path, params)`](route.md#mrouteset), [`m.request({url, params})`](request.md#signature), or [`m.jsonp({url, params})`](jsonp.md#signature).
You're probably wondering what that `params` object is supposed to be. It's pretty simple: it's the `params` in either [`m.route.set(path, params)`](route.md#mrouteset), [`m.request({url, params})`](request.md#signature).

When receiving routes via [`m.route(root, defaultRoute, routes)`](route.md#signature), you can use these parameters to *extract* values from routes. They work basically the same way as generating the paths, just in the opposite direction.

Expand Down
Loading

0 comments on commit 4903234

Please sign in to comment.