GithubHelp home page GithubHelp logo

legacy-compat's People

Contributors

developit avatar jovidecroock avatar mq2thez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

legacy-compat's Issues

[Request] Remove ESM build from distribution

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.

ImmutableJS issue with rendering Immutable.Map

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();
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.