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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roadmap to v1.0.0 馃挴 #24

Open
tasti opened this issue Aug 13, 2016 · 4 comments
Open

Roadmap to v1.0.0 馃挴 #24

tasti opened this issue Aug 13, 2016 · 4 comments

Comments

@tasti
Copy link
Owner

tasti commented Aug 13, 2016

Based on the recent feature request, I've been brainstorming how we could incorporate them into this package and solidify the API.

Since there are similarities between these features, it would be best if we synchronize these ideas and lay them out here. Below is what I imagine the package to look like. Anyone's input is more than welcome!


Overview

Let's begin with the end in mind. Here's what the directory structure would potentially look like:

src/
  components/
    __tests__
    Linkify.jsx
    LinkifyIt.jsx
  decorators/
    hrefDecorator.js
    textDecorator.js
  index.js
.babelrc
.gitignore
LICENSE
README.md
package.json

Requirements

There are several components to get this done.

Custom Handlers

Related: #10, #20

File: src/components/LinkifyIt.jsx

To allow flexibility of and prevent convoluting the base Linkify component, we will introduce a LinkifyIt component. This would allow us to take advantage of existing logic from linkify-it without tightly coupling this package to it.

Href Decorator

Related: #21

File: src/decorators/hrefDecorator.js

To support modifying a matched href. This would be more so a collection of utility implementations that would commonly be used for the examples below.

Examples:

  • Wrap a url with a tracking url
  • Add query parameters to a url

Text Decorator

Related: #22

File: src/decorators/textDecorator.js

Similar to the above, except modifying the actual text that is displayed.

Examples:

Miscellaneous

  • Compatibility with react-native
  • Persist compatibility with server-side rendering

I'd love to hear some feedback and get some extra hands on this roadmap!

@peterbe
Copy link

peterbe commented Mar 20, 2017

One thing I'd like to achieve is to do custom things with the text depending on the URL. For example:

// calling it "textProxy" but it can be "textDecorator" or "whatEver"
<Linkify textProxy={(text, href) => {
  if (youtubeURLregex.test(href)) {
    return <span>Watch on YouTube <img src="/static/youtube.png"/></span>
  } else {
    return text
  }
}}>
  ...
</Linkify>

In other words, I think I should be able to "intervene" both the href and the text and when my "callback" is executed it should be passed both things.

@Tawpie
Copy link

Tawpie commented Jun 15, 2017

It would be super dandy if this would identify and link telephone numbers as well (US as a first step).

@Noitidart
Copy link

Is react native supported yet?

@tasti tasti mentioned this issue Jan 6, 2018
16 tasks
@BrodaNoel
Copy link

What is the breaking change for moving from 0.2.2 to 1.0.0?
Any plan to release 1.0.0?

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

No branches or pull requests

5 participants