1.15.0 / 2023-05-15 #2878
flavorjones
announced in
Releases
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
1.15.0 / 2023-05-15
Notes
Ability to opt into system
mallocandfreeSince 2009, Nokogiri has configured libxml2 to use
ruby_xmallocet al for memory management. This has provided benefits for memory management, but comes with a performance penalty.Users can now opt into using system
mallocfor libxml2 memory management by setting an environment variable:# "default" here means "libxml2's default" which is system malloc NOKOGIRI_LIBXML_MEMORY_MANAGEMENT=defaultBenchmarks show that this setting will significantly improve performance, but be aware that the tradeoff may involve poorer memory management including bloated heap sizes and/or OOM conditions.
You can read more about this in the decision record at
adr/2023-04-libxml-memory-management.md.Dependencies
Added
Encodingobjects may now be passed to serialization methods like#to_xml,#to_html,#serialize, and#write_toto specify the output encoding. Previously only encoding names (strings) were accepted. [#2774, #2798] (Thanks, @ellaklara!)mallocfor libxml2 memory management. For more detail, see note above oradr/2023-04-libxml-memory-management.md.Changed
Schema.from_documentnow makes a defensive copy of the document if it has blank text nodes with Ruby objects instantiated for them. This prevents unsafe behavior in libxml2 from causing a segfault. There is a small performance cost, but we think this has the virtue of being "what the user meant" since modifying the original is surprising behavior for most users. Previously this was addressed in v1.10.9 by raising an exception.Fixed
XSLT.transformnow makes a defensive copy of the document if it has blank text nodes with Ruby objects instantiated for them and the template usesxsl:strip-spaces. This prevents unsafe behavior in libxslt from causing a segfault. There is a small performance cost, but we think this has the virtue of being "what the user meant" since modifying the original is surprising behavior for most users. Previously this would allow unsafe memory access and potentially segfault. [#2800]Improved
Nokogiri::XML::Node::SaveOptions#inspectnow shows the names of the options set in the bitmask, similar toParseOptions. [#2767]#inspectand pretty-printing are improved forAttributeDecl,ElementContent,ElementDecl, andEntityDecl.ObjectSpace.memsize_ofreports a pretty good guess of memory usage when called onNokogiri::XML::Documentobjects. [#2807] (Thanks, @etiennebarrie and @byroot!)config.guessandconfig.subthat supports new architectures likeloongarch64. [#2831] (Thanks, @zhangwenlong8911!)xlink:arcroleand removingxml:base[#2841, #2842]<hr>in<select>[whatwg/html#3410, whatwg/html#9124]Node#first_element_childnow returnsnilif there are only non-element children. Previously a null pointer exception was raised. [#2808, #2844]Nokogiri::XSLTnow has usage examples including custom function handlers.Deprecated
Nokogiri::XML::Nodeas the first parameter toCDATA.newis deprecated and will generate a warning. This parameter should be a kind ofNokogiri::XML::Document. This will become an error in a future version of Nokogiri.Nokogiri::XML::Nodeas the first parameter toSchema.from_documentis deprecated and will generate a warning. This parameter should be a kind ofNokogiri::XML::Document. This will become an error in a future version of Nokogiri.Nokogiri::XML::Nodeas the second parameter toText.newis deprecated and will generate a warning. This parameter should be a kind ofNokogiri::XML::Document. This will become an error in a future version of Nokogiri.nokogirinamespace is deprecated and will generate a warning. Support for non-namespaced functions will be removed in a future version of Nokogiri. (Note that JRuby has never supported non-namespaced custom XPath functions.)Thank you!
The following people and organizations were kind enough to sponsor @flavorjones or the Nokogiri project during the development of v1.15.0:
We'd also like to thank @github who donate a ton of compute time for our CI pipelines!
sha256 checksums:
This discussion was created from the release 1.15.0 / 2023-05-15.
Beta Was this translation helpful? Give feedback.
All reactions