Git Product home page Git Product logo

art's People

Contributors

aaronechiu avatar aleclarson avatar ayc1 avatar cpojer avatar davidaurelio avatar davidlrnt avatar dependabot[bot] avatar esemesek avatar fkgozali avatar fson avatar himabindugadupudi avatar hramos avatar ide avatar javache avatar mdvacca avatar micabe avatar mikeortiz avatar nicklockwood avatar rubennorte avatar sahrens avatar sebmarkbage avatar shergin avatar shwetsolanki avatar sophiebits avatar tadeuzagallo avatar tepamid avatar thesavior avatar ttsugriy avatar yungsters avatar zhongwuzw avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

art's Issues

iOS - Setting Stroke doesn't work on Shape

Bug

I am unable to set stroke to a shape on iOS. Android it works fine.

If I go to Shape.js and replace stroke={extractColor(props.stroke)} with stroke={props.stroke}, then I am able to see the stroke on iOS but the app crashes for Android

Environment info

React native info output:

React Native Environment Info:
    System:
      OS: macOS 10.14.5
      CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
      Memory: 514.37 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.16.0 - /usr/local/bin/node
      Yarn: 1.16.0 - /usr/local/bin/yarn
      npm: 6.9.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
      Android SDK:
        API Levels: 19, 23, 25, 26, 27, 28
        Build Tools: 23.0.1, 26.0.3, 27.0.3, 28.0.2, 28.0.3
        System Images: android-19 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 3.4 AI-183.6156.11.34.5692245
      Xcode: 10.3/10G8 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3 
      react-native: 0.59.9 => 0.59.9 

Library version: 1.0.1

Steps To Reproduce

  1. Go to ./example/components/Heart.js
  2. Replace <Shape d={HEART_SHAPE} fill={gradient} /> with <Shape d={HEART_SHAPE} stroke={'#00ff00'} />
  3. npx react-native run-ios
    ...

Describe what you expected to happen:

  1. Heart should be rendered with a green stroke

Reproducible sample code

use in module ART not callback onHostResume

Android : Build.VERSION_CODES.N
RN: 0.60.4

class: ARTSurfaceViewShadowNode
method: setThemedContext
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N) {
themedContext.addLifecycleEventListener(this);
}
why need this check?
if my android build code is Build.VERSION_CODES.N, will not callback method: onHostResume
public void onHostResume() {
drawOutput(false);
}

Implement Pattern in brush API

Feature Request

Currently there is Pattern brush, that was designed to be passed as a fill attribute, but it doesn't quite work. There are some missing parts in lib/helpers.js that need to be implemented.

More info here.

How it should work

import {Shape, Pattern} from '@react-native-community/art';
import someImage from '../images/image.png';


function Component() {
  return (
    <Shape d="{PATH}" fill={new Pattern(someImage, WIDTH, HEIGHT)} />
  );
}

`react-native run-ios` not working

Currently to run example on iOS device you have to open Xcode and click play button. Running yarn react-native run-ios doesn't work.

Error:

/Users/kacper/projects/oss/art/ios/ARTNode.h:8:9: fatal error: 'React/UIView+React.h' file not found
#import <React/UIView+React.h>
        ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.


error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening ART.xcodeproj

** BUILD FAILED **


The following build commands failed:
        CompileC /Users/kacper/projects/oss/art/ios/build/ART/Build/Intermediates.noindex/ART.build/Debug-iphonesimulator/ART.build/Objects-normal/x86_64/ARTShape.o /Users/kacper/projects/oss/art/ios/ARTShape.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

debug Error: Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening ART.xcodeproj

** BUILD FAILED **


