Help, I keep typing Metero
Today I had a very brief look at Meteor, which claims to be a “full-stack JavaScript platform for developing modern web and mobile applications” (source).
With a bunch of built-in packages, it helps to reduce the amount of repetitive grunt-work that you need whenever you start creating your full-stack app - logging, auth, emails, scheduling, pub/sub, databases.
Basically it seems to be a server framework (which is frontend framework agnostic), with a bunch of inbuilt functions.
Compared to Astro which is a static site framework, Meteor aims to provide a client-server solution
Security?
<script>
..
$m: tasks = TasksCollection.find({}, { sort: { createdAt: -1 } }).fetch()
</script>
..
I was abit concerned when I first saw that the tutorial essentially told the developer to write essentially what is server-side database logic in a client-exposed file.
Whilst they do eventually go on to talk about security fortifications by using ‘methods’, it only appears 6 sections after. Given my impatience (I read up on Meteor whilst procrastinating) it felt somewhat alarming that it wasn’t mentioned sooner - though I understand the ‘rapid prototyping’ nature that they’re going for..
Methods
https://svelte-tutorial.meteor.com/simple-todos/08-methods.html
Meteor implements a custom RPC mechanism called DDP - where methods are defined your shared-code, and via the the magic of RPC the code will execute on the server.
For spicy code that shouldn’t be revealed to the client (i.e. business logic), that code should be located within the server
directory, or be loaded by code that itself is only executed on the server. According to the docs, it seems that the page served to the client will have any server-esque imports stripped - but I haven’t tested it.
To define a method, you use the Meteor.methods()
function, and to call a method you’d use the Meteor.call()
function.
Hopefully IntelliSense will pick up on the defined methods and give you appropriate code suggestions?
Community
Despite my initial above concern regarding security, given that I didn’t properly read the getting started guide I can’t really fault them.
Meteor looks pretty well polished, and I’d definitely be willing to try it out for my next full-stack project…
Whenever that is…. these days I see myself building SPAs with no backend, or endpoints with proprietary protocols…
Times I misspelt “Meteor” and wrote “Metero” during this post: 14