-
-
Notifications
You must be signed in to change notification settings - Fork 591
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
🚀 Foundry release #434
Merged
Merged
🚀 Foundry release #434
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## master #434 +/- ##
==========================================
- Coverage 64.69% 64.00% -0.69%
==========================================
Files 7 66 +59
Lines 473 614 +141
Branches 141 131 -10
==========================================
+ Hits 306 393 +87
- Misses 69 124 +55
+ Partials 98 97 -1
Continue to review full report at Codecov.
|
This was
linked to
issues
Nov 26, 2020
jsamr
force-pushed
the
dev/foundry
branch
2 times, most recently
from
January 14, 2021 18:24
852b62c
to
5695fea
Compare
This was referenced Jan 16, 2021
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
BREAKING CHANGE: list padding will not adapt to markers width anymore. You need to explicitly enable this behavior via the new `enableDynamicMarkerBoxWidth` lists renderers prop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Foundry Status
Check the announcement thread
Remaining work before stable release
Feature Parity (v4)
ignoredTags
(renamedignoredDomTags
)ignoreNodesFunction
(renamedignoreDomNode
)alterNode
(moved todomVisitors.onElement
, tamper directly the node reference and use domutils to insert, delete children)alterChildren
(moved todomVisitors.onElement
, tamper with children via domutils)alterData
(moved todomVisitors.onText
; tamper directly the node referencetext
field)renderersProps
ignoredStyles
(BREAKING: names should be camelCased.)allowedStyles
(BREAKING: names should be camelCased.)emSize
nodeIndex
andparent
viatnode
listsPrefixesRenderers
→customListStyleSpecs
Feature Parity (v5)
computeImagesMaxWidth
withcomputeEmbeddedMaxWidth
html
anduri
withsource
(supportsmethod
,body
andheaders
)WebView
anddefaultWebViewProps
propsdomNodeToHTMLString
utilFixes
New Features
useInternalRenderer
.defaultViewProps
DocumentMetadata
from any component (an object containing meta information of the document, such as lang, baseUrl, ...etc) withuseDocumentMetadata
hook, and from the controlling component withonDocumentMetadataLoaded
prop.baseUrl
forRenderHTMLSourceInline
sourcesDocumentMetadata
. This helps normalize relativesrc
andhref
s (useNormalizedUrl
hook).TRenderEngineProvider
component to share one engine instance across multipleRenderHTML
instances.markers.anchor === true
from themarkers
prop. You can also set custom markers withsetMarkersForTNode
prop.Postponed
Doc
Tests
Modules
compat module to ease the transitioncancelled in favor of migration guideFixes
Features Highlight
New props
idsStyles
property (similar to classesStyles);systemFonts
andfallbackFonts
props), see demo.enableUserAgentStyles
(true by default, the "browser" styles);enableCSSInlineParsing
(true by default)enableExperimentalMarginCollapsing
to comply with the margin collapsing CSS standard (experimental, only work on adjacent blocks, and doesn't work with percent units), see demo;extendDefaultRenderer
utility to tamper with the element model of a tag (see "Model Tampering" in the demo, which allows inline images!).customListStyleSpecs
to create arbitrary list counter styles.renderersProps
now supports renderer-specific fields. For example,renderersProps.a.onPress
replacesonLinkPress
prop.renderersProps.(ol|ul).enableExperimentalRtl
to reverse the display order of list markers and content when either dir attribute or direction CSS property are set to"rtl"
.Elements
<dl>
)<ins>
,<del>
CSS
whiteSpace
style property, or inlinewhite-space: xx;
see demo;list-style-type
CSS property! Also available in passed styles (tagsStyles...). Currently works with disc, circle, square, decimal, lower-alpha; upper-alpha. It currently only works withli
andul
tags, see demo.Renderer API
useInternalRenderer
hook, to which you can pass ViewProps or TextProps, depending on the tnode, along with specific props for this renderer. This default renderer also supportsonPress
prop, so any renderer can be super easily configured as interactive!contentModel
), what are the "user agent" styles for this tag (mixedUAStyles
) and how to derive conditional user agent styles from attributes (getUADerivedStyleFromAttributes
). There are some advanced options, such asisOpaque
, which allows access to the children DOM tree from the TNode, especially useful for SVG and other special markups.Most of the time, you don't have to care about it, and just use the default model for this tag exported in
defaultHTMLElementModels
. It is yet a powerful feature which lets you put the hands on the engine!Example of Custom Interactive
Example of "Children Tampering"
Below is an example where our custom article render will inject advertisement below the second and fourth children:
will render this html snippet:
like this
Removed props
customWrapper
andcontainerStyle
onParsed
staticContentMaxWidth
ignoreNodesFunction
ptSize