Swiftpack.co - swifweb/web as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by swifweb.
swifweb/web 1.0.0-beta.1.17.0
🧱 Write your website in pure Swift with power of webassembly. DOM, CSS and all the WebAPIs are available out of the box.
⭐️ 56
🕓 4 days ago
.package(url: "https://github.com/swifweb/web.git", from: "1.0.0-beta.1.17.0")

SwifWeb

MIT License Swift 5.7 Swift.Stream

This library provides DOM, CSS and all possible web APIs beautifully wrapped into Swift ❤️

With it you will easily build your awesome reactive web app in beloved Swift ❤️

Installation

Go to webber repository and install it.

Usage

Clone spa or pwa template

Go to the project folder and open Package.swift to explore the code.

Then execute webber serve or webber serve -t pwa -s Service for the pwa app to debug your project in the browser.

Then take a look at the hidden .webber folder, you will find the entrypoint/dev folder where webber just generated entry files, you could edit these files if swift is not enough, e.g. to make you custom loading bar.

To release the project just call webber release or webber release -t pwa -s Service for pwa, and then grab production files from .webber/release folder.

Optimization

Lighthouse gives it 100 points and search engine crawlers works well with it too!

Lighthouse

// TODO: to be continued soon

GitHub

link
Stars: 56
Last commit: 20 hours ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

🪚 Allow to put `Style` into `@DOM` block
5 days ago
@DOM override var body: DOM.Content {
    Stylesheet {
        Rule(Body.pointer)
            .margin(all: 0.px)
            .padding(all: 0.px)
        MediaRule(.all.maxWidth(800.px)) {
            Rule(Body.pointer)
                .backgroundColor(0x9bc4e2)
        }
        MediaRule(.all.maxWidth(1200.px)) {
            Rule(Body.pointer)
                .backgroundColor(0xffd700)
        }
    }
    // ...other elements...
}

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics