Comments (6)
If it helps at all, I came across this issue while investigating this warning:
vite v5.1.3 building for production...
[plugin:vite:resolve] Module "node:dns/promises" has been externalized for browser compatibility, imported by "/node_modules/@vinejs/vine/build/chunk-TVEIURSI.js". See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
I've been playing with superforms (via formsnap). It's great! But I was puzzled where @vinejs was coming from, having not installed it. From: npm ls --all
I noticed a peer dependency.
I agree that (in my case) @vinejs won't be in the production bundle ... however its presence does seemingly result in that Vite warning while bundling it. Vine appears to be form validation focused on Node apps and so while they might change it at their end, not including it as a peer dependency would also avoid that warning. I would assume people would install their choice of validation library separately.
I do agree it's an enhancement since a warning isn't an error.
from sveltekit-superforms.
This is not accurate, the packages are only installed in a dev environment. Vite/Rollup will only bundle what's referenced in the project. For example, when I build with Valibot:
from sveltekit-superforms.
I've added a reproduction with screenshot - https://github.com/vladshcherbin/svelte-superforms.
From screenshot it's visible vite
is at least processing zod-to-json-schema
which is not used anywhere in the app.
From superforms & valibot dependency commit it's visible how many unused packages are installed which is also not desirable for the reasons above.
I'd be happy to help solve but have no idea except splitting adapters into different packages and install only needed e.g.
yarn add sveltekit-superforms sveltekit-superforms-adapters/valibot valibot
from sveltekit-superforms.
What's installed during development is not an issue, I'm concerned with the final bundle size. You can even look through the non-minified output to see that Zod is never referenced anywhere.
from sveltekit-superforms.
About the circular dependency, it doesn't happen with pnpm, so maybe it's a yarn issue.
from sveltekit-superforms.
Well, that's the best reproduction I can give. I do believe both issues should be solved and only required libraries be installed but I respect your opinion, direction and ideas.
Sorry for opening so many issues and thanks for the library, everything else seems to be working and simplifying forms is a huge relief 😇
Hopefully this ones can be resolved some day 🙌
from sveltekit-superforms.
Related Issues (20)
- Update CRUD tutorial to v2
- Binding to an optional checkbox item via a component field causes an infinite loop in SSR HOT 2
- Trouble using $posted store HOT 3
- Option for posting only tainted fields HOT 1
- Dates become undefined if schema validation produces error in form action HOT 3
- Add possibility to pass options to validation libraries (Valibot) HOT 3
- Circular dependency warning when using @sveltejs/adapter-node HOT 10
- formFieldProxy: Argument of type 'string' is not assignable to parameter of type 'never' HOT 13
- valibot: schema with nullable fields throws error on submit while equivalent schema in zod does not HOT 3
- Reset initial form data HOT 3
- How to dynamically add and remove text input fields correctly? HOT 1
- Dynamic Default Values? HOT 16
- Installing Superforms Causes Cloudflare Deployment to Fail HOT 7
- New reset-behaviour HOT 18
- Small typo in docs: reference to z despite switching the validation library to Joi HOT 2
- In SPA mode, navigating to a page that triggers a redirect inside `onUpdate` fails silently HOT 1
- TypeError: Cannot read properties of undefined (reading 'defaults') at Module.superValidate HOT 1
- Reverse In and Out type parameter in superForm return type HOT 1
- FormPathLeaves<FormObj, Date> = never HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sveltekit-superforms.