The following build commands failed:
        CompileC /Users/kacper/projects/oss/art/ios/build/ART/Build/Intermediates.noindex/ART.build/Debug-iphonesimulator/ART.build/Objects-normal/x86_64/ARTShape.o /Users/kacper/projects/oss/art/ios/ARTShape.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

    at ChildProcess.buildProcess.on.code (/Users/kacper/projects/oss/art/node_modules/@react-native-community/cli/build/commands/runIOS/runIOS.js:231:16)
    at ChildProcess.emit (events.js:189:13)
    at maybeClose (internal/child_process.js:970:16)
    at Socket.stream.socket.on (internal/child_process.js:389:11)
    at Socket.emit (events.js:189:13)
    at Pipe._handle.close (net.js:597:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Run Jest with components using @react-native-community/art

I'm probably missing something, because I don't see this question anywhere in stack overflow or any other place. I'm trying to run Jest in a component and in the app we use '@react-native-community/art' but I'm receiving an unexpected token exception.

` ● Test suite failed to run

Jest encountered an unexpected token

This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.

By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".

Here's what you can do:
 • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
 • If you need a custom transformation specify a "transform" option in your config.
 • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/en/configuration.html

Details:

/Users/............./node_modules/@react-native-community/art/lib/index.js:10
export {default as Transform} from 'art/core/transform';
^^^^^^

SyntaxError: Unexpected token 'export'`

Have anyone experienced this before ?

not working using web

ERROR in ./node_modules/@react-native-community/art/lib/ARTSerializablePath.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /home/box/dev/rn_web/node_modules/@react-native-community/art/lib/ARTSerializablePath.js: Unexpected token, expected "," (21:27)

19 | // TODO: Refactor to class
20 | const SerializablePath = Class(Path, {

21 | initialize: function(path: string | SerializablePath) {
| ^
22 | this.reset();
23 | if (path instanceof SerializablePath) {
24 | this.path = path.path.slice(0);

using webpack.config.js

const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');

module.exports = {
  mode: 'development',
  entry: './src/index.js',
  output: {
    path: path.resolve(__dirname, './release'),
    filename: 'bundle.js',
  },
  plugins: [
    new HtmlWebpackPlugin({
      filename: 'index.html',
      template: './index.html',
    }),
  ],
  module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        include: [
          path.resolve('src'),
          path.resolve('node_modules/react-native-progress'),
          path.resolve('node_modules/@react-native-community')
        ],
        use: {
          loader: 'babel-loader',
          options: {
            presets: [
              '@babel/preset-env',
              '@babel/preset-react',
              {
                plugins: ['@babel/plugin-proposal-class-properties'],
              },
            ],
            plugins: ['babel-plugin-react-native-web'],
          },
        },
      },
    ],
  },
  devServer: {
    contentBase: path.join(__dirname, 'release'),
    compress: true,
    port: 4000,
  },
  resolve: {
    alias: {
      'react-native$': 'react-native-web',
    },
  },
};


Invariant Violation: requireNativeComponent: "ARTShape" was not found in the UIManager.

Bug

Invariant Violation: requireNativeComponent: "ARTShape" was not found in the UIManager.

This error is located at:
    in ARTShape (at Shape.js:61)
    in Shape (at Donut.js:59)
    in ARTGroup (at Group.js:35)
    in Group (at Donut.js:57)
    in ARTSurfaceView (at Surface.js:37)
    in Surface (at Donut.js:56)
    in RCTView (at Donut.js:54)
    in DonutChart (at App.js:32)
    in RCTView (at App.js:31)
    in RCTScrollContentView (at ScrollView.js:1038)
    in RCTScrollView (at ScrollView.js:1178)
    in ScrollView (at App.js:28)
    in RCTSafeAreaView (at SafeAreaView.js:55)
    in SafeAreaView (at App.js:27)
    in App (at renderApplication.js:40)
    in RCTView (at AppContainer.js:101)
    in RCTView (at AppContainer.js:119)
    in AppContainer (at renderApplication.js:39)

getNativeComponentAttributes
    getNativeComponentAttributes.js:29:2
createReactNativeComponentClass$argument_1
    requireNativeComponent.js:26:4
exports.get
    ReactNativeViewConfigRegistry.js:102:17

Environment info

React native info output:

 System:
    OS: macOS 10.15.2
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
    Memory: 540.21 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 10.16.3 - /usr/local/bin/node
    npm: 6.9.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 22, 23, 25, 26, 27, 28, 29
      Build Tools: 23.0.1, 25.0.0, 27.0.3, 28.0.2, 28.0.3, 29.0.0, 29.0.2
      System Images: android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.5791312
    Xcode: 11.3/11C29 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: 0.61.5 => 0.61.5 
  npmGlobalPackages:
    react-native-log-ios: 1.0.1
    react-native: 0.60.5

Library version: @react-native-community/art": "^1.1.2"

Steps To Reproduce

  1. Use the demo code below
  2. the simulators throws the above mentioned exception
    ...

Describe what you expected to happen:

  1. A chart should render

Reproducible sample code

import React from 'react';
import { View, Text } from 'react-native';
import * as d3 from 'd3';

import { Surface, Shape, Group } from '@react-native-community/art';

const userPurchases = [
  {
    itemName: 'Mountain Dew',
    price: 3
  },
  {
    itemName: 'Shoes',
    price: 50
  },
  {
    itemName: 'Kit Kat',
    price: 1
  },
  {
    itemName: 'Taxi',
    price: 24
  },
  {
    itemName: 'Watch',
    price: 100
  },
  {
    itemName: 'Headphones',
    price: 15
  },
  {
    itemName: 'Wine',
    price: 16
  }
];

const sectionAngles = d3.pie().value(d => d.price)(userPurchases);
const path = d3
  .arc()
  .outerRadius(100) //must be less than 1/2 the chart's height/width
  .padAngle(0.05) //defines the amount of whitespace between sections
  .innerRadius(0.6); //the size of the inner 'donut' whitespace

const DonutChart = () => {
  const height = 250,
    width = 250;
  const colors = d3
    .scaleLinear()
    .domain([0, userPurchases.length])
    .range([0, 255]);

  return (
    <View style={{ flex: 1, backgroundColor: 'grey' }}>
      <Text>Chart</Text>
      <Surface width={width} height={height}>
        <Group x={width / 2} y={height / 2}>
          {sectionAngles.map((section, index) => (
            <Shape
              key={section.index}
              d={path(section)}
              stroke="#000"
              fill={'#0000FF'}
              strokeWidth={1}
            />
          ))}
        </Group>
      </Surface>
    </View>
  );
};

export default DonutChart;

ART deprecation

Hey everyone,
I became a react-native-art maintainer some time ago when I extracted this module as a part of the Lean Core effort. From day zero, I've noticed that there were a lot of legacy code and the library itself relied on old and no longer maintained library - art. This makes it challenging to maintain this lib, especially for somebody who didn't create it. react-native-art was never officially documented in react-native which made me do a lot of calculated guesses - tried to do my best to create it, but I'm still not sure that it is 100% correct and complete.

React-native-svg is a much better alternative to ART and provides a lot more features and community support. Also, I don't see any point in splitting the community and maintaining two libraries that are used for the same exact reasons, and to achieve the same goals.

My only worry is that ART is still generating noticeable traffic on NPM, mainly because of react-native-progress.

Going forward into the future, I think we should deprecate react-native-art in favor of react-native-svg. WDYT?

Duplicate interface definition for class 'ARTBrush'

Hello,

Im on RN version 0.59.9 and want to use react-native-art instead of react-native's core ART library.

I installed it and linked it: react-native link @react-native-community/art
Now I have this in my Pod file: pod 'ReactNativeART', :path => './node_modules/@react-native-community/art'
But when I try to build I get this error:Duplicate interface definition for class 'ARTBrush'

How would I solve this error?
Thanks.

investigate auto-linking on 0.62

Bug

I believe art is not autolinking as expected in 0.62. Related: #54

even after having art in my node_modules and in package json, pod install output doesn't show art as auto-detected:

$ cd ./ios && pod install --repo-update && cd ..
Detected React Native module pods for A0Auth0, RNAWSCognito, RNCAsyncStorage, RNCMaskedView, RNDateTimePicker, RNGestureHandler, RNIap, RNImageCropPicker, RNReanimated, RNSVG, RNScreens, RNSound, react-native-branch, react-native-fbsdk, react-native-geolocation, react-native-netinfo, react-native-onesignal, react-native-safe-area-context, react-native-version-number, react-native-viewpager, and rn-fetch-blob

(expected to see art above)
as I posted on 54, adding to podfile directly fixes.

art 1.2.0, rn 0.62.2

Environment info

react-native info output:

 info Fetching system and libraries information...
System:
    OS: macOS Mojave 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
    Memory: 238.36 MB / 16.00 GB
    Shell: 5.0.16 - /usr/local/bin/bash
  Binaries:
    Node: 13.12.0 - ~/.nvm/versions/node/v13.12.0/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - ~/.nvm/versions/node/v13.12.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 21, 22, 24, 25, 26, 27, 28
      Build Tools: 23.0.1, 23.0.2, 26.0.1, 26.0.2, 26.0.3, 27.0.2, 27.0.3, 28.0.0, 28.0.3, 29.0.0, 29.0.1
      System Images: android-21 | Google APIs Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64
      Android NDK: Not Found
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5522156
    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_202-ea - /usr/bin/javac
    Python: 2.7.17 - /usr/local/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.62.2 => 0.62.2 
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 1.2.0

Steps To Reproduce

  1. react-native init 0.62.2 repo
  2. add art as dep
  3. import some shapes, surface etc...
  4. build project (notice pod install output)
  5. expect crash on "native module not found" type error
    ...

Describe what you expected to happen:

  1. no crash, auto link succeeds

Reproducible sample code

podfile

platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

def add_flipper_pods!(versions = {})
  versions['Flipper'] ||= '~> 0.33.1'
  versions['DoubleConversion'] ||= '1.1.7'
  versions['Flipper-Folly'] ||= '~> 2.1'
  versions['Flipper-Glog'] ||= '0.3.6'
  versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
  versions['Flipper-RSocket'] ||= '~> 1.0'

  pod 'FlipperKit', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configuration => 'Debug'

  # List all transitive dependencies for FlipperKit pods
  # to avoid them being linked in Release builds
  pod 'Flipper', versions['Flipper'], :configuration => 'Debug'
  pod 'Flipper-DoubleConversion', versions['DoubleConversion'], :configuration => 'Debug'
  pod 'Flipper-Folly', versions['Flipper-Folly'], :configuration => 'Debug'
  pod 'Flipper-Glog', versions['Flipper-Glog'], :configuration => 'Debug'
  pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configuration => 'Debug'
  pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configuration => 'Debug'
  pod 'FlipperKit/Core', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/CppBridge', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FBDefines', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
end

# Post Install processing for Flipper
def flipper_post_install(installer)
  installer.pods_project.targets.each do |target|
    if target.name == 'YogaKit'
      target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '5.0'
      end
    end
  end
  # This post_install hook adds the -DFB_SONARKIT_ENABLED=1 flag to OTHER_CFLAGS, necessary to expose Flipper classes in the header files
  file_name = Dir.glob("*.xcodeproj")[0]
    app_project = Xcodeproj::Project.open(file_name)
    app_project.native_targets.each do |target|
      target.build_configurations.each do |config|
        cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) '
        unless cflags.include? '-DFB_SONARKIT_ENABLED=1'
          puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...'
          cflags << '-DFB_SONARKIT_ENABLED=1'
        end
        config.build_settings['OTHER_CFLAGS'] = cflags
      end
      app_project.save
    end
    installer.pods_project.save
end

target 'App' do
  # Pods for App
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
  pod 'ReactNativeART', :path => '../node_modules/@react-native-community/art'

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  target 'AppTests' do
    inherit! :complete
    # Pods for testing
  end

  use_native_modules!

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  add_flipper_pods!
  post_install do |installer|
    flipper_post_install(installer)
  end
end

target 'App-tvOS' do
  # Pods for App-tvOS

  target 'App-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'OneSignalNotificationServiceExtension' do
    pod 'OneSignal', '>= 2.9.3', '< 3.0'
  end

end

peer dependencies

Bug

npm install
npm WARN @react-native-community/[email protected] requires a peer of react-native@^0.59.9 but none is installed. You must install peer dependencies yourself.

Environment info

package versions:

  • "@react-native-community/art": "^1.0.1",
  • "react": "16.8.6",
  • "react-native": "0.60.5",

Steps To Reproduce

npm install

Describe what you expected to happen:

no warnings. Why I should install RN 0.59 AND 0.60?

Library broken with RN 0.62.2

Bug report

Summay

I ran into this issue oblador/react-native-progress#179

After digging into it a bit, I see that the components have diverged in the main RN repo

Environment info

react-native info output:

System:
    OS: Windows 10 10.0.18362
    CPU: (24) x64 AMD Ryzen 9 3900X 12-Core Processor
    Memory: 17.50 GB / 31.95 GB
  Binaries:
    Node: 12.16.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.13.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
  IDEs:
    Android Studio: Version  3.6.0.0 AI-192.7142.36.36.6392135
  Languages:
    Java: Not Found
    Python: 2.7.15
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1
    react-native: 0.62.2 => 0.62.2
  npmGlobalPackages:
    *react-native*: Not Found

Library version: x.x.x

Steps to reproduce

  1. Clone this repo
  2. yarn upgrade
  3. yarn android

Exceptions are thrown

Error upon installing 1.0.1

SyntaxError: /<MY_PATH>/node_modules/@react-native-community/art/lib/ARTSerializablePath.js: Unexpected token, expected "," (21:27)

19 | // TODO: Refactor to class
20 | const SerializablePath = Class(Path, {

21 | initialize: function(path: string | SerializablePath) {
| ^
22 | this.reset();
23 | if (path instanceof SerializablePath) {
24 | this.path = path.path.slice(0);

Any ideas on how to resolve this issue?

ART breaking on 0.62-rc.0

Upgraded React Native in project to 0.62-rc.0.
Deleted node_modules, watchman, metro cache etc.
Build completes but application fails to start with the error:

error: bundling failed: Error: Unable to resolve module `react-native/Libraries/vendor/core/merge` from `node_modules/react-native-progress/node_modules/@react-native-community/art/lib/ClippingRectangle.js`: react-native/Libraries/vendor/core/merge could not be found within the project.

React Native version:

    OS: macOS 10.15.2
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 890.00 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 13.4.0 - /usr/local/bin/node
    Yarn: 1.21.1 - /usr/local/bin/yarn
    npm: 6.13.4 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.6010548
    Xcode: 11.2.1/11B53 - /usr/bin/xcodebuild
  npmPackages:
    react: ^16.11.0 => 16.12.0 
    react-native: ^0.62.0-rc.0 => 0.62.0-rc.0```
## Steps To Reproduce

1. React Native project that uses `art` (in this case, through `react-native-progress`)
2. Compile and launch the app.

Can't show anything

Bug

Environment info

React native info output:

React Native Environment Info:
System:
OS: macOS 10.14.5
CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
Memory: 1.54 GB / 8.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 12.4.0 - /usr/local/bin/node
Yarn: 1.16.0 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
Android SDK:
API Levels: 27
Build Tools: 27.0.3
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5199772
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.9 => 0.59.9
npmGlobalPackages:
react-native-cli: 2.0.1

 // paste it here

Library version: x.x.x

Steps To Reproduce

import {
    Surface,
    Group,
    Shape,
    LinearGradient,
    Path,
    Transform,
    ClippingRectangle,
} from '@react-native-community/art';

export class ARTPage extends Component {
    render() {
        const path = new Path();
        path.moveTo(1,1); //将起始点移动到(1,1) 默认(0,0)
        path.lineTo(300,1); //连线到目标点(300,1)
        return (
            <View style={this.props.style}>
                <Surface width={500} height={500}>
                <Shape d={new Path().moveTo(0, 0).lineTo(200, 200)} fill="#d39494" />
                </Surface>
            </View>

        )
    }
}

...

Describe what you expected to happen:

Reproducible sample code

So buggy library

Bug

No drawing shapes with line path

import {
  Surface,
  LinearGradient,
  Path,
  Text,
  Shape,
  Group,
  RadialGradient,
} from '@react-native-community/art'
  const surfaceWidth = Dimensions.get('window').width - 16
  const surfaceHeight = surfaceWidth

  const path = new Path()
    .moveTo(0, 0)
    .lineTo(100, 100)
    .lineTo(200, 420)
    .line(150, 80)
    .line(150, -80)
    .line(40, -200)
    .line(-190, 120)

      return <Surface visible={true} opacity={1.0} width={surfaceWidth} height={surfaceHeight}>
        <Group visible={true} opacity={1.0} x={surfaceWidth / 2 - 90} y={surfaceHeight / 2 - 70}>
          {/* <Shape visible={true} opacity={1.0} strokeWidth={12} stroke="#000" d={path} /> */}
          <Shape visible={true} opacity={1.0} d={path} strokeWidth={12} stroke="#000" />
        </Group>
      </Surface>

but when you change imports to react-native core like this

import {ART} from 'react-native'
const {
  Surface,
  LinearGradient,
  Path,
  Text,
  Shape,
  Group,
  RadialGradient,
  // } from '@react-native-community/art'
} = ART

all is working fine.

However ART still present in react-native core, you should use it instead @react-native-community/art, because second is still so buggy library.

Android - v1.0.3 Broke Stroke. Crashes device

Bug

Setting any stroke prop on android crashes the device. On the bright side, it now works on iOS :)

Currently using it w/ react-native-svg

NOTE: Used to work in v1.0.2

Environment info

Expo CLI 3.4.1 environment info:
System:
    OS: macOS 10.15.1
    Shell: 5.7.1 - /bin/zsh
Binaries:
    Node: 10.16.0 - ~/.nvm/versions/node/v10.16.0/bin/node
    Yarn: 1.16.0 - /usr/local/bin/yarn
    npm: 6.11.2 - ~/.nvm/versions/node/v10.16.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
IDEs:
    Android Studio: 3.4 AI-183.5429.30.34.5452501
    Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild
npmPackages:
    expo: 35.0.1 => 35.0.1
    react: 16.8.3 => 16.8.3 
    react-native: https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz => 0.59.8 
npmGlobalPackages:
    expo-cli: 3.4.1

Steps To Reproduce

-> Demo

Expected Behavior

Svg to be displayed

Actual Behavior

Device crashes

Imgur: Error Screenshot

Reproducible sample code

android.svg

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 105">
    <g fill="#97C024" stroke="#97C024" stroke-linejoin="round" stroke-linecap="round">
        <path d="M14,40v24M81,40v24M38,68v24M57,68v24M28,42v31h39v-31z" stroke-width="12" />
        <path d="M32,5l5,10M64,5l-6,10 " stroke-width="2" />
    </g>
    <path d="M22,35h51v10h-51zM22,33c0-31,51-31,51,0" fill="#97C024" />
    <g fill="#FFF">
        <circle cx="36" cy="22" r="2" />
        <circle cx="59" cy="22" r="2" />
    </g>
</svg>

android.tsx

import React, { FC } from "react";
import { SvgProps } from "react-native-svg";

import AndroidSvg from "./android.svg";

export const Android: FC<SvgProps> = ({
    fill = "#97C024",
    ...rest
}) => {

    return <AndroidSvg fill={fill} {...rest} />;
};

Cannot read 'hex' of undefined

Bug report

Summary

I'm using a library React Native Progress that uses this as a dependency and I'm getting an error:

Error: Requiring module "node_modules/@react-native-community/art/lib/Group.js", which threw an exception: TypeError: Cannot read property 'hex' of undefined.

TypeError: Cannot read property 'hex' of undefined

this is the linked issue I've opened in that library: Cannot read 'hex' of undefined

Environment info

react-native info output:

System:
    OS: macOS 10.15.6
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 181.57 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.6.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.6 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.7, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK: Not Found
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6626763
    Xcode: 11.7/11E801a - /usr/bin/xcodebuild
  Languages:
    Java: 14.0.2 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.0 => 0.63.0 
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 4.1.2

Steps to reproduce

  1. import * as Progress from 'react-native-progress';
  2. copy and paste this snippet: <Progress.Bar progress={0.3} width={200} />

[Bug] error: package android.support.v4.graphics does not exist

Bug

Environment info

React native info output:

info Fetching system and libraries information...
System:
    OS: macOS Mojave 10.14.5
    CPU: (4) x64 Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
    Memory: 61.13 MB / 8.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 10.15.3 - /usr/local/bin/node
    Yarn: 1.15.2 - /usr/local/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 27, 28
      Build Tools: 27.0.3, 28.0.3
      System Images: android-28 | Google Play Intel x86 Atom
  IDEs:
    Android Studio: 3.3 AI-182.5107.16.33.5314842
    Xcode: 11.3/11C29 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: 0.61.5 => 0.61.5 
  npmGlobalPackages:
    react-native-cli: 2.0.1

Library version: x.x.x

Steps To Reproduce

  1. cd android
  2. gradlew assembleDebug
  3. got error message
error: package android.support.v4.graphics does not exist import android.support.v4.graphics.ColorUtils;

Reproducible sample code

Metro bundler crashing on RN 0.60.0

Bug

After running react-native start, metro is crashing.

image

Environment info

System:
    OS: macOS 10.14.4
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 5.64 GB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 12.6.0 - ~/.nvm/versions/node/v12.6.0/bin/node
    Yarn: 1.13.0 - /usr/local/bin/yarn
    npm: 6.9.0 - ~/.nvm/versions/node/v12.6.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
    Android SDK:
      API Levels: 22, 23, 24, 25, 26, 27, 28
      Build Tools: 23.0.1, 23.0.2, 23.0.3, 25.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.0, 28.0.2, 28.0.3, 29.0.0
      System Images: android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom, android-23 | Google APIs Intel x86 Atom_64, android-24 | Google APIs Intel x86 Atom, android-24 | Google Play Intel x86 Atom, android-25 | Google Play Intel x86 Atom, android-26 | Google APIs Intel x86 Atom
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5522156
    Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6
    react-native: 0.60.0 => 0.60.0
  npmGlobalPackages:
    react-native-cli: 2.0.1

Library version: 1.0.0

Steps To Reproduce

  1. Create a new project, run it; check it works.
  2. Install this library, try to run it. See the error.
    ...

Describe what you expected to happen:

  1. After installing this app, I should not see the error in the metro console.

Reproducible sample code

SVG does not display.

Bug

I can't see any SVG in my react-native project, tried the examples in the examples folder, nothing works for me.

Environment info

React native info output:

System:
    OS: macOS 10.14.6
    CPU: (4) x64 Intel(R) Core(TM) i5-4308U CPU @ 2.80GHz
    Memory: 56.50 MB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
    npm: 6.10.3 - ~/.nvm/versions/node/v10.15.3/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5692245
    Xcode: 10.3/10G8 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6
    react-native: 0.60.5 => 0.60.5

Library version: 1.0.1

Steps To Reproduce

  1. react-native init test-art
  2. npm install @react-native-community/art
  3. cd ios && pod install
  4. Copy Heart.js example and paste in your root folder.
  5. Require Heart.js in your App.js and use it in the render method.
  6. npx react-native run-ios

Describe what you expected to happen:

  1. See a black background with a red heart in it, instead I just see a black background

Reproducible sample code

https://github.com/talal7860/react-native-art-example

Invariant Violation: requireNativeComponent: "ARTShape" was not found in the UIManager.

Bug

Running into Invariant Violation: requireNativeComponent: "ARTShape" was not found in the UIManager.

Environment info

info Fetching system and libraries information...
System:
    OS: macOS Mojave 10.14.6
    CPU: (4) x64 Intel(R) Core(TM) i7-7567U CPU @ 3.50GHz
    Memory: 2.49 GB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 13.3.0 - /usr/local/bin/node
    Yarn: 1.21.1 - /usr/local/bin/yarn
    npm: 6.13.2 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 28, 29
      Build Tools: 28.0.3, 29.0.1, 29.0.2
      System Images: android-28 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
      Android NDK: 20.1.5948944
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.5977832
    Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz => 0.61.4

React native info output:

Library version: 1.0.3

Steps To Reproduce

  1. After upgrading to react-native 0.61, the removal of the ART library required usage of the community library.
  2. Using the community library with this barcode builder renders the error after changing the following as per the library:

Code:

import {ART} from 'react-native';
const {Surface, Shape} = ART;

to:

import {Surface, Shape} from '@react-native-community/art';

Related issue: wonsikin/react-native-barcode-builder#49

Reproducible sample code

Link: https://github.com/wonsikin/react-native-barcode-builder/blob/529d87fc00a244ccf69ccd3e9716ab8c8a6def61/index.js#L174

   <View style={[styles.svgContainer, backgroundStyle]}>
        <Surface height={this.props.height} width={this.state.barCodeWidth}>
          <Shape d={this.state.bars} fill={this.props.lineColor} />
        </Surface>
        { typeof(this.props.text) != 'undefined' &&
          <Text style={{color: this.props.textColor, width: this.state.barCodeWidth, textAlign: 'center'}} >{this.props.text}</Text>
        }
      </View>

Error:

Invariant Violation: requireNativeComponent: "ARTShape" was not found in the UIManager.

This error is located at:
    in ARTShape (at Shape.js:58)
    in Shape (at Barcode.js:178)
    in ARTSurfaceView (at Surface.js:37)
    in Surface (at Barcode.js:177)
    in RCTView (at Barcode.js:176)
    in Barcode (at ProfileScreen/index.js:69)
    in RCTView (at CardItem.js:22)
    in CardItem (at connectStyle.js:392)
    in Styled(CardItem) (at ProfileScreen/index.js:68)
    in RCTView (at Card.js:21)
    in Card (at connectStyle.js:392)
    in Styled(Card) (at ProfileScreen/index.js:51)
    in RCTView (at View.js:10)
    in ViewNB (at connectStyle.js:392)
    in Styled(ViewNB) (at ProfileScreen/index.js:50)
    in RCTScrollContentView (at ScrollView.js:1038)
    in RCTScrollView (at ScrollView.js:1178)
    in ScrollView (at KeyboardAwareHOC.js:517)
    in KeyboardAwareScrollView (at Content.js:66)
    in Content (at connectStyle.js:392)
    in Styled(Content) (at ProfileScreen/index.js:49)
    in RCTView (at ImageBackground.js:60)
    in ImageBackground (at ProfileScreen/index.js:30)
    in RCTView (at Container.js:12)
    in Container (at connectStyle.js:392)
    in Styled(Container) (at ProfileScreen/index.js:29)
    in ProfileScreen (created by Connect(ProfileScreen))
    in Connect(ProfileScreen) (at SceneView.js:9)
    in SceneView (at DrawerView.js:149)
    in RCTView (at ResourceSavingScene.js:20)
    in RCTView (at ResourceSavingScene.js:16)
    in ResourceSavingScene (at DrawerView.js:148)
    in RCTView (at screens.native.js:83)
    in ScreenContainer (at DrawerView.js:138)
    in RCTView (at createAnimatedComponent.js:151)
    in AnimatedComponent (at DrawerLayout.js:446)
    in RCTView (at createAnimatedComponent.js:151)
    in AnimatedComponent (at DrawerLayout.js:445)
    in PanGestureHandler (at DrawerLayout.js:504)
    in DrawerLayout (at DrawerView.js:165)
    in DrawerView (at createNavigator.js:61)
    in Navigator (at SceneView.js:9)
    in SceneView (at StackViewLayout.tsx:899)
    in RCTView (at createAnimatedComponent.js:151)
    in AnimatedComponent (at StackViewCard.tsx:93)
    in RCTView (at createAnimatedComponent.js:151)
    in AnimatedComponent (at screens.native.js:59)
    in Screen (at StackViewCard.tsx:80)
    in Card (at createPointerEventsContainer.tsx:95)
    in Container (at StackViewLayout.tsx:971)
    in RCTView (at screens.native.js:83)
    in ScreenContainer (at StackViewLayout.tsx:383)
    in RCTView (at createAnimatedComponent.js:151)
    in AnimatedComponent (at StackViewLayout.tsx:379)
    in PanGestureHandler (at StackViewLayout.tsx:372)
    in StackViewLayout (at withOrientation.js:30)
    in withOrientation (at StackView.tsx:103)
    in RCTView (at Transitioner.tsx:267)
    in Transitioner (at StackView.tsx:40)
    in StackView (at createNavigator.js:61)
    in Navigator (at createKeyboardAwareNavigator.js:12)
    in KeyboardAwareNavigator (at createAppContainer.js:429)
    in NavigationContainer (at App.tsx:205)
    in RCTView (at Root.js:14)
    in Root (at connectStyle.js:392)
    in Styled(Root) (at App.tsx:204)
    in RootContainer (created by Connect(RootContainer))
    in Connect(RootContainer) (at setup.js:48)
    in PersistGate (at setup.js:47)
    in Provider (at setup.js:46)
    in StyleProvider (at setup.js:45)
    in Setup (at App.js:21)
    in App (at withExpoRoot.js:26)
    in RootErrorBoundary (at withExpoRoot.js:25)
    in ExpoRoot (at renderApplication.js:40)
    in RCTView (at AppContainer.js:101)
    in DevAppContainer (at AppContainer.js:115)
    in RCTView (at AppContainer.js:119)
    in AppContainer (at renderApplication.js:39)

getNativeComponentAttributes
    getNativeComponentAttributes.js:30:4
exports.get
    ReactNativeViewConfigRegistry.js:102:25
renderRoot
    [native code]:0
runRootCallback
    [native code]:0
unstable_runWithPriority
    scheduler.development.js:643:23
callFunctionReturnFlushedQueue
    [native code]:0

App Crashing on Android Version 8.0.0 & Version 8.1.0

Description

Recently getting lots of crash report from my users that their app is suddenly crashing while using. I tried multiple solutions, but nothing is solving this issue. These crashes are only happening on Oreo devices only.

React Native version:

System:
OS: macOS 11.3.1
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Memory: 81.34 MB / 8.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.1.0 - /usr/local/bin/node
Yarn: Not Found
npm: 7.11.2 - /usr/local/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
Android SDK:
API Levels: 23, 28, 29, 30
Build Tools: 28.0.3, 29.0.2, 30.0.3
System Images: android-22 | Google APIs Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.2 AI-202.7660.26.42.7351085
Xcode: 12.5/12E262 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_292 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.3 => 0.63.3
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Firebase Crashlytics error log

Fatal Exception: java.lang.RuntimeException
Unable to resume activity {<package_name>/<package_name>.MainActivity}: android.view.Surface$OutOfResourcesException
android.app.ActivityThread.performResumeActivity

Fatal Exception: java.lang.RuntimeException: Unable to resume activity {<package_name>/<package_name>.MainActivity}: android.view.Surface$OutOfResourcesException
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3741)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3781)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1749)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:192)
at android.app.ActivityThread.main(ActivityThread.java:6748)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:875)

Caused by android.view.Surface$OutOfResourcesException
at android.view.Surface.nativeLockCanvas(Surface.java)
at android.view.Surface.lockCanvas(Surface.java:337)
at com.reactnativecommunity.art.e.b(:14)
at com.reactnativecommunity.art.e.onHostResume(:1)
at com.facebook.react.bridge.ReactContext.onHostResume(:34)
at com.facebook.react.r.E(:23)
at com.facebook.react.r.L(:39)
at com.facebook.react.r.M(:5)
at com.facebook.react.q.j(:29)
at com.facebook.react.n.t(:2)
at com.facebook.react.m.onResume(:5)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1360)
at android.app.Activity.performResume(Activity.java:7249)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3716)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3781)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1749)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:192)
at android.app.ActivityThread.main(ActivityThread.java:6748)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:875

Set a shadow to Shape leads to EXC_BAD_ACCESS exception throwing

I have pretty simple Shape in my app — just a rectangle. I'm trying to set a shadow to it. App renders fine without shadow has been set but it crashes when I'm set it to Shape. Please review code snippet below and crash log attached.

const d = 'M 10, 10 h 150 v 50 h -150 z'; 
const shadowProps = {
 shadowOpacity: 1,
  shadowOffset: {
    x: 5, y: 5
  },
  shadowRadius: 5,
  shadowColor: '#000',
};

const App: () => React$Node = () => {
  return (
    <>
      <Surface width={500} height={500}>
        <Group>
          <Shape d={d} stroke="#000" strokeWidth={1} {...shadowProps} />
        </Group>
      </Surface>
    </>
  );
};

Please see crash log file attached.

arttest_2020-11-10-162846_PMaks-MacBook-Pro.log

Write unit tests

There is quite a bit of logic in lib directory, but there are no unit tests to verify if nothing is broken. Lack of unit tests makes it harder to refactor/change existing code.

TODO

  • - Implement unit tests for lib/helpers - This is the most important one because most of logic exists here
  • - Implement unit tests for lib/LinearGradient
  • - Implement unit tests for lib/RadialGradient

Add Typescript definitions

Typescript definitions weren't extracted from react-native and should be moved from DefinitelyTyped to this repository. It would also be nice if we had some kind of tests for those types.

ART still present in RN "core"

Question

The Libraries/ART module is still present in FB as of 0.60.4

Some libraries (react-native-progress) depend on it.

Should they move to @react-native-community/art or there was the decision on ART turned around ?

Filling the picture into the box is not possible

import {Surface, Shape, Path, Pattern} from '@react-native-community/art';
import localImage from './mindex/pages/iosble.jpg';
const pattern = new Pattern('localImage', 150, 200, 5, 5);

Hello, I went through all the information filled in the pictures, and finally got this, runtime will error

duplicate interface definition for class 'art brush'

I installed this package to use Circle progress (React-Native-Progress).
RN: 0.60.5
React-Native-Progress: 4.0.1

After installing pod, I got this issue.

I'm not sure it is interact with RN-SVG, coz I have installed React-Native-SVG also.
Please help

Cannot build Android app after RN upgrade

Bug

A problem occurred evaluating project ':app'.
> Project with path ':react-native-community_art' could not be found in project ':app'.

I've tried react-native link and manual installation. Both not working.

Environment info

react-native info output:

System:
    OS: macOS 10.15.3
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
    Memory: 18.86 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 10.14.1 - /usr/local/bin/node
    Yarn: 1.9.4 - /usr/local/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
    Android SDK:
      API Levels: 23, 25, 26, 27, 28
      Build Tools: 23.0.1, 23.0.3, 25.0.0, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.2, 28.0.3
      System Images: android-19 | Google APIs ARM EABI v7a, android-19 | Google APIs Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom
      Android NDK: 17.1.4828580
  IDEs:
    Xcode: 10.1/10B61 - /usr/bin/xcodebuild
  npmPackages:
    react: ^16.13.1 => 16.13.1 
    react-native: ^0.61.5 => 0.61.5 
  npmGlobalPackages:
    create-react-native-app: 1.0.0
    react-native-cli: 2.0.1
    react-native-git-upgrade: 0.2.7

Library version: 1.2.0

Steps To Reproduce

  1. RN upgrade 0.59.9 -> 0.61.5
  2. Migrate to react-native-community/art

Describe what you expected to happen:

  1. app builds correctly

ART don't work

ART Shape don't work

Environment info

react-native info
info 
  React Native Environment Info:
    System:
      OS: Linux 4.15 Ubuntu 18.04.2 LTS (Bionic Beaver)
      CPU: (8) x64 Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
      Memory: 631.46 MB / 15.55 GB
      Shell: 4.4.20 - /bin/bash
    Binaries:
      Node: 8.10.0 - /usr/bin/node
      Yarn: 1.16.0 - /usr/local/bin/yarn
      npm: 3.5.2 - /usr/bin/npm
    npmPackages:
      react: 16.8.3 => 16.8.3 
      react-native: 0.59.9 => 0.59.9 
    npmGlobalPackages:
      react-native-cli: 2.0.1

Library version: 1.0.1
"@react-native-community/art": "^1.0.1",
"@react-native-community/async-storage": "^1.6.1",
"@react-native-community/netinfo": "^3.2.1",
"axios": "^0.19.0",
"native-base": "^2.13.4",
"react": "16.8.3",
"react-native": "0.59.9",
"react-native-drawer": "^2.5.1",
"react-native-gesture-handler": "^1.3.0",
"react-native-image-size": "^1.1.2",
"react-native-orientation-locker": "^1.1.6",
"react-native-storage": "^1.0.1",
"react-native-vector-icons": "^6.6.0",
"react-navigation": "^3.11.1"

MyCode:

import React, { Component } from 'react';
import { View, StyleSheet } from 'react-native';
import {
    Surface,
    ClippingRectangle,
    Shape,
    Path,
  } from '@react-native-community/art';
class drawer extends Component {
    render() {
        let path = new Path();
		path.moveTo(0,0);
		path.lineTo(100,0);
		path.lineTo(100,100),
		path.lineTo(0,100);
		path.close();
       return(
        <View style={styles.app}>
       <Surface width={500} height={500}>
      <Shape d={new Path().moveTo(0, 0).lineTo(200, 200)} fill="#d39494" stroke="#f00" strokeWidth={20} width={500} height={500}/>
    </Surface>
    </View>
       )
    }
};
const styles = StyleSheet.create({
    app: {
        flex: 1
    },
    surface: {
        backgroundColor: '#f00'
    }
})

Render Result:

2019-08-05 11-24-59 的屏幕截图

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.