housekeeping: bundle size reductions (#4713)
* set new bundlesize goal * preserve `GeneratorFunction` instead of all function names * use js-yaml fork that doesn't require esprima * set HTML content directly, instead of using React-Markdown * use remarkable for all Markdown rendering * add babel-plugin-transform-react-remove-prop-types * remove SplitPaneMode plugin * remove react-collapse * remove AST plugin, and yaml-js * trim Markdown HTML string output before rendering * disable obsolete function name preservation * add `getComponent` to propTypes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import YAML from "js-yaml"
|
||||
import YAML from "@kyleshockey/js-yaml"
|
||||
import { Map } from "immutable"
|
||||
import parseUrl from "url-parse"
|
||||
import serializeError from "serialize-error"
|
||||
@@ -80,7 +80,7 @@ export const parseToJson = (str) => ({specActions, specSelectors, errActions}) =
|
||||
|
||||
let hasWarnedAboutResolveSpecDeprecation = false
|
||||
|
||||
export const resolveSpec = (json, url) => ({specActions, specSelectors, errActions, fn: { fetch, resolve, AST }, getConfigs}) => {
|
||||
export const resolveSpec = (json, url) => ({specActions, specSelectors, errActions, fn: { fetch, resolve, AST = {} }, getConfigs}) => {
|
||||
if(!hasWarnedAboutResolveSpecDeprecation) {
|
||||
console.warn(`specActions.resolveSpec is deprecated since v3.10.0 and will be removed in v4.0.0; use requestResolvedSubtree instead!`)
|
||||
hasWarnedAboutResolveSpecDeprecation = true
|
||||
@@ -100,7 +100,7 @@ export const resolveSpec = (json, url) => ({specActions, specSelectors, errActio
|
||||
url = specSelectors.url()
|
||||
}
|
||||
|
||||
let { getLineNumberForPath } = AST
|
||||
let getLineNumberForPath = AST.getLineNumberForPath ? AST.getLineNumberForPath : () => undefined
|
||||
|
||||
let specStr = specSelectors.specStr()
|
||||
|
||||
@@ -149,7 +149,7 @@ const debResolveSubtrees = debounce(async () => {
|
||||
errSelectors,
|
||||
fn: {
|
||||
resolveSubtree,
|
||||
AST: { getLineNumberForPath }
|
||||
AST = {}
|
||||
},
|
||||
specSelectors,
|
||||
specActions,
|
||||
@@ -160,6 +160,8 @@ const debResolveSubtrees = debounce(async () => {
|
||||
return
|
||||
}
|
||||
|
||||
let getLineNumberForPath = AST.getLineNumberForPath ? AST.getLineNumberForPath : () => undefined
|
||||
|
||||
const specStr = specSelectors.specStr()
|
||||
|
||||
const {
|
||||
|
||||
Reference in New Issue
Block a user