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

merged 69 commits into from
Sep 15, 2021

Conversation

nfrasser
Copy link
Owner

@nfrasser nfrasser commented Mar 8, 2021

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:
    linkifyStr(str, { className: 'linkified' })
  • Remove default target="_blank" attribute for discovered URLs. Opt back in by setting the target option:
    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':
    <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
    v2 vs v3 performance
  • Custom protocols with linkify.registerCustomProtocol('protocol')
  • 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
    // Before
    import * as linkify from 'linkifyjs'
    import hashtag from 'linkifyjs/plugins/hashtag'
    hashtag(linkify)
    
    // After
    import * as linkify from 'linkifyjs'
    import 'linkifyjs/plugins/hashtag'

Fixes: #316 #315 #312 #309 #293 #284 #251 #231 #225 #216 #204 #92 #317 #313 #279 #277 #270 #253 #245 #254 #233 #212 #206 #205 #194 #171 #167

- Moving away from gulp
- Standalone rollup and mocha config
- Use rollup/terser dependencies
- Renamed state machine methods (these will likely be replaced very
  shortly)
- Restructured core directory structure
- Refactored tests so that calling the plugin after import is no longer
  required
- New internal TLDs
- simple-html-tokenizer may now be required from the node modules
Not working yet, the parser tests are not running properly
Use class-based State struct, hash lookup states instead of array iteration. Still 30ms though for a correct implementation though :(
Supports IDN and speeds up initialization!
This further reduces plugin initial startup time, delaying the cost to
when linkify is first executed on some text (though that cost has
already been reduced 4x in previous commits; it's now ~5-7ms on my
machine)

Including delayed plugin initialization for hashtag
Including auto-register
All mocha tests on node are now passing
@nfrasser nfrasser self-assigned this Mar 8, 2021
@nfrasser nfrasser added this to the 3.0 milestone Mar 8, 2021
To allow easier opt in/out for features you want. Especially for React,
jQuery and future interfaces
That doesn't use workspaces
Also update jQuery/React version matrices
Fix test run line

Bump latest node version back to 16

Attempt different run test strategy

Maybe this one won't fail

CI test run fixes

Fix incorrect npm script definition

Another test fix attempt

Attempt fix failing tests with sleep

Fix conditional bash statements

Should be final round of test fixes

Add BrowserStack + Coverage

Final fixes for coverage and browserstack

Tweaked browser CI config

Add status badges
@nfrasser
Copy link
Owner Author

Just gotta fill out the README files for all the sub-packages and this should be ready to deploy.

@nfrasser nfrasser marked this pull request as ready for review September 15, 2021 02:23
@nfrasser nfrasser merged commit 70c6e0e into master Sep 15, 2021
@nfrasser nfrasser deleted the v3.0 branch September 15, 2021 02:24
@justjake
Copy link

YES

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scanner.js start-up performance could be improved
3 participants