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

Fixed new template re-compilation issue #176

Merged
merged 1 commit into from
May 1, 2024

Conversation

bcardarella
Copy link
Contributor

@bcardarella bcardarella commented May 1, 2024

If a new template was added when the Phoenix server is running that new template wasn't being picked up by the CodeReloader because it wasn't being tracked. The original implementation copy-pasta'd the Phoenix LiveView implementation which gets around this because the template names are known AOT even if the template doesn't exist yet so that @external_resource was tracked but in LVN because we incorporate the TARGET into the template name (i.e. home_live.swiftui+ios.neex) we cannot use this method. The solution was to implement __mix_recompile__? and track file collection hashes for comparing if a new file was added or not that should be treated as a template for the given LiveView Native Render Component

If a new template was added when the Phoenix server is running that new template
wasn't being picked up by the CodeReloader because it wasn't being tracked. The originaly implementation
copy-pasta'd the Phoenix LiveView implementation which gets around this because the template
names are known AOT even if the template doesn't exist yet so that `@external_resource` was tracked
but in LVN because we incorporate the TARGET into the template name (i.e. `home_live.swiftui+ios.neex`)
we cannot use this method. The solution was to implement `__mix_recompile__?` and track file collection
hashes for comparing if a new file was added or not that *should* be treated as a template for the
given LiveView Native Render Component
@bcardarella bcardarella force-pushed the bc-template-compile-issue branch from 0b8a86d to 858372f Compare May 1, 2024 14:09
@bcardarella bcardarella merged commit 0a589d8 into main May 1, 2024
1 check passed
@bcardarella bcardarella deleted the bc-template-compile-issue branch May 1, 2024 14: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.

1 participant