preactjs / legacy-compat Goto Github PK
View Code? Open in Web Editor NEWReact 15 compatibility layer for Preact
License: MIT License
React 15 compatibility layer for Preact
License: MIT License
The legacy-compat package in ESM mode does not appear to place nicely with other legacy versions of libraries -- I ran into runtime issues in react-redux
and also several other code paths in our codebase.
Per discussion in Slack, legacy-compat isn't tree-shakeable, so we don't gain anything significantly from trying to resolve the compatibility issues.
Referencing an original issue from the Preact repo here:
The core HTML spec doesn't allow for this stuff, and it appears that React v15 transforms them into style tags (100%) or removes the unit (50px).
Same issue and likely same fix as:
Hey friends,
In the replaceIterables
hook for adding ImmutableJS compatibility, there's an issue with the Immutable.Map
rendering.
In React v15.6 in traverseAllChildren
, there's code which prints a warning, but then says "if we're iterating over a dictionary, use entry[1]
to get the value".
The result is that while there is a warning printed in dev, we still get "working" elements.
From investigating in the Immutable
codebase, it appears that the way that Immutable
determines whether an item is a Map
-like item (a KeyedCollection) is obj["@@__IMMUTABLE_KEYED__@@"]
.
So for this use case, to match how React is rendering Map
-like things, it seems like we would want to change the code to:
} else if (typeof obj.toJS === 'function') {
if (obj["@@__IMMUTABLE_KEYED__@@"]) {
obj = obj.valueSeq();
}
obj = obj.toJS();
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.