Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
* upstream/master:
  docs: Add information to README about Docker image & Docker Hub (Redocly#676)
  chore: Release 2.0.0-alpha.41 🔖
  chore: fix lint issue
  fix: add null check in dispose method (Redocly#675)
  chore: fix cli ts compiling
  • Loading branch information
williamboman committed Oct 19, 2018
2 parents c88b75b + 97db54a commit c7de164
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<a name="2.0.0-alpha.41"></a>
# [2.0.0-alpha.41](https://github.com/Rebilly/ReDoc/compare/v2.0.0-alpha.40...v2.0.0-alpha.41) (2018-10-18)


### Bug Fixes

* add null check in dispose method ([#675](https://github.com/Rebilly/ReDoc/issues/675)) ([6b7c5b7](https://github.com/Rebilly/ReDoc/commit/6b7c5b7))
* extensionHook not being used ([a4a4013](https://github.com/Rebilly/ReDoc/commit/a4a4013)), closes [#665](https://github.com/Rebilly/ReDoc/issues/665)
* fix issue with broken markdown caused by marked bug ([70cf293](https://github.com/Rebilly/ReDoc/commit/70cf293))

### Peer dependencies updates

* ReDoc now requires `styled-components@^4.0.1` to be installed if used as React component



<a name="2.0.0-alpha.40"></a>
# [2.0.0-alpha.40](https://github.com/Rebilly/ReDoc/compare/v2.0.0-alpha.39...v2.0.0-alpha.40) (2018-10-05)

Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[![Build Status](https://travis-ci.org/Rebilly/ReDoc.svg?branch=master)](https://travis-ci.org/Rebilly/ReDoc) [![Coverage Status](https://coveralls.io/repos/Rebilly/ReDoc/badge.svg?branch=master&service=github)](https://coveralls.io/github/Rebilly/ReDoc?branch=master) [![dependencies Status](https://david-dm.org/Rebilly/ReDoc/status.svg)](https://david-dm.org/Rebilly/ReDoc) [![devDependencies Status](https://david-dm.org/Rebilly/ReDoc/dev-status.svg)](https://david-dm.org/Rebilly/ReDoc#info=devDependencies) [![npm](http://img.shields.io/npm/v/redoc.svg)](https://www.npmjs.com/package/redoc) [![License](https://img.shields.io/npm/l/redoc.svg)](https://github.com/Rebilly/ReDoc/blob/master/LICENSE)

[![bundle size](http://img.badgesize.io/https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js?compression=gzip&max=300000)](https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js) [![npm](https://img.shields.io/npm/dm/redoc.svg)](https://www.npmjs.com/package/redoc) [![](https://data.jsdelivr.com/v1/package/npm/redoc/badge)](https://www.jsdelivr.com/package/npm/redoc)
[![bundle size](http://img.badgesize.io/https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js?compression=gzip&max=300000)](https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js) [![npm](https://img.shields.io/npm/dm/redoc.svg)](https://www.npmjs.com/package/redoc) [![](https://data.jsdelivr.com/v1/package/npm/redoc/badge)](https://www.jsdelivr.com/package/npm/redoc) [![Docker Build Status](https://img.shields.io/docker/build/redocly/redoc.svg)](https://hub.docker.com/r/redocly/redoc/)


</div>
Expand Down Expand Up @@ -186,6 +186,17 @@ You can also specify `onLoaded` callback which will be called each time Redoc ha
/>
```

## The Docker way

ReDoc is available as pre-built Docker image in official [Docker Hub repository](https://hub.docker.com/r/redocly/redoc/). You may simply pull & run it:

docker pull redocly/redoc
docker run -p 80:8080 redocly/redoc

Also you may rewrite some predefined environment variables defined in [Dockerfile](./Dockerfile). By default ReDoc starts with demo Petstore spec located at `http://petstore.swagger.io/v2/swagger.json`, but you may change this URL using environment variable `SPEC_URL`:

docker run -p 80:8080 -e SPEC_URL=https://api.example.com/openapi.json redocly/redoc

## ReDoc CLI

[See here](https://github.com/Rebilly/ReDoc/blob/master/cli/README.md)
Expand Down
4 changes: 2 additions & 2 deletions cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { renderToString } from 'react-dom/server';
import { ServerStyleSheet } from 'styled-components';

import { compile } from 'handlebars';
import { createServer, ServerRequest, ServerResponse } from 'http';
import { createServer, IncomingMessage, ServerResponse } from 'http';
import { dirname, join } from 'path';

import * as zlib from 'zlib';
Expand Down Expand Up @@ -258,7 +258,7 @@ async function getPageHTML(
// credits: https://stackoverflow.com/a/9238214/1749888
function respondWithGzip(
contents: string | ReadStream,
request: ServerRequest,
request: IncomingMessage,
response: ServerResponse,
headers = {},
) {
Expand Down
8 changes: 5 additions & 3 deletions src/services/AppStore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { observe } from 'mobx';
import { Lambda, observe } from 'mobx';

import { OpenAPISpec } from '../types';
import { loadAndBundleSpec } from '../utils/loadAndBundleSpec';
Expand Down Expand Up @@ -58,7 +58,7 @@ export class AppStore {
marker = new MarkerService();

private scroll: ScrollService;
private disposer;
private disposer: Lambda | null = null;

constructor(
spec: OpenAPISpec,
Expand Down Expand Up @@ -96,7 +96,9 @@ export class AppStore {
dispose() {
this.scroll.dispose();
this.menu.dispose();
this.disposer();
if (this.disposer != null) {
this.disposer();
}
}

/**
Expand Down

0 comments on commit c7de164

Please sign in to comment.