superviews.js
superviews.js copied to clipboard
Ability to import external modules
Wouldn't it be nice to have the ability to import external modules? Possible solution:
<script mode='hoisted'>
import * as R from 'ramda'
import anotherTemplate from './anotherTemplate.js'
</script>
Sorry for the late reply.
Yes I've had the same thought, I like your idea of using a mode attribute on the script tag.
My reservation has been that it doesn't encourage keeping code separate in respective .js and .html files. The same result can be achieved using this approach and passing in the imported dependencies as arguments or as part of a model.
<require from="./another"></require>
<require from="./resource.css!"></require>
import first the ".html" (template incremental converted to js by superviewsjs) and the .js with the same name by convention like Aurelia.
<require from="./another"></require>
import styles direct from template.
<require from="./resource.css!"></require>