aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHayleigh Thompson <me@hayleigh.dev>2022-05-14 06:55:29 +0100
committerHayleigh Thompson <me@hayleigh.dev>2022-05-14 06:55:29 +0100
commit377ce9404ed3fb1fabffa9d049b79fde0689de23 (patch)
treed6eb73472c9c5ae1acfa8a3322711aa25ef32a5d
parentad61d317f5c7482418902904fd70f0e2fd38afd6 (diff)
downloadlustre-377ce9404ed3fb1fabffa9d049b79fde0689de23.tar.gz
lustre-377ce9404ed3fb1fabffa9d049b79fde0689de23.zip
:bug: Fixed bug where FFI module was overwriting gleam module of the same name.
-rw-r--r--src/ffi.mjs (renamed from src/lustre.mjs)0
-rw-r--r--src/lustre.gleam2
-rw-r--r--src/lustre/element.gleam10
-rw-r--r--src/lustre/event.gleam2
4 files changed, 7 insertions, 7 deletions
diff --git a/src/lustre.mjs b/src/ffi.mjs
index 2352f01..2352f01 100644
--- a/src/lustre.mjs
+++ b/src/ffi.mjs
diff --git a/src/lustre.gleam b/src/lustre.gleam
index adba034..cfcf3da 100644
--- a/src/lustre.gleam
+++ b/src/lustre.gleam
@@ -80,4 +80,4 @@ pub fn start (program: Program(state, action), selector: String) -> Result(Nil,
external fn mount (program: Program(state, action), selector: String) -> Result(Nil, Nil)
- = "./lustre/ffi.mjs" "mount"
+ = "./ffi.mjs" "mount"
diff --git a/src/lustre/element.gleam b/src/lustre/element.gleam
index 48784ee..d5b23bf 100644
--- a/src/lustre/element.gleam
+++ b/src/lustre/element.gleam
@@ -16,7 +16,7 @@ pub external type Element(action)
/// child elements.
///
pub external fn node (tag: String, attributes: List(Attribute(action)), children: List(Element(action))) -> Element(action)
- = "../lustre.mjs" "node"
+ = "../ffi.mjs" "node"
/// A stateful element is exactly what it sounds like: some element with local
/// encapsulated state! The `render` function we must provide is called with the
@@ -27,18 +27,18 @@ pub external fn node (tag: String, attributes: List(Attribute(action)), children
/// Those are just regular Gleam functions that return `Element`s!
///
pub external fn stateful (init: state, render: fn (state, fn (state) -> Nil) -> Element(action)) -> Element(action)
- = "../lustre.mjs" "stateful"
+ = "../ffi.mjs" "stateful"
/// A fragment doesn't appear in the DOM, but allows us to treat a list of elements
/// as if it were a single one.
///
pub external fn fragment (children: List(Element(action))) -> Element(action)
- = "../lustre.mjs" "fragment"
+ = "../ffi.mjs" "fragment"
/// Render a Gleam string as an HTML text node.
///
pub external fn text (content: String) -> Element(action)
- = "../lustre.mjs" "text"
+ = "../ffi.mjs" "text"
// MANIPULATIONS ---------------------------------------------------------------
@@ -46,7 +46,7 @@ pub external fn text (content: String) -> Element(action)
/// Transforms the actions produced by some element.
///
pub external fn map (element: Element(a), f: fn (a) -> b) -> Element(b)
- = "../lustre.mjs" "map"
+ = "../ffi.mjs" "map"
// CONSTRUCTING NODES ----------------------------------------------------------
diff --git a/src/lustre/event.gleam b/src/lustre/event.gleam
index 088dfd0..451d598 100644
--- a/src/lustre/event.gleam
+++ b/src/lustre/event.gleam
@@ -2,7 +2,7 @@ import gleam/dynamic.{ Dynamic }
import lustre/attribute.{ Attribute }
pub external fn ignore () -> action
- = "../lustre.mjs" "ignore"
+ = "../ffi.mjs" "ignore"
pub fn on (name: String, handler: fn (Dynamic, fn (action) -> Nil) -> Nil) -> Attribute(action) {