This PR adds a directive transform to extract the style provided in :initial and bind it to the element during SSR, since there isn't really any documentation on writing a directive transform this was mostly trial and error to see what worked, while the code looks sloppy this does seem to work with my initial tests.
The implementation so far is still a work in progress as it doesn't handle the shorthand properties (such as x, y, etc.) that we normally support. Ideally I can add tests as well but setting up tests for SSR will probably be a challenge on its own, perhaps I can test the transform in isolation like https://github.com/intlify/vue-i18n-extensions does instead.
π Linked issue
58
β Type of change
π Description
I spent some time updating https://github.com/intlify/vue-i18n-extensions and tried to see what I could from it at the same time.
This PR adds a directive transform to extract the style provided in
:initial
and bind it to the element during SSR, since there isn't really any documentation on writing a directive transform this was mostly trial and error to see what worked, while the code looks sloppy this does seem to work with my initial tests.The implementation so far is still a work in progress
as it doesn't handle the shorthand properties (such as. Ideally I can add tests as well but setting up tests for SSR will probably be a challenge on its own, perhaps I can test the transform in isolation like https://github.com/intlify/vue-i18n-extensions does instead.x
,y
, etc.) that we normally supportπ Checklist