Skip to content

Enhance Vite configuration and improve memory usage checks#621

Draft
Kolezhniuk wants to merge 5 commits intofeature/memory-scopingfrom
feat/esm-migration
Draft

Enhance Vite configuration and improve memory usage checks#621
Kolezhniuk wants to merge 5 commits intofeature/memory-scopingfrom
feat/esm-migration

Conversation

@Kolezhniuk
Copy link
Copy Markdown
Contributor

This pull request makes significant changes to the project's build system, testing setup, and configuration files, focusing on modernizing the toolchain, removing legacy and redundant files, and improving developer experience. The most important changes are the migration from Rollup to Vite for builds, switching from Mocha to Vitest for testing, updating ESLint configuration, and cleaning up old test and config files.

Build system modernization:

  • Migrated the build process from Rollup to Vite, updating all build scripts in package.json to use Vite commands for building Node, CLI, browser, and IIFE bundles. The old Rollup config files were removed. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]

Testing and CI improvements:

  • Replaced Mocha with Vitest for testing, updating scripts and dependencies accordingly. The GitHub Actions workflow was simplified to only run on Ubuntu with Playwright setup for browser tests, and legacy matrix jobs and browser/smart contract test jobs were removed. [1] [2] [3] [4] [5]
  • Removed the browser_tests and smart_contract_tests subprojects, including their configs, scripts, and dependencies, consolidating all tests under the main project. [1] [2] [3] [4] [5]

Linting and configuration updates:

  • Migrated ESLint configuration to the new flat config format in eslint.config.js, using the latest ESLint and @eslint/js, and updated ignored paths and rules. The old .eslintrc.cjs was removed. [1] [2]
  • Updated dependencies to use ESM-compatible versions and modernized packages, including @noble/hashes, ffjavascript, and others.

General project cleanup:

  • Updated the project version to 0.7.6-poc and adjusted the exports field in package.json for better module resolution. [1] [2]
  • Removed legacy or redundant files and configurations, such as old test runners, browser test HTML, and smart contract test configs. [1] [2] [3] [4] [5]

Smart contract testing update:

  • Migrated the Hardhat configuration to ESM and updated to use the latest Hardhat and plugin versions, consolidating Solidity compiler versions and plugin usage. [1] [2]

These updates collectively modernize the development workflow, improve maintainability, and streamline the project's configuration and testing infrastructure.

refactor: change logger parameter to unused in exportFFlonkVk function

fix: initialize variables pB and pS in zkey_new.js

style: format code for consistency in witness_calculator.cjs

test: update test timeouts to use beforeAll and afterAll hooks

feat: add Groth16 test suite for zkSNARK verification

feat: implement smart contract verifiers for Groth16, PLONK, and FFlonk

chore: add Vite configuration for building and testing
- Updated memory usage functions in `groth16_prove.js` and `zkey_new.js` to handle cases where the process object is undefined, ensuring compatibility in non-Node environments.
- Modified `vite.config.js` to exclude certain Node-only files from browser builds, preventing unnecessary dependencies from being included in the bundle.
- Added a plugin to stub Node-only modules, allowing for cleaner builds and avoiding errors related to missing modules in the browser context.
- Disabled minification in the browser build for easier debugging and added rollup options to manage external dependencies more effectively.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant