-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add type tests for AnimatedRef and fix Animated Components regression (…
…#5308) Requires #5320. I induced a regression accidentally in #5031 regarding FlatList. This PR: - fixes this regression, - improves the type structure of other components, - adds a new test suite to detect such mistakes in the future. It also automatically fixes failing future RN version typecheck CI. All the new & old tests should work.
- Loading branch information
Showing
167 changed files
with
2,838 additions
and
852 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
#ifndef NDEBUG | ||
|
||
#include "JSLogger.h" | ||
#include <memory> | ||
|
||
namespace reanimated { | ||
|
||
void JSLogger::warnOnJS(const std::string &warning) const { | ||
#ifndef NDEBUG | ||
jsScheduler_->scheduleOnJS([warning](jsi::Runtime &rt) { | ||
auto console = rt.global().getPropertyAsObject(rt, "console"); | ||
auto warn = console.getPropertyAsFunction(rt, "warn"); | ||
warn.call(rt, jsi::String::createFromUtf8(rt, warning)); | ||
}); | ||
#endif // NDEBUG | ||
} | ||
|
||
} // namespace reanimated | ||
|
||
#endif // NDEBUG |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
#pragma once | ||
|
||
#include <jsi/jsi.h> | ||
#include <memory> | ||
#include <string> | ||
#include "JSLogger.h" | ||
|
||
using namespace facebook; | ||
|
||
namespace reanimated { | ||
|
||
std::string getReanimatedCppVersion(); | ||
|
||
#ifndef NDEBUG | ||
bool matchVersion(const std::string &, const std::string &); | ||
void checkJSVersion(jsi::Runtime &); | ||
#endif // NDEBUG | ||
void checkJSVersion(jsi::Runtime &, const std::shared_ptr<JSLogger> &); | ||
|
||
}; // namespace reanimated |
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
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
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
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
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
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
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
Oops, something went wrong.