Skip to content
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

v3.0 #318

Merged
merged 69 commits into from
Sep 15, 2021
Merged

v3.0 #318

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
79bc2b5
Initial configuration update for v3.0
nfrasser Mar 3, 2021
8cb87e0
Internal refactors
nfrasser Mar 3, 2021
22b9882
Second pass OOP-free refactor with tests
nfrasser Mar 4, 2021
cfa765e
Fastest working implementation without pre-build step
nfrasser Mar 5, 2021
d01eb9b
Update benchmarks
nfrasser Mar 6, 2021
bdf6e6a
Working default regex scanner/token implementation
nfrasser Mar 6, 2021
8ebaccc
Emoji IDN support
nfrasser Mar 6, 2021
e6ef2f4
Cleanup scanner and TLDs
nfrasser Mar 6, 2021
d0cb706
Implement delayed initialization
nfrasser Mar 7, 2021
25fce7a
Fix plugin implementations
nfrasser Mar 7, 2021
3976cd4
core-js based linkify polyfill
nfrasser Mar 7, 2021
ba20855
Interfaces and options fixes
nfrasser Mar 8, 2021
88001ff
Fixed public interface
nfrasser Mar 8, 2021
8fe0639
Config updates
nfrasser Mar 8, 2021
8b6b18b
Initial v3 changelog
nfrasser Mar 8, 2021
050ba13
Update CHANGELOG.md
nfrasser Mar 8, 2021
49e90b7
Additional lint fixes
nfrasser Mar 8, 2021
5440ddf
Use self-published linkify-html
nfrasser Mar 8, 2021
570a238
Tweak test runner
nfrasser Mar 8, 2021
c2df857
Fix Qunit tests
nfrasser Mar 8, 2021
c1a0065
Bump version, update packages
nfrasser Mar 8, 2021
f7f0982
WIP README and CHANGELOG
nfrasser Mar 8, 2021
6c13e81
chore: typo in CHANGELOG.md (#320)
jacekkarczmarczyk Mar 9, 2021
d63734c
Add start and end index for where tokens are found
nfrasser Mar 11, 2021
5fc899f
Oops fixed interface import statements
nfrasser Mar 11, 2021
aeb2f60
Update CHANGELOG.md
nfrasser Mar 11, 2021
40e50bb
v3.0.0-beta.2
nfrasser Mar 11, 2021
cf36a80
Handle HTML with doctype
nfrasser Mar 11, 2021
b3caa77
Ensure doesn't crash on mixed-language input
nfrasser Mar 11, 2021
fcd1e49
Merge remote-tracking branch 'origin/master' into v3.0
nfrasser Mar 11, 2021
68c886f
Don't recognize strings that start with // valid URLs
nfrasser Mar 11, 2021
ff2f8cd
Support for custom protocols
nfrasser Mar 11, 2021
4db1c55
Update changelog
nfrasser Mar 11, 2021
73d8cb3
v3.0.0-beta.3
nfrasser Mar 11, 2021
d148d56
Fix punctuation/spelling
nfrasser Mar 21, 2021
3ad2447
Support emails with apostrophe
nfrasser Mar 21, 2021
e9787d4
Expose additional printable characters as scanner tokens
nfrasser Mar 21, 2021
ff540ef
Test fixes
nfrasser Mar 21, 2021
9bd59ca
Install request module
nfrasser Mar 21, 2021
8f42b48
Oops fix incorrect test run flag
nfrasser Mar 21, 2021
5da9137
Additional CI script fixes
nfrasser Mar 21, 2021
769a5ae
Change prepare script to prepack
nfrasser Mar 22, 2021
72a3d74
Attempt coveralls fix
nfrasser Mar 22, 2021
f41b5e2
Do build when doing running test suite
nfrasser Mar 22, 2021
7d97811
Remove unnecessary copyfiles
nfrasser Mar 22, 2021
ebf3f49
Drop Node 8 support
nfrasser Mar 22, 2021
7ef800e
Refactor linkify into multi-package monorepo
nfrasser Apr 4, 2021
6ec32dc
Refactor String -> Array conversion to avoid need for polyfill
nfrasser Apr 4, 2021
7bf46a1
Fix typo in test run bash file
nfrasser Apr 4, 2021
b7d420f
Fix linting rules
nfrasser Apr 4, 2021
a0102f7
Fix test require issue
nfrasser Apr 4, 2021
5f50b4a
Manual workspace setup in CI
nfrasser Apr 4, 2021
e733651
Special build command for CI
nfrasser Apr 4, 2021
3b44a3d
Remove now-unnecessary helper files
nfrasser Apr 4, 2021
a0723dc
Remove additional polyfill references
nfrasser Apr 4, 2021
d13dc32
Various typo and text fixes
nfrasser Apr 13, 2021
989cfa7
Fix bug with heart emojis
nfrasser Apr 18, 2021
f35b205
Cache addition to .gitignore
nfrasser Apr 18, 2021
213c705
Upgrade deps
nfrasser May 2, 2021
a5140ad
Replace SauceLabs with BrowserStack
nfrasser Aug 17, 2021
97a1fa0
Merge remote-tracking branch 'origin/master' into v3.0
nfrasser Aug 17, 2021
f8f61b6
Complete v3.0 testing fixes and integration
nfrasser Aug 17, 2021
fa74297
Implement react component as regular function
nfrasser Aug 27, 2021
59d1f66
Auto-generate typescript declarations
nfrasser Aug 27, 2021
c3672c5
Fix react test
nfrasser Aug 27, 2021
03da1e0
Bring back React span wrapper for React 15
nfrasser Aug 27, 2021
b1b3617
Final or near-final draft of README and CHANGELOG
nfrasser Sep 14, 2021
580987c
README files for sub-packages
nfrasser Sep 14, 2021
0963ca0
Add additional CHANGELOG item
nfrasser Sep 15, 2021
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
6 changes: 0 additions & 6 deletions .babelrc

This file was deleted.

8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@ insert_final_newline = true
[*.yml]
indent_style = space
tab_width = 2

[*.md]
indent_style = space
tab_width = 2

[package.json]
indent_style = space
tab_width = 2
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*/lib/*
*/dist/*

# Usually auto-generated
**/index.js
28 changes: 13 additions & 15 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
{
"extends": [
"eslint:recommended"
"eslint:recommended",
"plugin:mocha/recommended"
],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"parser": "@babel/eslint-parser",
"env": {
"browser": true,
"node": true,
"jquery": true,
"es6": true,
"amd": true
"amd": true,
"mocha": true
},
"rules": {
"curly": 2,
"eqeqeq": 2,
"no-eq-null": 2,
"quotes": [2, "single", "avoid-escape"],
"semi": 2
"semi": 2,
"no-unused-vars": [ "error", { "varsIgnorePattern": "should|expect" }],
"mocha/no-mocha-arrows": 0
},
"plugins": [
"mocha",
"@babel"
],
"globals": {
"__base": false,
"__TLDS__": false,
"after": false,
"afterEach": false,
"before": false,
"beforeEach": false,
"expect": false,
"describe": false,
"it": false
"expect": false
}
}
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Node.js CI
name: Continuous Integration

on:
push:
Expand Down Expand Up @@ -38,4 +38,13 @@ jobs:

- run: npm install
- run: bash test/setup.sh ${{ matrix.node-version }}
- run: bash run-tests.sh ${{ matrix.node-version }}
- run: bash test/run.sh ${{ matrix.node-version }}
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}

