Possible need for a preprocessor
shirakaba opened this issue ยท 7 comments
See https://github.com/halfnelson/svelte-native-preprocessor:
It performs the following transforms to provide a better developer experience when using Svelte-Native:
- Adds
<svelte:options namespace="xmlns" />to the component, ensuring the generated code is compatible with svelte-native- Changes
bind:text="{email}"totext="{email}" on:textChanged="{e => email = e.value}"
We at least need the namespace aspect, as if PR sveltejs/svelte#5652 lands, we'll require such preprocessing in order to close https://github.com/shirakaba/svelte-nodegui/issues/9.
I'm unsure whether we'll need it for bind:text; I haven't yet tried that feature (and indeed may not be able to if event listener names are forced to lower case โ though I'm not sure of the casing used by NodeGUI yet).
@mrsauravsahu has taken on this task! I'll be checking it out later.
For the time being, the preprocessor sits here - https://github.com/mrsauravsahu/svelte-nodegui-preprocessor
It's a private repo. We need to discuss what's the best place to put this in.
I've made changes so that the "foreign" namespace gets injected with this preprocessor. We will merge this once we're able to integrate the preprocessor with svelte-nodegui.
Let me publish svelte-nodegui-preprocessor to npmjs so that we can use it here. We'll close this issue then.
@mrsauravsahu I've just published the first (alpha) release of Svelte NodeGUI, @nodegui/svelte-nodegui@0.0.1-alpha, to npm. Sorry for the wait! This may unblock you for publishing the preprocessor.
I've published the preprocessor and incorporated it into both this repo's playground app and the official svelte-nodegui-starter. It works perfectly, thanks @mrsauravsahu!
Ah thanks @shirakaba for taking the lead on this. Great to hear that! ๐