Skip to content
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

Next.js + Vercel! ▲ #1

Draft
wants to merge 48 commits into
base: latest
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
8917b5d
Installs Next.js, removes Babel, configures Emotion (what Simorgh use…
manovotny Aug 5, 2022
b918444
Fixes lint errors.
manovotny Aug 5, 2022
245e395
Attempting to fix import aliases.
manovotny Aug 5, 2022
2d90607
Adds custom webpack moment timezone config.
manovotny Aug 5, 2022
c9ff0a9
Missed asterisks. 🤦‍♂️
manovotny Aug 5, 2022
6eba7bb
Ignoring lint on build (at least for now).
manovotny Aug 5, 2022
8775285
Starts to wire things up, largely based on setting up React Context i…
manovotny Aug 9, 2022
eb4b6fd
RENDERING!!!
manovotny Aug 10, 2022
5d255a3
Filters page data.
manovotny Aug 10, 2022
d903cb0
Fixes missing `tz` (moment timezone) data at build time.
manovotny Aug 10, 2022
cd2a576
Changes hardcoded `/news` to dynamic service.
manovotny Aug 10, 2022
b2bd31e
Swaps `getServerSideProps` for `getStaticPaths` and `getStaticProps`.
manovotny Aug 11, 2022
97f7432
Inlines front page filtering.
manovotny Aug 12, 2022
165e4e3
Adds most read section.
manovotny Aug 12, 2022
1b223e4
Adds article route / page.
manovotny Aug 13, 2022
80dfa76
Comments out unused `OptimizelyPageViewTracking` import.
manovotny Aug 13, 2022
ba2a0ed
Fixes `manifest.json` error.
manovotny Aug 13, 2022
52fef75
Removes react-helmet.
manovotny Aug 13, 2022
cc7b0b9
Fixes `pathname` undefined.
manovotny Aug 13, 2022
55bc771
Fixes WebVitals error.
manovotny Aug 14, 2022
a896926
Fixes `mostRead` prop types error.
manovotny Aug 14, 2022
5de5fb4
Updates client environment variables.
manovotny Aug 15, 2022
5bacb15
Fixes prop type error.
manovotny Aug 15, 2022
8f5bc94
Fixes article data errors due to missing filters.
manovotny Aug 15, 2022
5431714
Adds `pageType` to page routes.
manovotny Aug 15, 2022
6128a03
Updates scripts to use next/script.
manovotny Aug 15, 2022
f418e99
Fixes toggles.
manovotny Aug 16, 2022
0831d7f
Creates fake api.
manovotny Aug 16, 2022
7c851d7
Changes logger to noop.
manovotny Aug 16, 2022
cb6b004
Cleans up scripts.
manovotny Aug 16, 2022
ba19ae5
Removes helmet dependency.
manovotny Aug 16, 2022
fe51f71
Removes react-router.
manovotny Aug 16, 2022
75b33a1
Removes webpack dependencies.
manovotny Aug 16, 2022
b597af4
Removes babel dependencies.
manovotny Aug 16, 2022
9edee97
Removes express dependencies.
manovotny Aug 16, 2022
ba9fe1b
Removes isomorphic-fetch.
manovotny Aug 16, 2022
05ba343
Removes dotenv.
manovotny Aug 16, 2022
71c9f66
Removes unnecessary files.
manovotny Aug 16, 2022
c8311b7
Moves statusCode to fake API and handles error page.
manovotny Aug 17, 2022
1b0a2ea
Fixes dangling comma in template literal script code.
manovotny Aug 18, 2022
3c36090
Fixes adcampaign.
manovotny Aug 18, 2022
7d80311
Fixes Optimizely.
manovotny Aug 19, 2022
c7d1914
Removes SWR.
manovotny Aug 20, 2022
2aeb8e4
Removes webpack scripts.
manovotny Aug 23, 2022
483c5b9
Uses `withOptimizelyProvider` HOC on ArticlePage instead.
manovotny Aug 23, 2022
fe685bf
Moves environment variables to Vercel.
manovotny Aug 23, 2022
5441a38
Fixes `manifest.json` link...again.
manovotny Aug 23, 2022
bee1f79
Adds a custom `_document.js` to handle dynamic `dir` and `lang` HTML …
manovotny Aug 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removes isomorphic-fetch.
manovotny committed Aug 16, 2022
commit ba9fe1b4a5e5fc34ed0e0701178f1a7ad0711b23
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -106,7 +106,6 @@
"gnu-terry-pratchett": "0.0.2",
"intersection-observer": "0.12.0",
"isarray": "2.0.5",
"isomorphic-fetch": "3.0.0",
"jalaali-js": "1.1.5",
"js-cookie": "3.0.1",
"json5": "^2.1.3",
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'isomorphic-fetch';
import path from 'ramda/src/path';

import getCookieOvenEndpoints from './getCookieOvenEndpoints';
1 change: 0 additions & 1 deletion src/app/legacy/containers/MostRead/Canonical/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useEffect, useState, useContext } from 'react';
import 'isomorphic-fetch';
import { oneOf, string, elementType, shape } from 'prop-types';
import { RequestContext } from '#contexts/RequestContext';
import { ServiceContext } from '#contexts/ServiceContext';
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useEffect, useState, useContext } from 'react';
import 'isomorphic-fetch';
import { string } from 'prop-types';
import styled from '@emotion/styled';
import moment from 'moment';
1 change: 0 additions & 1 deletion src/app/lib/analyticsUtils/sendBeacon/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import onClient from '../../utilities/onClient';
import nodeLogger from '../../logger.node';
import 'isomorphic-fetch';

