Closed msaraiva closed 2 years ago
Wow, amazing :D This PR reduces in our project the compile-connected deps from 800+ to just 4!! 🎉
We can say definitly it fixes #552 😉
I just tried updating to 0.8.2, but I get these weird dialyzer errors:
lib/my_web/some_file.ex:1:pattern_match
The pattern can never match the type.
Pattern:
false
Type:
true
I tried resetting the cache but it didn't help. Any idea?
Maybe it's because of the following new code?
imports_block =
quote do
if true do
unquote(imports)
end
end
The if
block there is just a simple way to scope the imports so they don't leak to the rest of the module. We just want to make sure we create the export
dependencies there. We don't need to actually import anything. I guess I'll have to replace that with something else that can satisfy dialyzer.
Any suggestion? I don't use dialyzer at all :)
Hmm... removing that if statement does not resolve the issue and I can't reproduce it in a new repo. Have to investigate this further... Makes me want to drop dialyzer altogether 😂
See #654, it's introduced in a commit before this PR
Removes
compile
deps from components and turn them intoexport
.The basic rules you can expect when changing a component from now on are:
render/1
, trigger recompilation only of the component itselftransform/1
, the behavior is exactly as an elixir macro, so it creates acompile
dep which keeps track of transitive compile-time deps.