Hi wise guys! Forgive my dummy question, but the thing is:
while trying to benefit from mithril talking to php backend (fatfree) i wanted to keep it simpler and didn't use npm, bundlers etc - just CDN way.
So i've tried much but simple application tutorial example didn't work for me. I work on localhost but want to keep my app-root neat.
Is it supposed to work this way (setting up framework just connecting to CDN) at all ?
But, generally would be great to have such an example (simple one) of mithril + php-tool dealing with mysql/sqlite..
Thanx a lot
@NetLancer AFAIK it should work. What isn't working?
@NetLancer I'm not completely sure I've understood what problems you ran into, but perhaps you could try the gitter chat for a more informal way of dealing with issues.
In general, mithril should work similarly or identically to other frontend javascript frameworks (taking into account the features it _supports_) wrt. server implementations, so outside of what's already in place (mithril-node-render) I don't feel the ROI of the core developers' efforts would be motivated.
Yeah, guess you are right about gitter in this case )).
But i've rechecked the code (simple app tutorial) i've typed and it works fine in case of npm based installation (webpack bundling the source into final *.js file usable), not just connecting front page to mithril CDN.
I must confess, i have no knowledge of other (even popular ones) js frameworks and probably need simpler explanations to learn the tool, but maybe it worth mentioning in mithril's tutorial section about pros & cons of alternative installation ways, for other newbies like me to save time :)
@NetLancer You could just make separate files and import them in your html file, just like mithril: <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mithril/2.0.4/mithril.min.js"></script>.
So for example <script type="text/javascript" src="userlist.js"></script>, in which you put var UserList = { ... }, etc. In app.js, which you import in the body, you then put the m.route code. You could also put everything in one file, if you wish.
This way it'll work without a bundler.
Here's the example html.
@NetLancer The tutorial is written from the context of you using a bundler. If you want an equivalent just using a global script, just add a <script> element loading Mithril from a CDN and then wherever it does import m from "mithril" or similar, just skip that line. It's pretty simple.
The docs could use some revision in this aspect to clarify this, though.