-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replaces Webpack/Babel/Mocha with Vite/Vitest #485
Conversation
@ralexmatthews if you can patch up the code scanning issue, I'll take a look |
@Justintime50 fixed 👍 |
Dang it lol |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last time we attempted to overhaul the build system, we ran into issues once the final product was built, it couldn't be imported/referenced properly. Have we ensured that that issue is not a problem after these changes by running and E2E test by trying to import and use the final output of Vite?
Yea, I tested it with using actual API calls with a minimal project using node 12 and 22 and saw it working. I also checked node 10 and confirmed that did not work. Also, thats what the node-compatibility CI check is supposed to check for. So as far as I can tell, it has full compatibility with the current setup |
Description
Sorry, I was a dummy and accidentally closed #484 by deleting my own fork 🙃 so this is the exact same code, just on an easypost branch.
I decided to start with a much smaller problem to tackle, so this only removes Webpack/Babel/Mocha with Vite/Vitest. I chose Vite/Vitest because that it what Easy-UI uses for its builds and tests.
There is a lot of files changed, but all changes are actually pretty minimal. All this does really is:
this.
references in the testsAnd thats effectively it. All commands still work as is. There are no changes to the source, and the output file is effectively the same. This does mean that it hasn't fixed any of the weird issues with using the project in Next.js and stuff. That can come at a later date since that will likely require breaking changes to fix.
Overall, this removes like half of the project's deps, and with it, the security vulnerabilities in exchange for a modern toolset.
Testing
All unit tests are passing. In added another test/check specifically for checking compatibility with older node versions. It basically just imports the project and tries to create a test shipment. This makes it so we can test compatibility with old node versions while not requiring the toolchain to support old node versions.
I also tested it with using actual API calls with a minimal project using node 12 and 22 and saw it working. I also checked node 10 and confirmed that did not work.
Pull Request Type
Please select the option(s) that are relevant to this PR.