Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule ".well-known"]
path = .well-known
url = https://github.com/hyperpolymath/well-known-ecosystem.git
1 change: 1 addition & 0 deletions .well-known
Submodule .well-known added at fdb839
30 changes: 30 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SPDX-License-Identifier: MIT AND Palimpsest-0.8
# SPDX-FileCopyrightText: 2024 Jonathan D.A. Jewell

cff-version: 1.2.0
title: rescript-tea
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- family-names: Jewell
given-names: Jonathan D.A.
alias: Hyperpolymath
repository-code: https://github.com/hyperpolymath/rescript-tea
url: https://github.com/hyperpolymath/rescript-tea
abstract: >-
The Elm Architecture (TEA) for ReScript, providing a
principled way to build web applications with guaranteed
state consistency, exhaustive event handling, and
type-safe side effects.
keywords:
- rescript
- elm-architecture
- tea
- react
- functional-programming
- web-development
license: MIT
version: 0.1.0
date-released: 2024-12-06
39 changes: 39 additions & 0 deletions METADATA.dc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- SPDX-License-Identifier: MIT AND Palimpsest-0.8 -->
<!-- SPDX-FileCopyrightText: 2024 Jonathan D.A. Jewell -->
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/">

<!-- Core Dublin Core Elements -->
<dc:title>rescript-tea</dc:title>
<dc:creator>Jonathan D.A. Jewell</dc:creator>
<dc:subject>ReScript</dc:subject>
<dc:subject>Elm Architecture</dc:subject>
<dc:subject>TEA</dc:subject>
<dc:subject>React</dc:subject>
<dc:subject>Functional Programming</dc:subject>
<dc:subject>Web Development</dc:subject>
<dc:description>
The Elm Architecture (TEA) for ReScript, providing a principled way to
build web applications with guaranteed state consistency, exhaustive
event handling, and type-safe side effects.
</dc:description>
<dc:publisher>Hyperpolymath</dc:publisher>
<dc:contributor>Jonathan D.A. Jewell</dc:contributor>
<dc:date>2024-12-06</dc:date>
<dc:type>Software</dc:type>
<dc:format>application/javascript</dc:format>
<dc:identifier>https://github.com/hyperpolymath/rescript-tea</dc:identifier>
<dc:source>https://github.com/hyperpolymath/rescript-tea</dc:source>
<dc:language>en</dc:language>
<dc:rights>MIT License</dc:rights>

<!-- Dublin Core Terms (extended) -->
<dcterms:license>https://opensource.org/licenses/MIT</dcterms:license>
<dcterms:created>2024-12-06</dcterms:created>
<dcterms:modified>2024-12-27</dcterms:modified>
<dcterms:audience>Software Developers</dcterms:audience>
<dcterms:requires>ReScript 11+</dcterms:requires>
<dcterms:requires>React 19+</dcterms:requires>

</metadata>
23 changes: 12 additions & 11 deletions ROADMAP.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

== Current Status: Alpha (v0.1.0)

Core TEA implementation complete with basic subscriptions.
Core TEA implementation complete with HTTP, JSON decoding, and subscriptions.

== MVP 1.0 Release Checklist

Expand All @@ -15,24 +15,24 @@ Core TEA implementation complete with basic subscriptions.
|===
|Status |Item |Effort

|[ ]
|Unit tests for core modules (Tea_Cmd, Tea_Sub, Tea_Json)
|[x]
|Unit tests for core modules (Tea_Cmd, Tea_Json)
|Medium

|[ ]
|[x]
|Tea_Http module for HTTP requests
|Medium

|[ ]
|[x]
|HTTP example (fetch data, loading states, error handling)
|Small

|[ ]
|Fix ReactDOM.Style.make deprecation warnings
|[x]
|React 19 / ReScript 12 compatibility
|Small

|[ ]
|npm publish configuration (package.json fields, .npmignore)
|[x]
|npm publish configuration (package.json fields, files list)
|Small

|[ ]
Expand Down Expand Up @@ -161,13 +161,14 @@ Declarative animations:
=== Alpha (current)
- [x] Core modules compile
- [x] Basic example works
- [ ] Manual testing passes
- [x] Counter example
- [x] HTTP example

