Skip to content
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

fix(form): independence from validator broken #136

Open
ayoayco opened this issue Oct 23, 2022 · 3 comments
Open

fix(form): independence from validator broken #136

ayoayco opened this issue Oct 23, 2022 · 3 comments

Comments

@ayoayco
Copy link
Member

ayoayco commented Oct 23, 2022

After implementing server-side rendered validation errors, the validator package was needed in form-control.ts

This breaks the independence of our packages.

Find a way such that validator is not a dependency of the form package: If the user did not install the validator package, then validation should simply be skipped. The question is, how do we dynamically import the validator package only if it is installed?

@ayoayco
Copy link
Member Author

ayoayco commented Oct 24, 2022

@ayoayco ayoayco pinned this issue Nov 5, 2022
@ayoayco ayoayco unpinned this issue Nov 5, 2022
@Lalit3716
Copy link
Member

Also, I think It would be nice if we could show users a warning in the terminal if they used validators in their form control but forgot to install the validator package!
Something like:

"Warning: Install @astro-reactive/validator to work with validators"?

@ayoayco
Copy link
Member Author

ayoayco commented Dec 8, 2022

Good idea, though we should think about logging in another issue. Maybe create a logger in the common package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants