Skip to content

Comments

Vite migration <- no behavioral changes.#27

Merged
technologic-technologic merged 4 commits into18-fix-dependencies-vulnerabilitiesfrom
26-migrate-app-from-cra-to-vite
Oct 15, 2025
Merged

Vite migration <- no behavioral changes.#27
technologic-technologic merged 4 commits into18-fix-dependencies-vulnerabilitiesfrom
26-migrate-app-from-cra-to-vite

Conversation

@technologic-technologic
Copy link
Owner

chore(build): migrate from CRA (react-scripts) to Vite (React + TS) — no functional changes

Important:

  • Need to fix tests ASAP

Key changes

  • Replace Create React App toolchain with Vite; keep the app logic, components, and UI unchanged.
  • Remove react-scripts; add vite and minimal Vite config.
  • Update npm scripts:
    • start → Vite dev server (vite) for local development (no build step).
    • buildvite build (no behavioral changes intended).
    • previewvite preview (for later, if needed).
  • Move to Vite’s project layout (e.g., index.html at root, same src/ code and assets).
  • No dependency upgrades beyond swapping the build tool.

More info below.

chore(build): migrate from CRA (react-scripts) to Vite (React + TS) — no functional changes

## Important:
- Need to fix tests ASAP

## Key changes
- Replace Create React App toolchain with Vite; keep the app logic, components, and UI unchanged.
- Remove `react-scripts`; add `vite` and minimal Vite config.
- Update npm scripts:
  - `start` → Vite dev server (`vite`) for local development (no build step).
  - `build` → `vite build` (no behavioral changes intended).
  - `preview` → `vite preview` (for later, if needed).
- Move to Vite’s project layout (e.g., `index.html` at root, same `src/` code and assets).
- No dependency upgrades beyond swapping the build tool.
Repository owner deleted a comment from github-actions bot Oct 11, 2025
@technologic-technologic technologic-technologic linked an issue Oct 11, 2025 that may be closed by this pull request
@technologic-technologic technologic-technologic added feature Work in progress. Adding new features. attention Important requirements labels Oct 11, 2025
Updated the default port in which te client runs to the specified in the requirements port 8080.

## Key changes
- Updated server to 8080 in vite.config.ts file.
- Upgraded proxy specifications to cleaner requests and behavior.

No breaking changes, yet.
Repository owner deleted a comment from github-actions bot Oct 12, 2025
* Fix multiple Api calls 

Fixed the bug where multiple calls to the backend where made for no reason

## Key changes
- Updated DataProvider
- Added exposed component to interact with the one and only DataContext context.

* Updated testing configuration

Upgraded the testing configuration to be compatible with vitest new variables, and avoid problems in the future.

## Key changes
- Updated gitignore to avoid constantly modifying package lock
- Commiting for the last time package-lock changes
- Added test parameters in app config to allow smooth testing
- Added jsdom dependency to devDependencies
-Added globals to frame config to allow testing, easier.


* Context testing

Added two more testing files to test the context, to make testing more robust.

## Key changes
- Created DataContext.test.tsx
- Created SearchContext.test.tsx

* Testing working again

Testing fixed after the migration from CRA to Vite.
For this fix was necessary to strengthen the contexts and all the components that make contact with the Api <- Refactored these files.
Added test script to package to allow npm to run the tests.

## Key changes
- Fixes InventoryTablePageSelector.test.tsx, InventoryTable.test.tsx, NewProductButton.test.tsx, ProductForm.test.tsx.
- Updated DataContext.test.tsx, SearchContext.test.tsx
- Refactored for the new context management:
   - InventoryTable.tsx,
   - InventoryTableObj.tsx,
   - InventoryTablePageSelector.tsx
   - EncoraContent.tsx

## Breaking or pending changes
- SearchBar component testing is still pending
- Update documentation to the new version

Signed-off-by: Leonardo Trevizo <leonardo.trevizo@encora.com>
Finally deleted this directory
Repository owner deleted a comment from github-actions bot Oct 15, 2025
@github-actions
Copy link

PR Summary

WHAT Changed

  • Deleted: documentation/documentation.docx
  • Modified: .gitignore in inventory-manager to include additional log files and exclude build artifacts.
  • Updated: README.md in inventory-manager to reflect a new setup with React, TypeScript, and Vite.
  • Added: eslint.config.js for ESLint configuration tailored for TypeScript and React.
  • Added: index.html as the entry point for the Vite application.
  • Deleted: jest.config.ts from inventory-manager.
  • Updated: package-lock.json with new dependencies and versions.

WHY It Matters

  • Transitioning to Vite improves the development experience with faster builds and hot module replacement (HMR).
  • The updated ESLint configuration enhances code quality and consistency, particularly for TypeScript and React projects.
  • The removal of Jest configuration suggests a shift away from Jest for testing, possibly indicating a new testing strategy.

RISKS

  • Potential issues with existing tests due to the removal of Jest configuration.
  • Developers may need to adapt to the new Vite setup, which could require changes in their workflow.
  • The deletion of the documentation file may lead to loss of important project information unless backed up elsewhere.

TESTS to Add

  • Integration tests for the new Vite setup to ensure that the application runs as expected.
  • Unit tests for any new components or features introduced in the updated README.

BREAKING CHANGES

  • Removal of Jest configuration may break existing tests that rely on Jest.
  • The project now requires Vite for building and serving, which may necessitate changes in local development setups.

Changed File Paths

  • documentation/documentation.docx
  • inventory-manager/.gitignore
  • inventory-manager/README.md
  • inventory-manager/eslint.config.js
  • inventory-manager/index.html
  • inventory-manager/jest.config.ts
  • inventory-manager/package-lock.json

@technologic-technologic technologic-technologic merged commit 62e9a36 into 18-fix-dependencies-vulnerabilities Oct 15, 2025
2 checks passed
@technologic-technologic technologic-technologic deleted the 26-migrate-app-from-cra-to-vite branch October 15, 2025 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

attention Important requirements feature Work in progress. Adding new features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate app from CRA to Vite

1 participant