Namespace your flux action types to prevent collisions:
function constants(namespace, constants) {
return Object.freeze(
constants.reduce((obj, constant) => {
return {
...obj,
[constant]: `${namespace}/${constant}`
}
const { createHttpLink } = require('apollo-link-http'); | |
const fetch = require('node-fetch'); | |
const store = require('store'); | |
const sourceNodes = require('gatsby/dist/utils/source-nodes'); | |
require('dotenv').config(); | |
const craftGqlUrl = process.env.CRAFT_GQL_URL; | |
const craftGqlToken = process.env.CRAFT_GQL_TOKEN; | |
module.exports = { |
Namespace your flux action types to prevent collisions:
function constants(namespace, constants) {
return Object.freeze(
constants.reduce((obj, constant) => {
return {
...obj,
[constant]: `${namespace}/${constant}`
}
This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.
In that post I talked about 3 main reasons for moving from require.js to webpack:
Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.
// see blog post: http://www.hiddentao.com/archives/2013/07/08/generate-overridable-getters-and-setters-in-javascript/ | |
Function.prototype.generateProperty = function(name, options) { | |
// internal member variable name | |
var privateName = '__' + name; | |
options = options || {}; | |
options.get = ('undefined' === typeof options.get ? true : options.get ); | |
options.set = ('undefined' === typeof options.set ? true : options.set ); | |
// pre-initialise the internal variable? |
The BugHerd sidebar can be configured to override some of its default behaviour as well as display extra information in any tasks that you pass in from a configuration object called BugHerdConfig
.
When setting up BugHerd for the first time, you probably already know you need to add the following code to your site:
<script type="text/javascript">
(function (d, t) {
var bh = d.createElement(t), s = d.getElementsByTagName(t)[0];