Skip to content

[Not ready to merge] Migrating AttrName, ClassName, and PropName to web-dom. #82

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ New features:
Bugfixes:

Other improvements:
- `AttrName`, `ClassName`, and `PropName` types have been migrated to [web-dom](https://github.com/purescript-web/purescript-web-dom) but are re-exported to avoid breaking compatibility. See also purescript-web/purescript-web-dom#58. (#82 by @nsaunders)

## [v4.1.0](https://github.com/purescript-web/purescript-web-html/releases/tag/v4.1.0) - 2022-09-19

Expand Down
5 changes: 4 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@
],
"dependencies": {
"purescript-js-date": "^8.0.0",
"purescript-web-dom": "^6.0.0",
"purescript-web-dom": "https://github.com/nsaunders/purescript-web-dom.git#8b1dfaa5cd",
"purescript-web-file": "^4.0.0",
"purescript-web-storage": "^5.0.0"
},
"resolutions": {
"purescript-web-dom": "8b1dfaa5cd"
}
}
31 changes: 2 additions & 29 deletions src/Web/HTML/Common.purs
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
module Web.HTML.Common where
module Web.HTML.Common (module Exports) where

import Prelude

import Data.Newtype (class Newtype)

-- | A wrapper for property names.
-- |
-- | The phantom type `value` describes the type of value which this property
-- | requires.
newtype PropName :: Type -> Type
newtype PropName value = PropName String

derive instance newtypePropName :: Newtype (PropName value) _
derive newtype instance eqPropName :: Eq (PropName value)
derive newtype instance ordPropName :: Ord (PropName value)

-- | A wrapper for attribute names.
newtype AttrName = AttrName String

derive instance newtypeAttrName :: Newtype AttrName _
derive newtype instance eqAttrName :: Eq AttrName
derive newtype instance ordAttrName :: Ord AttrName

-- | A wrapper for strings which are used as CSS classes.
newtype ClassName = ClassName String

derive instance newtypeClassName :: Newtype ClassName _
derive newtype instance eqClassName :: Eq ClassName
derive newtype instance ordClassName :: Ord ClassName
import Web.DOM.Element (AttrName(..), ClassName(..), PropName(..)) as Exports