Merge branch 'master' into events

This commit is contained in:
Wyatt Johnson
2018-01-31 12:58:53 -07:00
6 changed files with 82 additions and 27 deletions
@@ -0,0 +1,16 @@
/* global __webpack_public_path__ */ // eslint-disable-line no-unused-vars
import { getStaticConfiguration } from 'coral-framework/services/staticConfiguration';
// Load the static url from the static configuration.
const { STATIC_URL } = getStaticConfiguration();
// Update the static url for the imported public path so dynamically imported
// chunks will use the correct path as defined by the process.env.STATIC_URL
// that is provided dynamically from the template. This is a better solution to
// embedding the environment variables as changes won't require recompilation.
//
// The __webpack_public_path__ can be referenced:
// https://webpack.js.org/configuration/output/#output-publicpath
//
__webpack_public_path__ = STATIC_URL + 'static/';
+1 -23
View File
@@ -1,3 +1,4 @@
import { getStaticConfiguration } from 'coral-framework/services/staticConfiguration';
import { createStore } from './store';
import { createClient, apolloErrorReporter } from './client';
import pym from './pym';
@@ -22,27 +23,6 @@ import { createHistory } from 'coral-framework/services/history';
import { createIntrospection } from 'coral-framework/services/introspection';
import introspectionData from 'coral-framework/graphql/introspection.json';
/**
* getStaticConfiguration will return a singleton of the static configuration
* object provided via a JSON DOM element.
*/
const getStaticConfiguration = (() => {
let staticConfiguration = null;
return () => {
if (staticConfiguration != null) {
return staticConfiguration;
}
const configElement = document.querySelector('#data');
staticConfiguration = JSON.parse(
configElement ? configElement.textContent : '{}'
);
return staticConfiguration;
};
})();
/**
* getAuthToken returns the active auth token or null
* Note: this method does not have access to the cookie based token used by
@@ -103,8 +83,6 @@ export async function createContext({
token,
});
// Try to get an overrided liveUri from the static config, if none is found,
// build it.
let { LIVE_URI: liveUri } = getStaticConfiguration();
if (liveUri == null) {
// The protocol must match the origin protocol, secure/insecure.
@@ -0,0 +1,18 @@
/**
* getStaticConfiguration will return a singleton of the static configuration
* object provided via a JSON DOM element.
*/
let staticConfiguration = null;
export const getStaticConfiguration = () => {
if (staticConfiguration != null) {
return staticConfiguration;
}
const configElement = document.querySelector('#data');
staticConfiguration = JSON.parse(
configElement ? configElement.textContent : '{}'
);
return staticConfiguration;
};
+2
View File
@@ -45,3 +45,5 @@ items:
children:
- title: Migrating to v4.0.0
url: /migration/4/
- title: Migrating to v4.1.0
url: /migration/4.1/
+35
View File
@@ -0,0 +1,35 @@
---
title: Migrating to v4.1.0
permalink: /migration/4.1/
---
## Database Migrations
We have unified the database verifications that were introduced in 3.x.x into
the migration system. This unification unfortunately required a database
migration bump.
### Source
When running via source, you can run the following to start the migration
process:
```bash
./bin/cli migration run
```
This will prompt you to perform a database backup before starting the migration
process. Data loss is entirely possible otherwise.
{: .code-aside}
### Docker Compose
If you are running Talk with docker-compose, you can use the following command
to perform the migration:
```bash
docker-compose run --rm talk cli migration run
```
This will prompt you to perform a database backup before starting the migration
process. Data loss is entirely possible otherwise.
{: .code-aside}
+10 -4
View File
@@ -54,7 +54,7 @@ const config = {
target: 'web',
output: {
path: path.join(__dirname, 'dist'),
publicPath: '/static/',
publicPath: '',
filename: '[name].js',
chunkFilename: '[name].chunk.js',
},
@@ -249,13 +249,19 @@ const applyConfig = (entries, root = {}) =>
config,
{
entry: entries.reduce(
(entry, { name, path, disablePolyfill = false }) => {
(entry, { name, path: modulePath, disablePolyfill = false }) => {
const entries = [
path.join(__dirname, 'client/coral-framework/helpers/publicPath'),
];
if (disablePolyfill) {
entry[name] = path;
entries.push(modulePath);
} else {
entry[name] = ['babel-polyfill', path];
entries.unshift('babel-polyfill');
entries.push(modulePath);
}
entry[name] = entries;
return entry;
},
{}