Skip to content

Commit

Permalink
Support DOM data-* attributes (#102)
Browse files Browse the repository at this point in the history
* Update dependencies

* Add support for 'data-*' attributes
  • Loading branch information
megamaddu authored Aug 26, 2019
1 parent f09b25d commit a8ac272
Show file tree
Hide file tree
Showing 9 changed files with 1,486 additions and 2,939 deletions.
14 changes: 10 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"name": "purescript-react-basic",
"license": "Apache-2.0",
"ignore": ["**/.*", "node_modules", "bower_components", "output"],
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"output"
],
"repository": {
"type": "git",
"url": "git://github.com/lumihq/purescript-react-basic.git"
Expand All @@ -13,10 +18,11 @@
"purescript-exceptions": "^4.0.0",
"purescript-functions": "^4.0.0",
"purescript-nullable": "^4.1.0",
"purescript-record": ">= 1.0.0 <3.0.0",
"purescript-record": ">=1.0.0 <3.0.0",
"purescript-unsafe-coerce": "^4.0.0",
"purescript-web-dom": ">=1.0.0 <3.0.0",
"purescript-web-dom": ">=1.0.0 <4.0.0",
"purescript-web-html": ">=1.0.0 <3.0.0",
"purescript-web-events": ">=1.0.0 <3.0.0"
"purescript-web-events": ">=1.0.0 <3.0.0",
"purescript-foreign-object": "^2.0.3"
}
}
1 change: 1 addition & 0 deletions codegen/consts.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module.exports.typesByElement = {
}
};
module.exports.types = {
"_data": "Object String",
"allowFullScreen": "Boolean",
"allowTransparency": "Boolean",
"async": "Boolean",
Expand Down
4 changes: 3 additions & 1 deletion codegen/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const htmlHeader = `-- | ----------------------------------------
module React.Basic.DOM.Generated where
import Data.Nullable (Nullable)
import Foreign.Object (Object)
import Prim.Row (class Union)
import Web.DOM (Node)
import React.Basic (JSX, Ref, element)
Expand All @@ -37,6 +38,7 @@ const svgHeader = `-- | ----------------------------------------
module React.Basic.DOM.SVG where
import Foreign.Object (Object)
import Prim.Row (class Union)
import React.Basic (JSX, element)
import React.Basic.DOM.Internal (SharedSVGProps, unsafeCreateDOMComponent)
Expand Down Expand Up @@ -98,7 +100,7 @@ const generatePropTypes = (elements, props, sharedPropType) =>

return `
type Props_${e} =${printRecord(e,
(noChildren ? [] : ["children"]).concat(props[e] || [], props["*"] || []).sort()
(noChildren ? [] : ["children", "_data"]).concat(props[e] || [], props["*"] || []).sort()
)}
${symbol}
Expand Down
2 changes: 1 addition & 1 deletion examples/async/src/AsyncCounter.purs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ asyncCounter = make component { initialState, render }
, keyed (show self.state) $
asyncWithLoader (R.text "Loading...") do
liftEffect $ log "start"
delay $ Milliseconds 2000.0
delay $ Milliseconds 1000.0
liftEffect $ log "done"
pure $ R.text $ "Done: " <> show self.state
]
Expand Down
Loading

0 comments on commit a8ac272

Please sign in to comment.