- name: Coveralls GitHub Action
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ build
dist
lib
vendor
*.tar.gz
*.tgz

# IntelliJ
.idea
Expand All @@ -52,6 +54,10 @@ vendor

# Specific to plugin website branch
.sass-cache
.jekyll-cache
_site
_sass
js

# Generated typescript declarations
*.d.ts
1 change: 1 addition & 0 deletions .mocharc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require: '@babel/register'
13 changes: 9 additions & 4 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ test
vendor

# Files
.babelrc
*.md
*.yml
*.tar.gz
*.tgz
.tags*
.babelrc*
.eslintrc*
.editorconfig
.eslintrc
.travis.yml
bower.json
gulpfile.js
testem.json
run-tests.sh
*.config.js*
tasks
88 changes: 69 additions & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,73 @@
# Linkify Changelog

### v2.1.9
## v3.0.0

### BREAKING CHANGES
* React, jQuery and Element interfaces moved to dedicated packages at `linkify-react`,`linkify-jquery` and `linkify-element` respectively:
* Remove default `class="linkified"` from all discovered links. Opt back in by setting the `className` option:
```js
linkifyStr(str, { className: 'linkified' })
```
* Remove default `target="_blank"` attribute for discovered URLs. Opt back in by setting the `target` option:
```js
linkifyHtml(str, {
target: (href, type) => type === 'url' && '_blank'
})
```
* React component: Remove outer `<span>` tag wrapper in favour of tag-less `React.Fragment` for React >=16. To opt back-in, set `tagName='span'`:
```jsx
<Linkify tagName='span'>{content}</Linkify>
```
* AMD module interface is no longer provided. Use an ESM bundler instead.
* Plugins imported after linkify is called on a string for the first time will not longer work. Import all plugins _before_ calling a linkify core or interface function.
* Custom plugin API is not compatible with previous API in Linkify v2
* Dropped support for Internet Explorer versions 9 and 10. IE11 is still supported
* Dropped support for React versions <15

### Deprecations
* Use dedicated packages `linkify-string` and `linkify-html` instead of `linkifyjs/string` and `linkifyjs/html`. The embedded packages will be removed in v4.0
* Use dedicated plugin packages `linkify-plugin-[PLUGIN]` instead of `linkifyjs/plugin/[PLUGIN]`. The embedded packages will be removed in v4.0

