Implement basic code splitting

This commit is contained in:
Justin Hernandez
2025-07-28 09:40:54 -07:00
committed by Justin Hernandez
parent c269e66f10
commit 702e5096d5
23 changed files with 198 additions and 68 deletions

View File

@@ -0,0 +1,18 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
export const loadCryptoUtils = async () => {
const [elliptic, forge, ethers] = await Promise.all([
import('elliptic'),
import('node-forge'),
import('ethers'),
]);
return { elliptic, forge, ethers };
};
export const loadProvingUtils = async () => {
return Promise.all([
import('./proving/provingMachine'),
import('./proving/attest'),
import('./proving/validateDocument'),
]);
};

View File

@@ -7,7 +7,6 @@ import {
attributeToPosition_ID,
calculateUserIdentifierHash,
DEFAULT_MAJORITY,
DocumentCategory,
generateCircuitInputsDSC,
generateCircuitInputsRegister,
generateCircuitInputsVCandDisclose,
@@ -15,6 +14,9 @@ import {
hashEndpointWithScope,
ID_CARD_ATTESTATION_ID,
PASSPORT_ATTESTATION_ID,
} from '@selfxyz/common';
import type {
DocumentCategory,
PassportData,
SelfApp,
SelfAppDisclosureConfig,

View File

@@ -1,13 +1,10 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
import {
DocumentCategory,
EndpointType,
getCircuitNameFromPassportData,
getSolidityPackedUserContextData,
PassportData,
SelfApp,
} from '@selfxyz/common';
import type { DocumentCategory, EndpointType, PassportData, SelfApp } from '@selfxyz/common';
import forge from 'node-forge';
import socketIo, { Socket } from 'socket.io-client';
import { v4 } from 'uuid';

View File

@@ -1,11 +1,8 @@
// SPDX-License-Identifier: BUSL-1.1; Copyright (c) 2025 Social Connect Labs, Inc.; Licensed under BUSL-1.1 (see LICENSE); Apache-2.0 from 2029-06-11
import { WS_DB_RELAYER, WS_DB_RELAYER_STAGING } from '@selfxyz/common';
import type { EndpointType } from '@selfxyz/common';
import {
initElliptic,
WS_DB_RELAYER,
WS_DB_RELAYER_STAGING,
} from '@selfxyz/common';
import { initElliptic } from '@selfxyz/common';
import forge from 'node-forge';
const elliptic = initElliptic();

View File

@@ -13,9 +13,8 @@ import {
ID_CARD_ATTESTATION_ID,
parseCertificateSimple,
PASSPORT_ATTESTATION_ID,
type PassportData,
} from '@selfxyz/common';
import { DocumentCategory } from '@selfxyz/common';
import { DocumentCategory, PassportData } from '@selfxyz/common';
import { poseidon2, poseidon5 } from 'poseidon-lite';
import { DocumentEvents } from '../../consts/analytics';