@khanacademy/wonder-blocks-core
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -132,2 +132,27 @@ // @flow | ||
switch (renderState) { | ||
// There are edge cases where for some reason, we get an unknown | ||
// context value here. So far it seems to be when we're nested in a | ||
// v1 WithSSRPlaceholder equivalent component, or in some older | ||
// React v16 situations where we're nested in the provider of a | ||
// different context. | ||
// | ||
// We ignore this from coverage. It's a maintenance case to help | ||
// us catch code changes that affect the control flow unexpectedly, | ||
// but it's not something we need to write a test case for. | ||
// | ||
/* istanbul ignore next */ | ||
default: | ||
// Let's log this case so we can debug it easily. | ||
// Then fall through to the root case. | ||
/* eslint-disable-next-line no-console */ | ||
console.log( | ||
`We got a render state we don't understand: "${JSON.stringify( | ||
renderState, | ||
)}"`, | ||
); | ||
// We "fallthrough" to the root case. This is more obvious | ||
// and maintainable code than just ignoring the no-fallthrough | ||
// lint rule. | ||
return this._maybeRender("root"); | ||
case "root": | ||
@@ -150,9 +175,2 @@ return this._renderAsRootComponent(); | ||
return children(); | ||
// We ignore this from coverage. It's a maintenance case to help | ||
// us catch code changes that affect the control flow unexpectedly, | ||
// but it's not something we need to write a test case for. | ||
/* istanbul ignore next */ | ||
default: | ||
throw new Error("We got a render state we don't understand"); | ||
} | ||
@@ -159,0 +177,0 @@ } |
@@ -1306,2 +1306,25 @@ import React__default, { createElement, Component, Fragment, createContext } from 'react'; | ||
switch (renderState) { | ||
// There are edge cases where for some reason, we get an unknown | ||
// context value here. So far it seems to be when we're nested in a | ||
// v1 WithSSRPlaceholder equivalent component, or in some older | ||
// React v16 situations where we're nested in the provider of a | ||
// different context. | ||
// | ||
// We ignore this from coverage. It's a maintenance case to help | ||
// us catch code changes that affect the control flow unexpectedly, | ||
// but it's not something we need to write a test case for. | ||
// | ||
/* istanbul ignore next */ | ||
default: | ||
// Let's log this case so we can debug it easily. | ||
// Then fall through to the root case. | ||
/* eslint-disable-next-line no-console */ | ||
console.log("We got a render state we don't understand: \"".concat(JSON.stringify(renderState), "\"")); // We "fallthrough" to the root case. This is more obvious | ||
// and maintainable code than just ignoring the no-fallthrough | ||
// lint rule. | ||
return this._maybeRender("root"); | ||
case "root": | ||
@@ -1325,10 +1348,2 @@ return this._renderAsRootComponent(); | ||
return children(); | ||
// We ignore this from coverage. It's a maintenance case to help | ||
// us catch code changes that affect the control flow unexpectedly, | ||
// but it's not something we need to write a test case for. | ||
/* istanbul ignore next */ | ||
default: | ||
throw new Error("We got a render state we don't understand"); | ||
} | ||
@@ -1335,0 +1350,0 @@ } |
{ | ||
"name": "@khanacademy/wonder-blocks-core", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"design": "v1", | ||
@@ -16,3 +16,3 @@ "publishConfig": { | ||
"dependencies": { | ||
"@khanacademy/wonder-blocks-spacing": "^2.0.13" | ||
"@khanacademy/wonder-blocks-spacing": "^2.0.14" | ||
}, | ||
@@ -19,0 +19,0 @@ "peerDependencies": { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
319580
6880