Skip to content

Commit a8ac272

Browse files
authored
Support DOM data-* attributes (#102)
* Update dependencies * Add support for 'data-*' attributes
1 parent f09b25d commit a8ac272

File tree

9 files changed

+1486
-2939
lines changed

9 files changed

+1486
-2939
lines changed

bower.json

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
{
22
"name": "purescript-react-basic",
33
"license": "Apache-2.0",
4-
"ignore": ["**/.*", "node_modules", "bower_components", "output"],
4+
"ignore": [
5+
"**/.*",
6+
"node_modules",
7+
"bower_components",
8+
"output"
9+
],
510
"repository": {
611
"type": "git",
712
"url": "git://github.com/lumihq/purescript-react-basic.git"
@@ -13,10 +18,11 @@
1318
"purescript-exceptions": "^4.0.0",
1419
"purescript-functions": "^4.0.0",
1520
"purescript-nullable": "^4.1.0",
16-
"purescript-record": ">= 1.0.0 <3.0.0",
21+
"purescript-record": ">=1.0.0 <3.0.0",
1722
"purescript-unsafe-coerce": "^4.0.0",
18-
"purescript-web-dom": ">=1.0.0 <3.0.0",
23+
"purescript-web-dom": ">=1.0.0 <4.0.0",
1924
"purescript-web-html": ">=1.0.0 <3.0.0",
20-
"purescript-web-events": ">=1.0.0 <3.0.0"
25+
"purescript-web-events": ">=1.0.0 <3.0.0",
26+
"purescript-foreign-object": "^2.0.3"
2127
}
2228
}

codegen/consts.js

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ module.exports.typesByElement = {
2929
}
3030
};
3131
module.exports.types = {
32+
"_data": "Object String",
3233
"allowFullScreen": "Boolean",
3334
"allowTransparency": "Boolean",
3435
"async": "Boolean",

codegen/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const htmlHeader = `-- | ----------------------------------------
1111
module React.Basic.DOM.Generated where
1212
1313
import Data.Nullable (Nullable)
14+
import Foreign.Object (Object)
1415
import Prim.Row (class Union)
1516
import Web.DOM (Node)
1617
import React.Basic (JSX, Ref, element)
@@ -37,6 +38,7 @@ const svgHeader = `-- | ----------------------------------------
3738
3839
module React.Basic.DOM.SVG where
3940
41+
import Foreign.Object (Object)
4042
import Prim.Row (class Union)
4143
import React.Basic (JSX, element)
4244
import React.Basic.DOM.Internal (SharedSVGProps, unsafeCreateDOMComponent)
@@ -98,7 +100,7 @@ const generatePropTypes = (elements, props, sharedPropType) =>
98100

99101
return `
100102
type Props_${e} =${printRecord(e,
101-
(noChildren ? [] : ["children"]).concat(props[e] || [], props["*"] || []).sort()
103+
(noChildren ? [] : ["children", "_data"]).concat(props[e] || [], props["*"] || []).sort()
102104
)}
103105
104106
${symbol}

examples/async/src/AsyncCounter.purs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ asyncCounter = make component { initialState, render }
3737
, keyed (show self.state) $
3838
asyncWithLoader (R.text "Loading...") do
3939
liftEffect $ log "start"
40-
delay $ Milliseconds 2000.0
40+
delay $ Milliseconds 1000.0
4141
liftEffect $ log "done"
4242
pure $ R.text $ "Done: " <> show self.state
4343
]

0 commit comments

Comments
 (0)