const logger = nodeLogger(__filename);

Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'isomorphic-fetch';

import nodeLogger from '#lib/logger.node';
import {
INCLUDE_ERROR,
@@ -15,9 +13,6 @@ const fetchMarkup = async (url, assetId) => {
url,
});
try {
/* The timeout value here is arbitrary and subject to change. It's purpose is to ensure that pending promises do not delay page rendering on the server.
Using isomorphic-fetch means we use window.fetch, which does not have a timeout option, on the client and node-fetch, which does, on the server.
*/
const res = await fetch(url, {
headers: {
'User-Agent': 'Simorgh/ws-web-rendering',
1 change: 0 additions & 1 deletion src/app/routes/utils/fetchPageData/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'isomorphic-fetch';
import nodeLogger from '#lib/logger.node';
import {
DATA_FETCH_RESPONSE_TIME,
1 change: 0 additions & 1 deletion src/app/routes/utils/withRadioSchedule/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'isomorphic-fetch';
import nodeLogger from '#lib/logger.node';
import { getRadioScheduleEndpoint } from '#lib/utilities/getUrlHelpers/getRadioSchedulesUrls';
import { getQueryString } from '#lib/utilities/urlParser';
1 change: 0 additions & 1 deletion src/integration/utils/fetchDom.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable no-console */
const fetch = require('isomorphic-fetch');
const { JSDOM } = require('jsdom');
const retry = require('retry');

18 changes: 0 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -12910,16 +12910,6 @@ __metadata:
languageName: node
linkType: hard

"isomorphic-fetch@npm:3.0.0":
version: 3.0.0
resolution: "isomorphic-fetch@npm:3.0.0"
dependencies:
node-fetch: ^2.6.1
whatwg-fetch: ^3.4.1
checksum: e5ab79a56ce5af6ddd21265f59312ad9a4bc5a72cebc98b54797b42cb30441d5c5f8d17c5cd84a99e18101c8af6f90c081ecb8d12fd79e332be1778d58486d75
languageName: node
linkType: hard

"isstream@npm:~0.1.2":
version: 0.1.2
resolution: "isstream@npm:0.1.2"
@@ -18564,7 +18554,6 @@ __metadata:
inspectpack: 4.7.1
intersection-observer: 0.12.0
isarray: 2.0.5
isomorphic-fetch: 3.0.0
jalaali-js: 1.1.5
jest: 26.6.3
jest-fetch-mock: 3.0.3
@@ -21184,13 +21173,6 @@ __metadata:
languageName: node
linkType: hard

"whatwg-fetch@npm:^3.4.1":
version: 3.6.2
resolution: "whatwg-fetch@npm:3.6.2"
checksum: ee976b7249e7791edb0d0a62cd806b29006ad7ec3a3d89145921ad8c00a3a67e4be8f3fb3ec6bc7b58498724fd568d11aeeeea1f7827e7e1e5eae6c8a275afed
languageName: node
linkType: hard

"whatwg-mimetype@npm:^2.3.0":
version: 2.3.0
resolution: "whatwg-mimetype@npm:2.3.0"