### All Changes
* Full Internationalized Domain (IDN) and Emoji domain support 🇺🇳🌍✈️🎉💃! Detect URLs, #hashtags and @mentions in any language
* ~10x faster startup; ~4x faster combined startup + first run
* Custom protocols with `linkify.registerCustomProtocol('protocol')`
* Modernized codebase and build system
* Add new `rel` option at top level as an alternate way of including it in `attributes`
* New and improved plugin API
* TypeScript definitions included in published packages
* `linkify.find()` output includes start and end indexes for where in the string a link was found
* Plugins no longer need to be called on linkify after import
```js
// Before
import * as linkify from 'linkifyjs'
import hashtag from 'linkifyjs/plugins/hashtag'
hashtag(linkify)

// After
import * as linkify from 'linkifyjs'
import 'linkifyjs/plugins/hashtag'
```


## v2.1.9

* Move optional dependencies to peerdependencies (#282)
* Fix `npm install` displays vulnerabilities. (#265)
* Fix typo (#275)

### v2.1.8
## v2.1.8

* Allow mentions with inner @ sign for federated mentions - thanks @juliushaertl!
* Drop official support for Internet Explorer 8 and Node.js 6 (still supported unofficially but may break in future releases)
* Update dev dependencies

### v2.1.7
## v2.1.7

* Update dependencies (#243)
* Ignore .babelrc file (854e6fc)

### v2.1.6
## v2.1.6

* Fix a bug where unique element IDs aren't unique (#215)
* Update tlds.js (#213)
Expand All @@ -26,11 +76,11 @@
* Use Object.defineProperty to extend String prototype so that 'linkify' function is not enumerable (#197)
* Allow null overrides in options for target and className (#189)

### v2.1.5
## v2.1.5

* React plugin compatibility updates

### v2.1.4
## v2.1.4

* Add explicit support for mailto: addresses (#186)
* Add support for mentions containing dots (#185)
Expand All @@ -39,29 +89,29 @@
* Drop deprecated babel-preset-es2015-loose dependency (#172)
* Web workers support (#168)

### v2.1.3
## v2.1.3

* Links in angle brackets (#166)

### v2.1.2
## v2.1.2

* Single quotes should be treated as punctuation (#165)

### v2.1.1
## v2.1.1

* Detect additional whitespace characters (#163)

### v2.1.0
## v2.1.0

#### BREAKING CHANGES
### BREAKING CHANGES

* The `dist/jquery.linkify.js` 1.x legacy browser files have been permanently
removed from the release bundle.
* Use `linkify.js` and `linkify-jquery.js` instead.
* The deprecated `newLine` option from linkify 1.x has been completely removed.
* Use the [`nl2br` option](http://soapbox.github.io/linkifyjs/docs/options.html#nl2br) instead.

#### Features
### Features

* [New React.js interface](http://soapbox.github.io/linkifyjs/docs/linkify-react.html)
* [@mention plugin](http://soapbox.github.io/linkifyjs/docs/plugin-mention.html)
Expand All @@ -70,7 +120,7 @@ removed from the release bundle.
* Options that take functions with value and type arguments can now be
specified as objects, where each key is the target link type.

#### Deprecations
### Deprecations

* The `linkAttributes` option is deprecated in favour of just **`attributes`**.
* The `linkClass` option is deprecated in favour of **`className`**.
Expand All @@ -80,7 +130,7 @@ in a future release.
To maintain compatibility with versions >= 2.1, make sure options objects
include these properties instead of `linkAttributes` and `linkClass`

#### All Changes
### All Changes

* Build optimizations to make compiled AMD payload smaller
* Bugfix in quick-es3 task
Expand All @@ -92,29 +142,29 @@ include these properties instead of `linkAttributes` and `linkClass`
* Linkify React Interface (#150)
* Development upgrades (#153)

### v2.0.5
## v2.0.5

* Correct trailing symbol parsing (#149)
* Linkify element fixes (#148)

### v2.0.4
## v2.0.4

* Optimize class code to reduce file size (#147).
* Update test and dev dependencies
* Allow uglify to mangle properties, except for the specified ones (#146)
* Updated tlds.js (#121)

### v2.0.3
## v2.0.3

* Fixing element interface invalid DOM node error (#141)

### v2.0.1
## v2.0.1

* Updated build system and development dependencies
* IE8 Support
* Internal API updates

### v2.0.0
## v2.0.0

* New link-detection technique based on lexicographical analysis via two-stage scanner - essentially regexp with more flexibility.
* Faster, less destructive DOM manipulation.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## How linkify works

_TODO: Insert diagram here_
<!-- TODO: Insert diagram here -->

Linkify uses a two stage lexicographical analysis to detect patterns in plain text.

Expand Down
Loading