-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat(Worklets): react-native-worklets node package stub #6806
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| /** @type {import('eslint').ESLint.ConfigData} */ | ||
| module.exports = { | ||
| extends: ['../../.eslintrc.js'], | ||
| }; |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| *.pbxproj -text | ||
| # specific for windows script files | ||
| *.bat text eol=crlf |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| # OSX | ||
| .DS_Store | ||
|
|
||
| # VSCode | ||
| .vscode/ | ||
| jsconfig.json | ||
|
|
||
| # Xcode | ||
| build/ | ||
| *.pbxuser | ||
| !default.pbxuser | ||
| *.mode1v3 | ||
| !default.mode1v3 | ||
| *.mode2v3 | ||
| !default.mode2v3 | ||
| *.perspectivev3 | ||
| !default.perspectivev3 | ||
| xcuserdata | ||
| *.xccheckout | ||
| *.moved-aside | ||
| DerivedData | ||
| *.hmap | ||
| *.ipa | ||
| *.xcuserstate | ||
| project.xcworkspace | ||
|
|
||
| # Android/IJ | ||
| .classpath | ||
| .cxx | ||
| .gradle | ||
| .idea | ||
| .project | ||
| .settings | ||
| local.properties | ||
| android.iml | ||
|
|
||
| # node.js | ||
| node_modules/ | ||
| npm-debug.log | ||
| yarn-debug.log | ||
| yarn-error.log | ||
|
|
||
| # BUCK | ||
| buck-out/ | ||
| \.buckd/ | ||
| android/app/libs | ||
| android/keystores/debug.keystore | ||
|
|
||
| # Yarn | ||
| .yarn/* | ||
| !.yarn/patches | ||
| !.yarn/plugins | ||
| !.yarn/releases | ||
| !.yarn/sdks | ||
| !.yarn/versions | ||
|
|
||
| # generated by bob | ||
| lib/ | ||
|
|
||
| # React Native Codegen | ||
| apple/generated | ||
| android/generated |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {} |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2024 nobody | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| require "json" | ||
|
|
||
| package = JSON.parse(File.read(File.join(__dir__, "package.json"))) | ||
| folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32' | ||
|
|
||
| Pod::Spec.new do |s| | ||
| s.name = "RNWorklets" | ||
| s.version = package["version"] | ||
| s.summary = package["description"] | ||
| s.homepage = "https://github.com/software-mansion/react-native-reanimated" | ||
| s.license = package["license"] | ||
| s.authors = { "author" => "author@domain.com" } | ||
| s.platforms = { :ios => min_ios_version_supported } | ||
| s.source = { :git => "https://github.com/software-mansion/react-native-reanimated.git", :tag => "#{s.version}" } | ||
|
|
||
| s.source_files = "apple/*.{h,m,mm,cpp}" | ||
|
|
||
| s.subspec "worklets" do |ss| | ||
| ss.source_files = "Common/cpp/worklets/**/*.{cpp,h}" | ||
| ss.header_dir = "worklets" | ||
| ss.header_mappings_dir = "Common/cpp/worklets" | ||
|
|
||
| ss.subspec "apple" do |sss| | ||
| # Please be careful with the snakes. | ||
| # 🐍🐍🐍 | ||
| # Thank you for your understanding. | ||
| sss.source_files = "apple/worklets/**/*.{mm,h,m}" | ||
| sss.header_dir = "worklets" | ||
| sss.header_mappings_dir = "apple/worklets" | ||
| end | ||
| end | ||
|
|
||
| # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0. | ||
| # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79. | ||
| if respond_to?(:install_modules_dependencies, true) | ||
| install_modules_dependencies(s) | ||
| else | ||
| s.dependency "React-Core" | ||
|
|
||
| # Don't install the dependencies when we run `pod install` in the old architecture. | ||
| if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then | ||
| s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1" | ||
| s.pod_target_xcconfig = { | ||
| "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"", | ||
| "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1", | ||
| "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" | ||
| } | ||
| s.dependency "React-Codegen" | ||
| s.dependency "RCT-Folly" | ||
| s.dependency "RCTRequired" | ||
| s.dependency "RCTTypeSafety" | ||
| s.dependency "ReactCommon/turbomodule/core" | ||
| end | ||
| end | ||
|
|
||
| s.pod_target_xcconfig = { | ||
| "USE_HEADERMAP" => "YES", | ||
| "DEFINES_MODULE" => "YES", | ||
| "HEADER_SEARCH_PATHS" => '"$(PODS_TARGET_SRCROOT)/ReactCommon" "$(PODS_TARGET_SRCROOT)" "$(PODS_ROOT)/RCT-Folly" "$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native" "$(PODS_ROOT)/DoubleConversion" "$(PODS_ROOT)/Headers/Private/React-Core" "$(PODS_ROOT)/Headers/Private/Yoga"', | ||
| "FRAMEWORK_SEARCH_PATHS" => '"${PODS_CONFIGURATION_BUILD_DIR}/React-hermes"', | ||
| "CLANG_CXX_LANGUAGE_STANDARD" => "c++17", | ||
| } | ||
|
|
||
| end | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| project(Worklets) | ||
tjzel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| cmake_minimum_required(VERSION 3.8) | ||
|
|
||
| set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
| set(CMAKE_EXPORT_COMPILE_COMMANDS | ||
| ON | ||
| CACHE INTERNAL "") | ||
|
|
||
| set(CMAKE_CXX_STANDARD 20) | ||
|
|
||
| # default CMAKE_CXX_FLAGS: "-g -DANDROID -fdata-sections -ffunction-sections | ||
| # -funwind-tables -fstack-protector-strong -no-canonical-prefixes | ||
| # -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-protector-all" | ||
| include("${REACT_NATIVE_DIR}/ReactAndroid/cmake-utils/folly-flags.cmake") | ||
| add_compile_options(${folly_FLAGS}) | ||
|
|
||
| string( | ||
| APPEND | ||
| CMAKE_CXX_FLAGS | ||
| " -DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION} -DREANIMATED_VERSION=${REANIMATED_VERSION} -DHERMES_ENABLE_DEBUGGER=${HERMES_ENABLE_DEBUGGER}" | ||
| ) | ||
|
|
||
| string( | ||
| APPEND | ||
| CMAKE_CXX_FLAGS | ||
| " -fexceptions -fno-omit-frame-pointer -frtti -fstack-protector-all -std=c++${CMAKE_CXX_STANDARD} -Wall -Werror" | ||
| ) | ||
|
|
||
| if(${IS_NEW_ARCHITECTURE_ENABLED}) | ||
| string(APPEND CMAKE_CXX_FLAGS " -DRCT_NEW_ARCH_ENABLED") | ||
| endif() | ||
|
|
||
| if(${IS_REANIMATED_EXAMPLE_APP}) | ||
| string(APPEND CMAKE_CXX_FLAGS " -DIS_REANIMATED_EXAMPLE_APP -Wpedantic") | ||
| endif() | ||
|
|
||
| if(NOT ${CMAKE_BUILD_TYPE} MATCHES "Debug") | ||
| string(APPEND CMAKE_CXX_FLAGS " -DNDEBUG") | ||
| endif() | ||
|
|
||
| if(${JS_RUNTIME} STREQUAL "hermes") | ||
| string(APPEND CMAKE_CXX_FLAGS " -DJS_RUNTIME_HERMES=1") | ||
| elseif(${JS_RUNTIME} STREQUAL "jsc") | ||
| string(APPEND CMAKE_CXX_FLAGS " -DJS_RUNTIME_JSC=1") | ||
| elseif(${JS_RUNTIME} STREQUAL "v8") | ||
| string(APPEND CMAKE_CXX_FLAGS " -DJS_RUNTIME_V8=1") | ||
| else() | ||
| message(FATAL_ERROR "Unknown JS runtime ${JS_RUNTIME}.") | ||
| endif() | ||
|
|
||
| # Resolves "CMake Warning: Manually-specified variables were not used by the | ||
| # project" when any of the following variables is not used in some build | ||
| # configuration. | ||
| set(ignoreMe "${JS_RUNTIME_DIR}") | ||
|
|
||
| set(BUILD_DIR "${CMAKE_SOURCE_DIR}/build") | ||
| set(ANDROID_CPP_DIR "${CMAKE_SOURCE_DIR}/src/main/cpp") | ||
| set(COMMON_CPP_DIR "${CMAKE_SOURCE_DIR}/../Common/cpp") | ||
|
|
||
| add_subdirectory("${ANDROID_CPP_DIR}/worklets") | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.