Skip to content

Commit

Permalink
Revert "v1.0.0 (cheeriojs#1145)"
Browse files Browse the repository at this point in the history
This reverts commit ca6963c.

The `v1.0.0` branch was a long-running feature branch containing a large
amount of disparate commits from many authors. It was squashed into a
single commit prior to being merged to the project's `master` branch.

For the purposes of attribution, reference, and history analysis, the
composite commits should be preserved, and the branch should be
incorporated into `master` via a dedicated merge commit.
  • Loading branch information
jugglinmike committed Oct 8, 2018
1 parent df695a4 commit f15b06c
Show file tree
Hide file tree
Showing 37 changed files with 2,059 additions and 3,424 deletions.
31 changes: 0 additions & 31 deletions .eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ lib-cov
cover_html
.c9revisions
coverage
/docs/
11 changes: 11 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"indent": 2,
"eqnull": true,
"laxbreak": true,
"proto": true,
"undef": true,
"unused": true,
"node": true,
"quotmark": "single",
"shadow": "outer"
}
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
language: node_js
node_js:
- "stable"
- "8"
- "unstable"
- "6"
- "4"
- "0.12"
script: make travis-test
matrix:
fast_finish: true
allow_failures:
- node_js: unstable
include:
- env: BENCHMARK=true
script: "node benchmark/benchmark.js --regex '^(?!.*highmem)'"
56 changes: 33 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
Thanks for your interest in contributing to the project! Here's a rundown of
how we'd like to work with you:

1. File an issue on GitHub describing the contribution you'd like to make. This
will help us to get you started on the right foot.
2. Create a single commit that addresses the issue:
1. Follow the project's code style (see below)
2. Add enough unit tests to "prove" that your patch is correct
3. Update the project documentation as needed (see below)
4. Describe your approach with as much detail as necessary in the git
commit message
3. Open a pull request, and reference the initial issue in the pull request
message.
1. File an issue on GitHub describing the contribution you'd like to make. This
will help us to get you started on the right foot.
2. Create a single commit that addresses the issue:
1. Follow the project's code style (see below)
2. Add enough unit tests to "prove" that your patch is correct
3. Update the project documentation as needed (see below)
4. Describe your approach with as much detail as necessary in the git
commit message
3. Open a pull request, and reference the initial issue in the pull request
message.

# Documentation

Expand All @@ -22,16 +22,26 @@ care to note aspects that make Cheerio distinct.

# Code Style

Please make sure commit hooks are run, which will enforce the code style.

When implementing private functionality that isn't part of the jQuery API, please opt for:

* _Static methods_: If the functionality does not require a reference to a
Cheerio instance, simply define a named function within the module it is
needed.
* _Instance methods_: If the functionality requires a reference to a Cheerio
instance, informally define the method as "private" using the following
conventions:
* Define the method as a function on the Cheerio prototype
* Prefix the method name with an underscore (`_`) character
* Include `@api private` in the code comment the documents the method
This section is by no means complete. For undocumented stylistic choices,
please try to maintain consistency with the code base.

