refactor(core): log warnings for non-prod node envs

This commit is contained in:
Braks
2022-10-18 19:04:22 +02:00
parent 48366780ce
commit 395fcd2aab
10 changed files with 34 additions and 18 deletions
@@ -3,7 +3,7 @@ import type { CSSProperties, EffectScope } from 'vue'
import EdgeWrapper from '../../components/Edges/Wrapper'
import ConnectionLine from '../../components/ConnectionLine/ConnectionLine.vue'
import { useVueFlow } from '../../composables'
import { groupEdgesByZLevel } from '../../utils'
import { groupEdgesByZLevel, warn } from '../../utils'
import type { EdgeComponent, EdgeUpdatable, GraphEdge } from '../../types'
import { Slots } from '../../context'
import MarkerDefinitions from './MarkerDefinitions.vue'
@@ -107,7 +107,7 @@ const getType = (type?: string, template?: GraphEdge['template']) => {
const slot = slots?.[`edge-${name}`]
if (!slot?.({})) {
console.warn(`[vueflow]: Edge type "${type}" not found and no edge-slot detected. Using fallback type "default".`)
warn(`Edge type "${type}" not found and no edge-slot detected. Using fallback type "default".`)
return false
}