=== Beta (v0.9.0)
- [ ] All P0 items complete
- [ ] Unit test coverage > 70%
- [ ] CI passing
- [ ] npm installable
- [x] npm installable

=== Stable (v1.0.0)
- [ ] All P1 items complete
Expand Down
30 changes: 16 additions & 14 deletions docs/CITATIONS.adoc
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
= Rescript-TEA - Citation Guide
// SPDX-License-Identifier: MIT AND Palimpsest-0.8
// SPDX-FileCopyrightText: 2024 Jonathan D.A. Jewell
= rescript-tea - Citation Guide
:toc:

== BibTeX

[source,bibtex]
----
@software{rescript-tea_2025,
author = {Polymath, Hyper},
title = {Rescript-TEA},
year = {2025},
url = {https://github.com/hyperpolymath/Rescript-TEA},
license = {AGPL-3.0-or-later}
@software{rescript-tea_2024,
author = {Jewell, Jonathan D.A.},
title = {rescript-tea},
year = {2024},
url = {https://github.com/hyperpolymath/rescript-tea},
license = {MIT}
}
----

== Harvard Style

Polymath, H. (2025) _Rescript-TEA_ [Computer software]. Available at: https://github.com/hyperpolymath/Rescript-TEA
Jewell, J.D.A. (2024) _rescript-tea_ [Computer software]. Available at: https://github.com/hyperpolymath/rescript-tea

== OSCOLA

Hyper Polymath, 'Rescript-TEA' (2025) <https://github.com/hyperpolymath/Rescript-TEA>
Jonathan D.A. Jewell, 'rescript-tea' (2024) <https://github.com/hyperpolymath/rescript-tea>

== MLA

Polymath, Hyper. "Rescript-TEA." 2025, github.com/hyperpolymath/Rescript-TEA.
Jewell, Jonathan D.A. "rescript-tea." 2024, github.com/hyperpolymath/rescript-tea.

== APA 7

Polymath, H. (2025). _Rescript-TEA_ [Computer software]. GitHub. https://github.com/hyperpolymath/Rescript-TEA
Jewell, J.D.A. (2024). _rescript-tea_ [Computer software]. GitHub. https://github.com/hyperpolymath/rescript-tea

== See Also
== Machine-Readable Metadata

* link:../CITATION.cff[CITATION.cff]
* link:../codemeta.json[codemeta.json]
* link:../CITATION.cff[CITATION.cff] - Citation File Format (for GitHub)
* link:../METADATA.dc.xml[METADATA.dc.xml] - Dublin Core metadata
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "https://gitlab.com/hyperpolymath/rescript-tea"
"url": "https://github.com/hyperpolymath/rescript-tea"
},
"main": "lib/es6/src/Tea.res.mjs",
"files": [
Expand Down
9 changes: 8 additions & 1 deletion src/Tea_Html.res
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ type reactProps = {
mutable \"aria-hidden": option<bool>,
}

// Helper to set a data attribute on a props object
let setDataAttribute: (reactProps, string, string) => unit = %raw(`
function(props, key, value) {
props["data-" + key] = value;
}
`)

let emptyProps = (): reactProps => {
className: None,
id: None,
Expand Down Expand Up @@ -241,7 +248,7 @@ let attrsToProps = (attrs: array<attr<'msg>>, dispatch: 'msg => unit): reactProp
| Role(r) => props.role = Some(r)
| AriaLabel(label) => props.\"aria-label" = Some(label)
| AriaHidden(b) => props.\"aria-hidden" = Some(b)
| DataAttribute(_key, _value) => () // TODO: Handle data attributes
| DataAttribute(key, value) => setDataAttribute(props, key, value)
}
})
props
Expand Down
2 changes: 2 additions & 0 deletions src/Tea_Html.resi
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ let tabIndex: int => attr<'msg>
let role: string => attr<'msg>
let ariaLabel: string => attr<'msg>
let ariaHidden: bool => attr<'msg>

@ocaml.doc("Create a data-* attribute. Usage: data(\"testid\", \"my-button\") creates data-testid=\"my-button\"")
let data: (string, string) => attr<'msg>

// Events
Expand Down
Loading