Repository: plotly/dash
File: dash/dash-renderer/src/actions/callbacks.ts (TypeScript)

Code before:
            );
            outputs.push(outi);
            if (erri) {
                outputErrors.push(erri);
            }
        });

        if (outputErrors.length) {
            if (flatten(inVals).length) {
                refErr(outputErrors, paths);
            }
            // This case is all-empty multivalued wildcard inputs,
            // which we would normally fire the callback for, except
            // some outputs are missing. So instead we treat it like
            // regular missing inputs and just silently prevent it.
            return {
                ...cb,
                executionPromise: null
            };
        }

        const __execute = async (): Promise<CallbackResult> => {
            const loadingOutputs = outputs.map(out => ({
                path: getPath(paths, out.id),
                property: out.property?.split('@')[0],
                id: (window as any).dash_component_api.stringifyId(out.id)
            }));
            dispatch(loading(loadingOutputs));
            try {
                const changedPropIds = keys<string>(cb.changedPropIds);
                const parsedChangedPropsIds = changedPropIds.map(propId => {
                    if (propId.startsWith('{')) {
                        return parsePMCId(propId)[0];
                    }
                    return propId;
                });
                const payload: ICallbackPayload = {
                    output,
                    outputs: isMultiOutputProp(output) ? outputs : outputs[0],
                    inputs: inVals,
                    changedPropIds,
                    parsedChangedPropsIds,
                    state: cb.callback.state.length
                        ? fillVals(paths, layout, cb, state, 'State')
                        : undefined
                };

                if (clientside_function) {
                    try {
                        const data = await handleClientside(
                            dispatch,

Review comment (suggestion):
In the renderer we can use the one from:
`import {stringifyId} from './actions/dependencies';`

Code after:
            );
            outputs.push(outi);
            if (erri) {
                outputErrors.push(erri);
            }
        });

        if (outputErrors.length) {
            if (flatten(inVals).length) {
                refErr(outputErrors, paths);
            }
            // This case is all-empty multivalued wildcard inputs,
            // which we would normally fire the callback for, except
            // some outputs are missing. So instead we treat it like
            // regular missing inputs and just silently prevent it.
            return {
                ...cb,
                executionPromise: null
            };
        }

        const __execute = async (): Promise<CallbackResult> => {
            const loadingOutputs = outputs.map(out => ({
                path: getPath(paths, out.id),
                property: out.property?.split('@')[0],
                id: stringifyId(out.id)
            }));
            dispatch(loading(loadingOutputs));
            try {
                const changedPropIds = keys<string>(cb.changedPropIds);
                const parsedChangedPropsIds = changedPropIds.map(propId => {
                    if (propId.startsWith('{')) {
                        return parsePMCId(propId)[0];
                    }
                    return propId;
                });
                const payload: ICallbackPayload = {
                    output,
                    outputs: isMultiOutputProp(output) ? outputs : outputs[0],
                    inputs: inVals,
                    changedPropIds,
                    parsedChangedPropsIds,
                    state: cb.callback.state.length
                        ? fillVals(paths, layout, cb, state, 'State')
                        : undefined
                };

                if (clientside_function) {
                    try {
                        const data = await handleClientside(
                            dispatch,