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

readme improvements WIP #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
37 changes: 23 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
Rangy2
=====

A cross-browser JavaScript range and selection library.
A cross-browser JavaScript range and selection library based off of the abondoned project: https://github.com/timdown/rangy.

## Compare to [rangy](https://github.com/timdown/rangy) 1.x


## Other improvements over [rangy](https://github.com/timdown/rangy) 1.x
+ migrated to typescript
- so, the definition types is always updated
+ use typescript's module (import / export) instead of the complex `rangy.createModule` logic
+ remove TextRange & [inactive](https://github.com/timdown/rangy/tree/master/src/modules/inactive) modules
- type definitions stay up-to-date
+ uses typescript's module system (import / export) instead of the complex `rangy.createModule` logic
+ removed TextRange & [inactive](https://github.com/timdown/rangy/tree/master/src/modules/inactive) modules
- if you use those modules, please migrate to rangy2 & create a pull request.
+ use [rollup](https://rollupjs.org) instead of the
+ uses [rollup](https://rollupjs.org) instead of the
[old complex manually with text-replacing building logic](https://github.com/timdown/rangy/blob/master/builder/build.js)
+ don't support too-outdated browser: IE < 9
- removed many outdated feature testing logic (for too-outdated browser)
+ doesn't support outdated browsers: IE < 9
- removed feature testing logic for outdated browsers
+ migrated testing code to [QUnit](https://qunitjs.com/)
- dont use [jest](https://jestjs.io/) because we need test in android/ ios
+ remove `rangy.init` (& `rangy.addInitListener`)
- doesn't use [jest](https://jestjs.io/) because we need test in Android and iOS
+ removed `rangy.init` (& `rangy.addInitListener`)
- rangy is "initialized" even before DOM ready!
- So, many bugs like [326](https://github.com/timdown/rangy/issues/326),
[321](https://github.com/timdown/rangy/issues/321) is auto-fixed!
- many bugs like [326](https://github.com/timdown/rangy/issues/326),
[321](https://github.com/timdown/rangy/issues/321) are auto-fixed!

## Guide to migrate from rangy 1.x to rangy2
+ removed:
Expand All @@ -32,7 +34,7 @@ A cross-browser JavaScript range and selection library.
- `warn, fail, supported`
- `RangePrototype, rangePrototype, selectionPrototype`
- `WrappedTextRange`

+ note: to support IE, we bundled the following [core-js](https://www.npmjs.com/package/core-js) modules
into `dist/*/bundles/index.umd.js` (not bundle into `index.esm.js` & other module types)
```javascript
Expand All @@ -45,9 +47,16 @@ import "core-js/features/object/assign";
yarn add rangy2
```

## Quick Start
```typescript
import { createRangyRange } from 'rangy2';

const range = createRangyRange();
```

## Documentation

Documentation is in [the GitHub wiki](https://github.com/timdown/rangy/wiki).
Documentation is in [the GitHub wiki](https://github.com/timdown/rangy/wiki).

## Dev guide
```bash
Expand Down