Upgrade dependencies, etc. (#55)

* Run prettify

* Upgrade dependencies and switch out some libraries:

* timeago (freshly jquery dependent) -> ReactTimeAgo
* next-ga -> react-ga and custom plumbing

* Move static/ to public/static/

As per https://github.com/zeit/next.js/blob/master/errors/static-dir-deprecated.md

* Fix cons->icons typo

* Import only what's necessary from lodash (223 -> 180 kb)

* Asyncify MembershipInfoForm
This commit is contained in:
Aarni Koskela
2019-10-30 20:05:08 +02:00
committed by Riku Rouvila
parent db98341a51
commit dcf26deb0f
36 changed files with 3376 additions and 585 deletions

View File

@@ -1,16 +1,23 @@
import _ from "lodash";
import lodashTemplate from "lodash/template";
import defaultTemplateSettings from "lodash/templateSettings";
import githubEvent from "parse-github-event";
import twitterText from "twitter-text";
const isVisibleGithubEvent = ({ type }) =>
type !== "PushEvent" && type !== "DeleteEvent";
const templateSettings = {
...defaultTemplateSettings,
interpolate: /{{([\s\S]+?)}}/g,
};
export default {
github(items) {
return items.filter(isVisibleGithubEvent).map(item => {
_.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
const template = _.template(githubEvent.parse(item).text);
const template = lodashTemplate(
githubEvent.parse(item).text,
templateSettings
);
const repository = `https://github.com/${item.repo.name}`;
let branch;