-
-
Notifications
You must be signed in to change notification settings - Fork 904
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
Information for Nokogumbo users about the Nokogiri merger #2205
Comments
Closes #170 A future version of Nokogiri will provide Nokogumbo's API (see sparklemotion/nokogiri#2204). This change will allow Nokogumbo to detect whether Nokogiri provides the HTML5 API and become a "shim" -- gracefully defer to Nokogiri by refusing to load itself. Some contractual assumptions I'm making about Nokogiri: - Nokogiri will faithfully reproduce the `::Nokogiri::HTML5` singleton method, module, and namespace (including classes `Nokogiri::HTML5::Node`, `Nokogiri::HTML5::Document`, and `Nokogiri::HTML5::DocumentFragment`) - Nokogiri will not provide a `::Nokogumbo` module/namespace, but will provide a similar `::Nokogiri::Gumbo` module which will provide the same constants and singleton methods as `::Nokogumbo`: - `Nokogumbo.parse()` will be provided as `Nokogiri::Gumbo.parse()` - `Nokogumbo.fragment()` → `Nokogiri::Gumbo.fragment()` - `Nokogumbo::DEFAULT_MAX_ATTRIBUTES` → `Nokogiri::Gumbo::DEFAULT_MAX_ATTRIBUTES` - `Nokogumbo::DEFAULT_MAX_ERRORS` → `Nokogiri::Gumbo::DEFAULT_MAX_ERRORS` - `Nokogumbo::DEFAULT_MAX_TREE_DEPTH` → `Nokogiri::Gumbo::DEFAULT_MAX_TREE_DEPTH` This change checks for the existence of `Nokogiri::HTML5`, `Nokogiri::Gumbo`, and an expected singleton method on each. We could do a more- or less-thorough check here. This change also provides an "escape hatch" using an environment variable `NOKOGUMBO_IGNORE_NOKOGIRI_HTML5` which can be set to avoid the "shim" behavior. This escape hatch might be unnecessary, but this change is invasive enough to make me want to be cautious. In "shim" mode, `Nokogumbo.parse()` and `.fragment()` will be forwarded to the Nokogiri implementation. The `Nokogumbo::DEFAULT*` constants will always be defined, but when in "shim" mode will be set to the `Nokogiri`-provided values. Nokogumbo will emit a single warning message at `require`-time when it is in "shim" mode. This message points users to sparklemotion/nokogiri#2205 which will explain what's going on and help people migrate their applications (but is an empty placeholder right now). I did not include deprecation warning messages in `Nokogumbo.parse` and `.fragment`. If you feel strongly that we should, let me know.
Closes #170 A future version of Nokogiri will provide Nokogumbo's API (see sparklemotion/nokogiri#2204). This change will allow Nokogumbo to detect whether Nokogiri provides the HTML5 API and whether to use Nokogiri's implementation or Nokogumbo's implementation. Some contractual assumptions I'm making about Nokogiri: - Nokogiri will faithfully reproduce the `::Nokogiri::HTML5` singleton method, module, and namespace (including classes `Nokogiri::HTML5::Node`, `Nokogiri::HTML5::Document`, and `Nokogiri::HTML5::DocumentFragment`) - Nokogiri will not provide a `::Nokogumbo` module/namespace, but will provide a similar `::Nokogiri::Gumbo` module which will provide the same public API as `::Nokogumbo`. This change checks for the existence of `Nokogiri::HTML5`, `Nokogiri::Gumbo`, and an expected singleton method on each. We could do a more- or less-thorough check here. This change also provides an "escape hatch" using an environment variable `NOKOGUMBO_IGNORE_NOKOGIRI_HTML5` which can be set to force Nokogumbo to use its own implementation. This escape hatch might be unnecessary, but this change is invasive enough to make me want to be cautious. Nokogumbo will emit a single warning message at `require`-time when it is uses Nokogiri's implementation. This message points users to sparklemotion/nokogiri#2205 which will explain what's going on and help people migrate their applications (but is an empty placeholder right now).
Closes #170 A future version of Nokogiri will provide Nokogumbo's API (see sparklemotion/nokogiri#2204). This change will allow Nokogumbo to detect whether Nokogiri provides the HTML5 API and whether to use Nokogiri's implementation or Nokogumbo's implementation. Some contractual assumptions I'm making about Nokogiri: - Nokogiri will faithfully reproduce the `::Nokogiri::HTML5` singleton method, module, and namespace (including classes `Nokogiri::HTML5::Node`, `Nokogiri::HTML5::Document`, and `Nokogiri::HTML5::DocumentFragment`) - Nokogiri will not provide a `::Nokogumbo` module/namespace, but will provide a similar `::Nokogiri::Gumbo` module which will provide the same public API as `::Nokogumbo`. This change checks for the existence of `Nokogiri::HTML5`, `Nokogiri::Gumbo`, and an expected singleton method on each. We could do a more- or less-thorough check here. This change also provides an "escape hatch" using an environment variable `NOKOGUMBO_IGNORE_NOKOGIRI_HTML5` which can be set to force Nokogumbo to use its own implementation. This escape hatch might be unnecessary, but this change is invasive enough to make me want to be cautious. Nokogumbo will emit a single warning message at `require`-time when it is uses Nokogiri's implementation. This message points users to sparklemotion/nokogiri#2205 which will explain what's going on and help people migrate their applications (but is an empty placeholder right now).
Closes #170 A future version of Nokogiri will provide Nokogumbo's API (see #2204). This change will allow Nokogumbo to detect whether Nokogiri provides the HTML5 API and whether to use Nokogiri's implementation or Nokogumbo's implementation. Some contractual assumptions I'm making about Nokogiri: - Nokogiri will faithfully reproduce the `::Nokogiri::HTML5` singleton method, module, and namespace (including classes `Nokogiri::HTML5::Node`, `Nokogiri::HTML5::Document`, and `Nokogiri::HTML5::DocumentFragment`) - Nokogiri will not provide a `::Nokogumbo` module/namespace, but will provide a similar `::Nokogiri::Gumbo` module which will provide the same public API as `::Nokogumbo`. This change checks for the existence of `Nokogiri::HTML5`, `Nokogiri::Gumbo`, and an expected singleton method on each. We could do a more- or less-thorough check here. This change also provides an "escape hatch" using an environment variable `NOKOGUMBO_IGNORE_NOKOGIRI_HTML5` which can be set to force Nokogumbo to use its own implementation. This escape hatch might be unnecessary, but this change is invasive enough to make me want to be cautious. Nokogumbo will emit a single warning message at `require`-time when it is uses Nokogiri's implementation. This message points users to #2205 which will explain what's going on and help people migrate their applications (but is an empty placeholder right now).
Thanks, this issue was helpful in debugging a bunch of warnings I started receiving:
If you're not explicitly adding |
@swanson It's strange to me that you'd be in a situation where you're running a prerelease of Nokogiri, but an older version of Nokogumbo. Did |
It was a quirk of my environment, mostly wanted to add the note for anyone else googling :) (We were on the pre-release for a security fix but never switched off once a new official release was published) |
I've updated the description text to address the "transitive dependency" case. Thanks for bringing that up, @swanson! |
Nokogiri v1.12 merged Nokogumbo code https://github.com/sparklemotion/nokogiri/releases/tag/v1.12.0 Therefore, Nokogumbo is not required as a dependency anymore. If you run tests with latest Nokogiri you will see deprecation note: ```NOTE: nokogumbo: Using Nokogiri::HTML5 provided by Nokogiri. See sparklemotion/nokogiri#2205 for more information.```
Nokogiri v1.12 merged Nokogumbo code https://github.com/sparklemotion/nokogiri/releases/tag/v1.12.0 Therefore, Nokogumbo is not required as a dependency anymore. If tests are run with latest Nokogiri deprecation note is printed: ``` NOTE: nokogumbo: Using Nokogiri::HTML5 provided by Nokogiri. See sparklemotion/nokogiri#2205 for more information. ```
It's now part of Nokogiri. sparklemotion/nokogiri#2205
By removing Nokogumbo we can resolve a warning that downstream apps are emitting of "NOTE: nokogumbo: Using Nokogiri::HTML5 provided by Nokogiri. See sparklemotion/nokogiri#2205 for more information."
By removing Nokogumbo we can resolve a warning that downstream apps are emitting of "NOTE: nokogumbo: Using Nokogiri::HTML5 provided by Nokogiri. See sparklemotion/nokogiri#2205 for more information."
By removing Nokogumbo we can resolve a warning that downstream apps are emitting of "NOTE: nokogumbo: Using Nokogiri::HTML5 provided by Nokogiri. See sparklemotion/nokogiri#2205 for more information."
Addresses the following notification triggered on application launch ``` NOTE: nokogumbo: Using Nokogiri::HTML5 provided by Nokogiri. See sparklemotion/nokogiri#2205 for more information. ```
Partially addresses the following notification triggered on application launch. ``` NOTE: nokogumbo: Using Nokogiri::HTML5 provided by Nokogiri. See sparklemotion/nokogiri#2205 for more information. ``` This change updates `sanitize` to a verzion that removes the dependency on nokogumbo. The remaining dependency comes from the `linkeddata` data gem which has a more complicated dependency chain to address.
Partially addresses the following notification triggered on application launch. ``` NOTE: nokogumbo: Using Nokogiri::HTML5 provided by Nokogiri. See sparklemotion/nokogiri#2205 for more information. ``` This change updates `sanitize` to a verzion that removes the dependency on nokogumbo. The remaining dependency comes from the `linkeddata` data gem which has a more complicated dependency chain to address.
The Nokogumbo library has been deprecated by Nokogiri 1.12.0 and its whole API has been integrated into the latter. Update our dependencies to directly depend on Nokogiri only. See sparklemotion/nokogiri#2205 for details.
The Nokogumbo library has been deprecated by Nokogiri 1.12.0 and its whole API has been integrated into the latter. Update our dependencies to directly depend on Nokogiri only. See sparklemotion/nokogiri#2205 for details.
The Nokogumbo library has been deprecated by Nokogiri 1.12.0 and its whole API has been integrated into the latter. Update our dependencies to directly depend on Nokogiri only. See sparklemotion/nokogiri#2205 for details.
❤️ |
The gem has been merged into nokogiri 1.12.0. Remove its deprecation warnings (sparklemotion/nokogiri#2205).
The gem has been merged into nokogiri 1.12.0. Remove its deprecation warnings (sparklemotion/nokogiri#2205).
This fixes a number of CVEs and drops the need for nokogumbo: sparklemotion/nokogiri#2205
This fixes a number of CVEs and drops the need for nokogumbo: sparklemotion/nokogiri#2205 Also drops Ruby 2.5 since it reached EOL on 2021-04-05 (https://www.ruby-lang.org/en/downloads/branches/). Closes premailer#208
This fixes a number of CVEs and drops the need for nokogumbo: sparklemotion/nokogiri#2205 Also drops Ruby 2.5 since it reached EOL on 2021-04-05 (https://www.ruby-lang.org/en/downloads/branches/). Closes premailer#208
This fixes a number of CVEs and drops the need for nokogumbo: sparklemotion/nokogiri#2205 Also drops Ruby 2.5 since it reached EOL on 2021-04-05 (https://www.ruby-lang.org/en/downloads/branches/). Closes premailer#208
This fixes a number of CVEs and drops the need for nokogumbo: sparklemotion/nokogiri#2205 Also drops Ruby 2.5 and 2.6 since they reached EOL (https://www.ruby-lang.org/en/downloads/branches/). Closes premailer#208
Nokogumbo has been merged with Nokogiri since the latter's version 1.13. This gets rid of the ‘NOTE: nokogumbo: Using Nokogiri::HTML5 provided by Nokogiri’ message during build. See sparklemotion/nokogiri#2205 for details.
Nokogumbo has been merged with Nokogiri since the latter's version 1.13. This gets rid of the ‘NOTE: nokogumbo: Using Nokogiri::HTML5 provided by Nokogiri’ message during build. See sparklemotion/nokogiri#2205 for details.
Hello! If you've arrived at this issue because of a warning message emitted by Nokogumbo, you're in the right place. This issue exists to try to:
👇
How To Resolve The Warnings
If you've installed Nokogiri
>= v1.12.0
, then you can simply drop Nokogumbo as a dependency. Nokogiri has imported Nokogumbo's complete public API and so this cutover should be painless.Alternatively, if Nokogumbo is a transitive dependency, then you should be able to
bundle update nokogumbo
to v2.0.5 to eliminate the constant/method redefined warnings. In this case, until Nokogumbo is removed by the intermediate dependencies, you will continue to see a "Using Nokogiri::HTML5 provided by Nokogiri" warning atrequire
-time.☝️
A Deeper Explanation for the Curious
Why am I seeing this warning message?
The warning message you're seeing is probably:
You're seeing this message because Nokogumbo has been merged into Nokogiri
>= 1.12.0
, and you've loaded Nokogumbo>= 2.0.5
.No, that's not the warning I'm seeing.
Or you may be seeing error messages like:
You're seeing this message for the same reason -- Nokogumbo has been merged into Nokogiri
>= 1.12.0
-- but you're running an older Nokogumbo,<= 2.0.4
. If you upgrade to Nokogumbo>= 2.0.5
then you'll see the warning from the previous section.Why did you do this?
Nokogiri
<= 1.12.0
did not provide HTML5 support, and it was becoming increasingly clear that the community wanted and expected HTML5 support.Nokogumbo was the best candidate for providing HTML5 support, but the installation experience for many users was challenging for many of the same reasons that Nokogiri's installation experience was challenging before v1.11.0 delivered precompiled native gems for Linux (#1983) and MacOS (#2063), and we collectively hesitated at placing that gem into the "Rails dependency" hot path.
After a brief conversation in #2064 the two teams reached the decision to merge, in order to better meet the needs of the Ruby community. Nokogiri gets HTML5 support out of the box, Nokogumbo gets shipped as a precompiled native gem to anyone (on CRuby) who needs it, and by shipping together the maintainers can ship more often and more reliably.
You can read #2204 for more information!
How do I make it stop?
If you've installed Nokogiri
>= v1.12.0
, then you can simply drop Nokogumbo as a dependency. Nokogiri has imported Nokogumbo's complete public API and so this cutover should be painless.Alternatively, if Nokogumbo is a transitive dependency, then you should be able to
bundle update nokogumbo
to v2.0.5 to eliminate the constant/method redefined warnings. In this case, until Nokogumbo is removed by the intermediate dependencies, you will continue to see a "Using Nokogiri::HTML5 provided by Nokogiri" warning atrequire
-time.The text was updated successfully, but these errors were encountered: