Skip to content

Commit 202f88b

Browse files
committed
Move URL used for fetching into fetcher.js directly to avoid config/environment bug
config/environment.js could be used for building (via meta tag) but not for tests. See: glimmerjs/glimmer-application-pipeline#89 Once this is fixed application environment configuration can be consolidated in one spot.
1 parent 09a98a4 commit 202f88b

File tree

5 files changed

+237
-238
lines changed

5 files changed

+237
-238
lines changed

Diff for: config/environment.js

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
module.exports = function(environment) {
44
let ENV = {
55
modulePrefix: 'vorfreude',
6-
IMAGE_ENDPOINT_URL: 'https://vorfreude.now.sh/',
76
environment
87
};
98

Diff for: ember-cli-build.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const json = require("rollup-plugin-json");
77

88
module.exports = function(defaults) {
99
let app = new GlimmerApp(defaults, {
10-
storeConfigInMeta: true,
10+
storeConfigInMeta: false,
1111
rollup: {
1212
plugins: [
1313
resolve({ jsnext: true, module: true, main: true }),

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "Vorfreude",
2+
"name": "vorfreude",
33
"version": "0.1.0",
44
"description": "A countdown with a fresh wallpapered tab on every new tab",
55
"directories": {

Diff for: src/utils/lib/fetcher.js

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
1-
import env from "../../../config/environment";
21
import { take, clone } from "ramda";
32
import shuffle from './shuffle';
43
import { SimpleIndexedDbAdapter } from "./storage";
54

6-
// `typeof env === 'function'`
7-
// this is an unfortunate hack of this file being used for two builds:
8-
//
9-
// 1. Glimmer App - it resolves the env for correct ember build environment
10-
//
11-
// 2. /chrome build via rollup - the build of background.js via roll up includes
12-
// this file for background fetching. The import of 'env' is then unresolved and
13-
// still a function that requires a string of the environment to retrieve the
14-
// configuration. In this type of build the environment should be assumed to be
15-
// production.
16-
const { IMAGE_ENDPOINT_URL } = typeof env === 'function' ? env('production') : env;
5+
const IMAGE_ENDPOINT_URL = 'https://vorfreude.now.sh/';
176

187
const highQualityImageUrlForPhoto = photo => photo.url_o;
198

0 commit comments

Comments
 (0)