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

Add clj-kondo support for cljs function schemas #833

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

dvingo
Copy link
Contributor

@dvingo dvingo commented Feb 1, 2023

Fixes #828

After lots of help from Thomas Heller here I was able to put together a much simpler dev experience for cljs.

This PR adds kondo config and updates the docs with Thomas' recommended setup using a preload and namespace ordering by the compiler to ensure your function schemas are up to date when malli.dev.cljs/start! is evaluated at compile-time.

I updated the kondo save! function to emit to a different location for clj and cljs schemas so you can seamlessly use both during development. Let me know if you have any concerns or feedback about that .

Copy link

@thheller thheller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small tweaks, then it should be fine.

src/malli/dev/cljs_kondo_preload.cljc Outdated Show resolved Hide resolved
src/malli/dev/cljs_kondo_preload.cljc Outdated Show resolved Hide resolved
app/malli/dev_preload.cljs Show resolved Hide resolved
src/malli/dev/cljs_kondo_preload.cljc Show resolved Hide resolved
src/malli/dev/cljs_kondo_preload.cljc Show resolved Hide resolved
@dvingo dvingo force-pushed the write-cljs-kondo-config3 branch from e392d0c to cca04b4 Compare February 1, 2023 16:20
@dvingo
Copy link
Contributor Author

dvingo commented Feb 1, 2023

Thanks @thheller ! updated per your feedback : )

@dvingo dvingo force-pushed the write-cljs-kondo-config3 branch from cca04b4 to 6f5c509 Compare February 1, 2023 16:48
Copy link

@thheller thheller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Although in plugin part you can just call the above function instead of repeating the code.

@dvingo dvingo force-pushed the write-cljs-kondo-config3 branch from 6f5c509 to 1c2a1ec Compare February 1, 2023 18:06
@dvingo
Copy link
Contributor Author

dvingo commented Feb 1, 2023

n part you can just call the above function instead of repeating the code.

ah of course - updated

@dvingo dvingo force-pushed the write-cljs-kondo-config3 branch from 1c2a1ec to 7f681d8 Compare February 1, 2023 18:45
@ikitommi ikitommi merged commit 0f2a4e8 into metosin:master Feb 2, 2023
@ikitommi
Copy link
Member

ikitommi commented Feb 2, 2023

This is really well though though, implemented and documented 🙇

@dvingo dvingo deleted the write-cljs-kondo-config3 branch May 5, 2023 16:13
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.

Add support for clj-kondo for cljs function schemas
3 participants