Niedzielski has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394475 )

Change subject: Chore: rename fetch-with-redirect to fetch
......................................................................

Chore: rename fetch-with-redirect to fetch

The fetch-with-redirect module wraps unfetch and throws non-2xx status
responses as exceptions. Since it's now more of a generic wrapper than
redirect-specific behavior, rename it to "fetch".

Change-Id: Ibff19e6bb965274f609a246aa9da109172ec07d7
---
R src/common/http/fetch.ts
M src/common/http/page-http-client.ts
M src/common/http/page-summary-http-client.ts
M src/common/pages/summary.tsx
M src/common/pages/wiki.tsx
M src/common/routers/router.test.ts
M src/common/routers/router.ts
M src/server/index.tsx
8 files changed, 7 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/75/394475/1

diff --git a/src/common/http/fetch-with-redirect.ts b/src/common/http/fetch.ts
similarity index 97%
rename from src/common/http/fetch-with-redirect.ts
rename to src/common/http/fetch.ts
index b4f3ce4..8fa568d 100644
--- a/src/common/http/fetch-with-redirect.ts
+++ b/src/common/http/fetch.ts
@@ -1,5 +1,3 @@
-// todo: rename this module.
-
 import * as unfetch from "isomorphic-unfetch";
 
 /** true if executing on server, false otherwise. */
diff --git a/src/common/http/page-http-client.ts 
b/src/common/http/page-http-client.ts
index 9c0b9d4..46d155e 100644
--- a/src/common/http/page-http-client.ts
+++ b/src/common/http/page-http-client.ts
@@ -9,7 +9,7 @@
 import { RESTBase } from "../marshallers/restbase";
 import HttpResponse from "./http-response";
 import { RESTBaseRedirect } from "./restbase-redirect";
-import { fetch } from "./fetch-with-redirect";
+import { fetch } from "./fetch";
 import reencodePathSegment from "./restbase-path-encoder";
 
 // 
https://en.wikipedia.org/api/rest_v1/#!/Mobile/get_page_mobile_sections_title_revision
diff --git a/src/common/http/page-summary-http-client.ts 
b/src/common/http/page-summary-http-client.ts
index edba132..230d151 100644
--- a/src/common/http/page-summary-http-client.ts
+++ b/src/common/http/page-summary-http-client.ts
@@ -4,7 +4,7 @@
 import { unmarshalPageSummary } from 
"../marshallers/page-summary/page-summary-unmarshaller"; // eslint-disable-line 
max-len
 import HttpResponse from "./http-response";
 import { RESTBaseRedirect } from "./restbase-redirect";
-import { fetch } from "./fetch-with-redirect";
+import { fetch } from "./fetch";
 import reencodePathSegment from "./restbase-path-encoder";
 
 // https://en.wikipedia.org/api/rest_v1/#!/Page_content/get_page_summary_title
diff --git a/src/common/pages/summary.tsx b/src/common/pages/summary.tsx
index cac2889..f7c0bce 100644
--- a/src/common/pages/summary.tsx
+++ b/src/common/pages/summary.tsx
@@ -10,7 +10,7 @@
 import ContentHeader from "../components/content-header/content-header";
 import ContentFooter from "../components/content-footer/content-footer";
 import HttpResponse from "../http/http-response";
-import { RedirectError } from "../http/fetch-with-redirect";
+import { RedirectError } from "../http/fetch";
 import { unmarshalPageTitleID } from 
"../marshallers/page-base/page-base-unmarshaller"; // eslint-disable-line 
max-len
 
 interface PageParams extends RouteParams {
diff --git a/src/common/pages/wiki.tsx b/src/common/pages/wiki.tsx
index 0df863c..0696bc7 100644
--- a/src/common/pages/wiki.tsx
+++ b/src/common/pages/wiki.tsx
@@ -10,7 +10,7 @@
 import ContentFooter from "../components/content-footer/content-footer";
 import ContentPage from "../components/content-page/content-page";
 import HttpResponse from "../http/http-response";
-import { RedirectError } from "../http/fetch-with-redirect";
+import { RedirectError } from "../http/fetch";
 import { Thumbnail } from "../components/thumbnail/thumbnail";
 import { unmarshalPageTitleID } from 
"../marshallers/page-base/page-base-unmarshaller"; // eslint-disable-line 
max-len
 
diff --git a/src/common/routers/router.test.ts 
b/src/common/routers/router.test.ts
index be9265b..139cfd0 100644
--- a/src/common/routers/router.test.ts
+++ b/src/common/routers/router.test.ts
@@ -4,7 +4,7 @@
 // import, given ts-node compiles files when required (inside the test if using
 // a dynamic import)
 import * as HomeModule from "../pages/home";
-import { RedirectError } from "../http/fetch-with-redirect";
+import { RedirectError } from "../http/fetch";
 
 import { newRoute } from "./route";
 import { newRouter } from "./router";
diff --git a/src/common/routers/router.ts b/src/common/routers/router.ts
index d062b80..4d62f66 100644
--- a/src/common/routers/router.ts
+++ b/src/common/routers/router.ts
@@ -10,7 +10,7 @@
 
 import notFoundPage from "../pages/not-found";
 import errorPage from "../pages/error";
-import { RedirectError } from "../http/fetch-with-redirect";
+import { RedirectError } from "../http/fetch";
 
 export interface RouteResponse<Props> {
   chunkName?: string;
diff --git a/src/server/index.tsx b/src/server/index.tsx
index f8d923c..c0f5e94 100644
--- a/src/server/index.tsx
+++ b/src/server/index.tsx
@@ -3,7 +3,7 @@
 import { h } from "preact";
 import { render as renderToString } from "preact-render-to-string";
 import { RouteResponse, newRouter } from "../common/routers/router";
-import { RedirectError } from "../common/http/fetch-with-redirect";
+import { RedirectError } from "../common/http/fetch";
 import { routes } from "../common/routers/api";
 import { SERVER_PORT, SERVER_URL } from "../common/assets/config";
 import HTMLPage from "./components/html-page";

-- 
To view, visit https://gerrit.wikimedia.org/r/394475
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibff19e6bb965274f609a246aa9da109172ec07d7
Gerrit-PatchSet: 1
Gerrit-Project: marvin
Gerrit-Branch: master
Gerrit-Owner: Niedzielski <[email protected]>
Gerrit-Reviewer: Sniedzielski <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to