This repository has been archived by the owner on Nov 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from Financial-Times/breaking
4.0.0 changes
- Loading branch information
Showing
18 changed files
with
1,439 additions
and
1,530 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
version: 2 | ||
jobs: | ||
test: | ||
docker: | ||
- image: circleci/node:10-browsers | ||
steps: | ||
- checkout | ||
- run: npm config set prefix "$HOME/.local" | ||
- run: npm i -g origami-build-tools@^7 | ||
- run: $HOME/.local/bin/obt install | ||
- run: $HOME/.local/bin/obt demo --demo-filter pa11y --suppress-errors | ||
- run: $HOME/.local/bin/obt verify | ||
- run: $HOME/.local/bin/obt test | ||
- run: git clean -fxd | ||
- run: npx occ 0.0.0 | ||
- run: $HOME/.local/bin/obt install --ignore-bower | ||
- run: $HOME/.local/bin/obt test --ignore-bower | ||
publish_to_npm: | ||
docker: | ||
- image: circleci/node:10 | ||
steps: | ||
- checkout | ||
- run: npx occ ${CIRCLE_TAG##v} | ||
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > $HOME/.npmrc | ||
- run: npm publish --access public | ||
workflows: | ||
version: 2 | ||
test: | ||
jobs: | ||
- test | ||
- publish_to_npm: | ||
filters: | ||
tags: | ||
only: /^v.*/ | ||
branches: | ||
ignore: /.*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
node_modules | ||
lcov-report | ||
lcov.info | ||
npm-debug.log | ||
/build | ||
.DS_Store | ||
.env | ||
/.sass-cache/ | ||
/bower_components/ | ||
/node_modules/ | ||
/build/ | ||
.idea/ | ||
/demos/local | ||
/coverage |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Migration | ||
|
||
## Migrating from v3 to v4 | ||
|
||
To support IE11 and other older browsers v4 requires the [Element.prototype.matches](https://polyfill.io/v3/url-builder/#Element.prototype.matches-polyfill) polyfill. | ||
|
||
It also uses [ES Modules over CommonJS](https://hacks.mozilla.org/2018/03/es-modules-a-cartoon-deep-dive/) syntax, and updates the default export to the constructor. We recommend to include `ftdomdelegate` using the es modules syntax. | ||
|
||
If you used the `.Delegate` constructor update your import: | ||
|
||
```diff | ||
-const Delegate = require('ftdomdelegate').Delegate; | ||
+import Delegate from 'ftdomdelegate'; | ||
let myDel = new Delegate(document.body); | ||
``` | ||
|
||
If you used the previous default export, also update to use the constructor: | ||
```diff | ||
-const delegate = require('ftdomdelegate'); | ||
-let myDel = delegate(document.body); | ||
+import Delegate from 'ftdomdelegate'; | ||
+let myDel = new Delegate(document.body); | ||
``` | ||
|
||
However to use the CommonJS syntax, without a plugin like [babel-plugin-transform-es2015-modules-commonjs](https://babeljs.io/docs/en/babel-plugin-transform-es2015-modules-commonjs), add `.default`. | ||
|
||
```diff | ||
-const Delegate = require('ftdomdelegate').Delegate; | ||
+const Delegate = require('ftdomdelegate').default; | ||
let myDel = new Delegate(document.body); | ||
``` | ||
|
||
## Migrating from v2 to v3 | ||
|
||
V3 is a name change and does not make any API changes. Replace `dom-delegate` in your `bower.json` with `ftdomdelegate`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "ftdomdelegate", | ||
"description": "Create and manage a DOM event delegator.", | ||
"main": "lib/delegate.js", | ||
"main": "main.js", | ||
"ignore": [".github", "test", ".npmignore", ".gitignore", "GruntFile.js"], | ||
"license": "MIT" | ||
} |
Oops, something went wrong.