Upgrade packages, use cloudfront for data.json

This commit is contained in:
2019-06-08 10:49:28 -07:00
parent bd4d21b065
commit a6f73e7b45
4 changed files with 813 additions and 717 deletions

1502
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -10,22 +10,22 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "." "url": "git@git.frat.tech:aaron/ski.git"
}, },
"author": "Aaron Gutierrez", "author": "Aaron Gutierrez",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@types/react": "^16.7.18", "@types/react": "^16.8.19",
"@types/react-dom": "^16.0.11", "@types/react-dom": "^16.8.4",
"react": "^16.7.0", "react": "^16.8.6",
"react-dom": "^16.7.0" "react-dom": "^16.8.6"
}, },
"devDependencies": { "devDependencies": {
"awesome-typescript-loader": "^5.2.1", "awesome-typescript-loader": "^5.2.1",
"source-map-loader": "^0.2.4", "source-map-loader": "^0.2.4",
"typescript": "^3.2.2", "typescript": "^3.5.1",
"webpack": "^4.28.2", "webpack": "^4.33.0",
"webpack-cli": "^3.3.0", "webpack-cli": "^3.3.3",
"webpack-dev-server": "^3.1.14" "webpack-dev-server": "^3.7.1"
} }
} }

View File

@@ -32,7 +32,7 @@ export class Root extends React.PureComponent<Props, State> {
window.outerWidth, window.outerWidth,
document.getElementById("mount")!.clientWidth document.getElementById("mount")!.clientWidth
); );
} };
state: State = { state: State = {
gridHeights: [], gridHeights: [],
@@ -42,7 +42,7 @@ export class Root extends React.PureComponent<Props, State> {
componentDidMount() { componentDidMount() {
window window
.fetch(Model.dataUrl()) .fetch(Model.dataUrl)
.then(data => data.json()) .then(data => data.json())
.then(json => this.setState({ data: json })) .then(json => this.setState({ data: json }))
.then(this._loadHash) .then(this._loadHash)

View File

@@ -1,10 +1,6 @@
export const SIZES = [1600, 1200, 800, 600, 400, 200]; export const SIZES = [1600, 1200, 800, 600, 400, 200];
export function dataUrl() { export const dataUrl = "img/data.json";
return window.location.host === "ski.aarongutierrez.com"
? "https://s3-us-west-2.amazonaws.com/ski.aarongutierrez.com/img/data.json"
: "img/data.json";
}
export interface Data { export interface Data {
sets: ImageSet[]; sets: ImageSet[];