Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add continuous integration workflow #80

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copied from https://github.com/rustwasm/wasm-bindgen/blob/main/.github/workflows/main.yml
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master

env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup update --no-self-update stable && rustup default stable
- run: rustup target add wasm32-unknown-unknown
- name: Build
run: cargo build --all-targets --target wasm32-unknown-unknown
- name: Doc
run: cargo doc --no-deps --target wasm32-unknown-unknown
- name: Doc test
run: cargo test --doc
16 changes: 11 additions & 5 deletions src/fragment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl<'a> FragmentBuilder<'a> {
///
/// A fragment is a collection of children, you can use all of the methods in [`FragmentBuilder`]:
///
/// ```rust
/// ```no_compile
/// let x = fragment!({
/// .text("foo")
/// .child(html!("div", { ... }))
Expand All @@ -139,16 +139,20 @@ impl<'a> FragmentBuilder<'a> {
///
/// You can then insert the fragment into a [`DomBuilder`]:
///
/// ```rust
/// ```no_run
/// # use dominator::{html, fragment};
/// # fn test() -> dominator::Dom {
/// # let x = fragment!();
/// html!("div", {
/// .fragment(&x)
/// })
/// # }
/// ```
///
/// The fragment is inlined, so it is exactly the same as if you had written this,
/// there is no performance cost:
///
/// ```rust
/// ```no_compile
/// html!("div", {
/// .text("foo")
/// .child(html!("div", ...))
Expand All @@ -161,7 +165,7 @@ impl<'a> FragmentBuilder<'a> {
///
/// Fragments are very useful for passing children into another component:
///
/// ```rust
/// ```no_compile
/// Foo::render(&state.foo, fragment!({
/// .text("Hello!")
/// }))
Expand All @@ -184,6 +188,8 @@ impl<'a> FragmentBuilder<'a> {
/// When returning a fragment from a function, you will usually need to use the `move` syntax:
///
/// ```rust
/// # use dominator::{fragment, Fragment};
/// # fn some_string() -> String { "".to_string() }
/// fn my_fragment() -> impl Fragment {
/// let x = some_string();
///
Expand All @@ -210,7 +216,7 @@ macro_rules! fragment {
///
/// A [`BoxFragment`] can be stored in a `struct` or `static`:
///
/// ```rust
/// ```no_compile
/// static FOO: Lazy<BoxFragment> = Lazy::new(|| box_fragment!({ ... }));
/// ```
///
Expand Down
Loading