Skip to content

Support DOM data-* attributes #102

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

Merged
merged 3 commits into from
Aug 26, 2019
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
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