SvelteKit and Meteor

I’m currently testing Meteor and Svelte and it seems to work very well. I’d love to use SvelteKit. Is this currently possible?

1 Like

Hi @seravault, Today you can use Meteor and Svelte together.

Is there anything special in SvelteKit that you needed to use it? What is your use case?

One possibility would be to use Meteor as a backend for your SvelteKit application.

2 Likes

@fredmaiaarantes , a couple things come to mind about being able to use SvelteKit. Routing just works and with regular achor tags. This is one of the things I like most about it. Layouts and slot too.

Routing:

Layout:

1 Like

Just tried out tinro with Meteor. It works with normal anchor tags and is easy to setup and use for navigation, active links and layouts.

I used pages as components to function as a slot of sorts inside my layout.
Here’s an example:

App.svelte

<script>
  import "../../client/main.css";
  import Layout from "./layouts/Layout.svelte";
</script>

<Layout />

Layout.svelte

<script>
    import Home from "../pages/home.svelte";
    import Test from "../pages/test.svelte";
    import { active } from "tinro";
</script>

<header>
    <nav>
        <a href="/" use:active exact>Home</a>
        <a href="/test" use:active exact>Test</a>
    </nav>
</header>

<main>

<Route path="/">
    <Home />
</Route>

<Route path="/test">
    <Test />
</Route>

</main>

<footer>This is the footer</footer>

<style>
    :global(.active) {
        text-decoration: underline;
    }
</style>

home.svelte

<script>
    import { Route } from "tinro";
</script>

<h1>Home page stuff</h1>

test.svelte

<script>
    import { Route } from "tinro";
</script>

<h1>Test page is here</h1>

2 Likes

Server-side rendering is the other benefit with SvelteKit. Built-in routing is handy but tinro has worked out pretty well so far.

3 Likes

Meteor should up game by including a default routing feature with all the latest jazz like route-based SSR, partial hydration, etc, otherwise someone else will in the near future along with a new reactive stack, and this will pose a threat to Meteor’s bread and butter.

1 Like