- Single quotes: `'`
- Whitespace
- Two-space "soft" tabs
- Once space following control flow statements (`if (condition) {` rather
than `if(condition) {`)
- Remove trailing spaces
- [End each file with a newline
character.](https://github.com/editorconfig/editorconfig/wiki/Newline-at-End-of-File-Support)
- Terminate every statement with a semicolon
- Private functionality (for re-using functionality that isn't part of the
jQuery API)
- *Static methods*: If the functionality does not require a reference to a
Cheerio instance, simply define a named function within the module it is
needed.
- *Instance methods*: If the functionality requires a reference to a Cheerio
instance, informally define the method as "private" using the following
conventions:
- Define the method as a function on the Cheerio prototype
- Prefix the method name with an underscore (`_`) character
- Include `@api private` in the code comment the documents the method
95 changes: 0 additions & 95 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,98 +1,3 @@
1.0.0-rc.2 / 2017-07-02
==================

This release changes Cheerio's default parser to [the Parse5 HTML
parser](https://github.com/inikulin/parse5). Parse5 is an excellent project
that rigorously conforms to the HTML standard. It does not support XML, so
Cheerio continues to use [`htmlparser2`](https://github.com/fb55/htmlparser2/)
when working with XML documents.

This switch addresses many long-standing bugs in Cheerio, but some users may
experience slower behavior in performance-critical applications. In addition,
`htmlparser2` is more forgiving of invalid markup which can be useful when
input sourced from a third party and cannot be corrected. For these reasons,
the `load` method also accepts a DOM structure as produced by the `htmlparser2`
library. See the project's "readme" file for more details on this usage
pattern.

### Migrating from version 0.x

`cheerio.load( html[, options ] )` This method continues to act as a "factory"
function. It produces functions that define an API that is similar to the
global `jQuery` function provided by the jQuery library. The generated function
operates on a DOM structure based on the provided HTML.

In releases prior to version 1.0, the provided HTML was interpreted as a
document fragment. Following version 1.0, strings provided to the `load` method
are interpreted as documents. The same example will produce a `$` function that
operates on a full HTML document, including an `<html>` document element with
nested `<head>` and `<body>` tags. This mimics web browser behavior much more
closely, but may require alterations to existing code.

For example, the following code will produce different results between 0.x and
1.0 releases:

var $ = cheerio.load('<p>Hello, <b>world</b>!</p>');

$.root().html();

//=> In version 0.x: '<p>Hello, <b>world</b>!</p>'
//=> In version 1.0: '<html><head></head><body><p>Hello, <b>world</b>!</p></body></html>'

Users wishing to parse, manipulate, and render full documents should not need
to modify their code. Likewise, code that does not interact with the "root"
element should not be effected by this change. (In the above example, the
expression `$('p')` returns the same result across Cheerio versions--a Cheerio
collection whose only member is a paragraph element.)

However, users wishing to render document fragments should now explicitly
create a "wrapper" element to contain their input.

// First, create a Cheerio function "bound" to an empty document (this is
// similar to loading an empty page in a web browser)
var $ = cheerio.load('');
// Next, create a "wrapper" element for the input fragment:
var $wrapper = $('<div/>');
// Finally, supply the input markup as the content for the wrapper:
$wrapper.append('<p>Hello, <b>world</b>!</p>');

$wrapper.html();
//=> '<p>Hello, <b>world</b>!</p>'

---

Change log:

* Update History.md (and include migration guide) (Mike Pennisi)
* Rename `useHtmlParser2` option (Mike Pennisi)
* Remove documentation for `xmlMode` option (Mike Pennisi)
* Document advanced usage with htmlparser2 (Mike Pennisi)
* Correct errors in Readme.md (Mike Pennisi)
* Improve release process (Mike Pennisi)
* 1.0.0-rc.1 (Mike Pennisi)
* Update unit test (Mike Pennisi)
* Normalize code style (Mike Pennisi)
* Added support for nested wrapping. (Diane Looney)
* Add nested wrapping test (Toni Helenius)
* Added $.merge following the specification at https://api.jquery.com/jquery.merge/ Added test cases for $.merge (Diane Looney)
* Clarify project scope in README file (Mike Pennisi)
* .text() ignores script and style tags (#1018) (Haleem Assal)
* Test suite housekeeping (#1016) (DianeLooney)
* experiment with a job board (Matthew)
* Change options format (inikulin)
* Add test for #997 (inikulin)
* Update .filter function docs. (Konstantin)
* Standardise readme on ES6 variable declarations (Dekatron)
* Use documents via $.load (inikulin)
* Use parse5 as a default parser (closes #863) (inikulin)
* Fix small typo in Readme (Darren Scerri)
* Report test failures in CI (Mike Pennisi)
* serializeArray should not ignore input elements without value attributes (Ricardo Gladwell)
* Disallow variable shadowing (Mike Pennisi)
* Update hasClass method (sufisaid)
* Added MIT License fixes #902 (Prasanth Vaaheeswaran)
* chore(package): update dependencies (greenkeeper[bot])
* Use modular lodash package (#913) (Billy Janitsch)

0.22.0 / 2016-08-23
==================
Expand Down
17 changes: 2 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
REPORTER = dot
XYZ = node_modules/.bin/xyz --message 'Release X.Y.Z' --tag X.Y.Z --repo git@github.com:cheeriojs/cheerio.git --script scripts/prepublish
UPSTREAM = git@github.com:cheeriojs/cheerio.git

lint:
@./node_modules/.bin/eslint --ignore-path .gitignore .
@./node_modules/.bin/jshint lib/ test/

test: lint
@./node_modules/.bin/mocha --recursive --reporter $(REPORTER)
Expand Down Expand Up @@ -37,16 +36,4 @@ release-patch: LEVEL = patch
release-major release-minor release-patch:
@$(XYZ) --increment $(LEVEL)

docs:
@./node_modules/.bin/jsdoc --configure jsdoc-config.json

publish-docs: docs
@cd docs; \
rm -rf .git && \
git init && \
git add --all . && \
git commit -m 'Generate documentation' && \
git remote add upstream $(UPSTREAM) && \
git push --force upstream master:gh-pages

.PHONY: test build setup subl docs publish-docs
.PHONY: test build setup subl
Loading

0 comments on commit f15b06c

Please sign in to comment.