text:
Update to 0.29.0 got problems with axios.d.js and bluebird.d.js

Here is my output after I updated from 0.27.0 to 0.29.0
[0] node_modules/flow-interfaces/interfaces/axios.d.js:27
[0]  27:       successHandler: ?(response: AxiosXHRConfig<T>) => Promise<AxiosXHRConfig> | AxiosXHRConfig,
[0]                                                                      ^^^^^^^^^^^^^^ Library type error:
[0]  27:       successHandler: ?(response: AxiosXHRConfig<T>) => Promise<AxiosXHRConfig> | AxiosXHRConfig,
[0]                                                                      ^^^^^^^^^^^^^^ AxiosXHRConfig. Application of polymorphic type needs <list of 1 argument>. (Can use `*` for inferrable ones)
[0]
[0] node_modules/flow-interfaces/interfaces/axios.d.js:27
[0]  27:       successHandler: ?(response: AxiosXHRConfig<T>) => Promise<AxiosXHRConfig> | AxiosXHRConfig,
[0]                                                                                ^^^^^^^^^^^^^^ Library type error:
[0]  27:       successHandler: ?(response: AxiosXHRConfig<T>) => Promise<AxiosXHRConfig> | AxiosXHRConfig,
[0]                                                                                ^^^^^^^^^^^^^^ AxiosXHRConfig. Application of polymorphic type needs <list of 1 argument>. (Can use `*` for inferrable ones)
[0]
[0] node_modules/flow-interfaces/interfaces/bluebird.d.js:106
[0] 106:   reflect(): Promise<PromiseInspection>;
[0]                           ^^^^^^^^^^^^^^^^^ Library type error:
[0] 106:   reflect(): Promise<PromiseInspection>;
[0]                           ^^^^^^^^^^^^^^^^^ PromiseInspection. Application of polymorphic type needs <list of 1 argument>. (Can use `*` for inferrable ones)
[0]
[0] node_modules/flow-interfaces/interfaces/bluebird.d.js:118
[0] 118:   promise: Promise;
[0]                 ^^^^^^^ Library type error:
[0] 118:   promise: Promise;
[0]                 ^^^^^^^ Promise. Application of polymorphic type needs <list of 1 argument>. (Can use `*` for inferrable ones)
[0]
[0]
[0] Found 4 errors

npm ls axios
no result

npm ls bluebird
react-redux-universal-hot-example@0.9.0 /Users/pc/js/react/react-redux-universal-hot-example
├─┬ concurrently@0.1.1
│ └── bluebird@2.9.6
├─┬ eslint@2.13.1
│ └─┬ table@3.7.8
│   └── bluebird@3.4.1
└─┬ karma@1.1.1
  └── bluebird@3.4.1

Not sure I understand all the errors but definitely the last one in bluebird should be Promise<T> for some T. We made a recent change where we require type arguments to be passed in explicitly to generic types. cc @bhosmer
Where are you getting the interfaces from? See also https://github.com/flowtype/flow-typed

The errors actually come from this library in my node_modules:  "flow-interfaces": "^0.6.1"
How can I declare things to solve this library type problems?

I understand my problem, I am using flow-interfaces and I have this config
[libs]
./node_modules/flow-interfaces/interfaces/
./interfaces/

I will try to install flow-typed for my libs

I solved the issue by just adding the flow-interfaces definitions that I actually use and not all of them at one.
I installed one flow-typed package
flow-typed install -f 0.29 redux@3.5.2

my config file look like such:
[libs]
./node_modules/flow-interfaces/interfaces/react-redux.d.js
./node_modules/flow-interfaces/interfaces/CSSModule.d.js
./flow-typed/npm/
./interfaces/

module.name_mapper.extension='scss' -> 'CSSModule'
```

authors: avikchaudhuri casertap

repo: facebook/flow


text:
String.prototype.concat() should accept Array<mixed>, not only Array<string>

Missing/Incorrect APIs
String.prototype.concat should allow any type as its arguments.
concat(...values: Array<string>): string should be concat(...values: Array<mixed>): string

Relevant documentation
According to the MDN docs for the concat() method of the String built-in type:

If the arguments are not of the type string, they are converted to string values before concatenating.

Passing numbers, objects, etc to String.prototype.concat is is valid JS behavior but causes an error in Flow.
This is important because the alternative to String#concat is the + operator, but that operator is problematic because using + to concatenate a string to an object will cause valueOf to be called on the object before it's coerced to a string. Some types (notably the new ECMAScript "Temporal" date/time API that's currently in Stage 3) will throw when valueOf is called so that users don't inadvertently use < or > to compare objects that have specialized comparison methods.
BTW, I discovered this Flow problem while fixing React's use of the + operator on strings and objects, because React was crashing and/or displaying confusing error messages when Temporal instances were rendered or used as props. This issue is causing https://github.com/facebook/react/pull/22064 to fail its Flow check.
PR coming!

There are a lot of instances where Flow requires an actual string rather than letting JS implicitly cast it. I think it's a design decision.
You can always do .concat(String(mixedThing)) to produce the same result.

Yep, agree. Per @samwgoldman at https://github.com/facebook/react/pull/22064#issuecomment-900005558, this isn't a change that Flow is going to make, so I'm going to close this issue. Thanks!

source: gharchive/issue

authors: FezVrasta justingrant

license: MIT

license_type: permissive

license_source: github-api


text:
allow string in React.createElement

Very simple change. It does allow something like this though:
render() {
    const Cmp = true ? 'div' : Foo; // Foo is a React Component
    return (<Cmp/>);
  }

As JSX is basically React.createElement calls flow should allow strings - just like the documentation says.

cc @samwgoldman / @avikchaudhuri -- can you confirm that this shouldn't mess up any of the other React sorcery?
(travis results still pending, but I'm assuming they should show if any obvious problems arise)

Yeah, unfortunately this does cause issues, but unrelated to any of the recent changes. I ran into similar issues when attempting to add support for stateless functional component. In short, the union there causes errors to be deferred by the speculative match process, and sometimes the errors are deferred indefinitely :(

@samwgoldman Oh? I've changed it and uses that on our work project. Worked fine. (~400 React Components and several Services handling React Components)
Could you provide an example where the union messes stuff up?

I'll confirm in a bit, but it's not the kind of issue that would cause errors in a previously correct project. A simple way to repro is a simple JSX expression with an expected error. For example, <Foo /> for a component class Foo that has a required parameter.

Could this be fixed with the latest changes to react stuff? (React.Component<DefaultProps, Props, State> reworked to just class properties)
I've created a small test with 2 files. One Component with required Prop and one Prop that has a Cmp that is either a string or that Comp with required Prop.
// @flow
import React from 'react';

export default class Bar extends React.Component {
  props: {
    test: number,
  };
  render() {
    return (
      <div>
        {this.props.test}
      </div>
    )
  }
}

// @flow
import React from 'react';
import Bar from './Bar';

export default class Foo extends React.Component {
  render() {
    const Cmp = Math.random() < 0.5 ? 'div' : Bar;
    return (<Cmp/>);
  }
}

Flow correctly throws an Error as Cmp does not have the required Prop. I've though that is how it is supposed to be. As Cmp might be a Component that requires the prop flow wants that prop. No way for flow to know if it needs it or not.

OK, so this change is fine. The stateless functional component change is still problematic, but this doesn't hit the same problem—it does if you put string first in the union.
Can you add a test? The snippet from the PR description seems like a good one.

I've added a test with and one without a required paramter.
As you said this might be a problem it's probably safer to have both as tests.

Thanks for the pull request! I'll get this imported, reviewed and checked in!

I made a small change to this before merging. As @jeffmo suggested, by using $Keys<$JSXIntrinsics> instead of just string, Flow is able to complain if you set $JSXIntrinsics (like this test does) and use a jsx intrinsic that hasn't been defined. By If $JSXIntrinsics isn't explicitly set, then this will basically work the same way.

source: gharchive/pull-request

authors: gabelevi jeffmo marudor samwgoldman


text:
[pulse] Fix use of is_functional in unknown_call function

is_functional in PulseCallOperations.unknown_call is set but never used.

Thank you @danielmercier, great catch!

authors: danielmercier jvillard

repo: facebook/infer

license: mit

license_source: bigquery


text:
Fix for 4286: Compare Maps and Sets by value rather than order

Summary

Fix for https://github.com/facebook/jest/issues/4286
Modify iterableEquality method so that, if two objects have the same constructor with .size property (i.e., Map and Set), check if the sizes are same. If not, exit early and return false. If yes, perform a union and if the size is still the same, return true. Otherwise, keep checking for deep equality (cases where the elements contain another object)
Test plan
Added test cases to matchers.test.js

Nice!! Do you mind removing the ... because we don't transform it and still support node 4? :)

d'oh! of course :)
@cpojer Do you think it's worth separating out iterableEquality to handle the nested comparison for maps/sets differently from arguments object and TypedArrays? Current implementation won't work for
expect(new Set([1, 2, {1: 'match'}])).toEqual(new Set([{1: 'match'}, 1, 2]));

because sets and maps set entries via === strict equality comparison. We'd have to iterate over each set again for every object to find and do a nested comparison. Thoughts?

Yep, I think that makes sense.
Thank you so much for this PR and fixing issues in Jest :)

Thanks for the fix!

authors: cpojer kaylieEB thomas-mcdonald

repo: facebook/jest


text:
Bug: TextNode setStyle is not working

Lexical version: 0.11.1
Steps To Reproduce
code example:
  const textNode = $createTextNode(text);

  let paragraphNode;
  if ($getRoot().getLastChild().__size === 0) {
    paragraphNode = $getRoot().getLastChild();
  } else {
    paragraphNode = $createParagraphNode();
  }
  $getRoot().append(paragraphNode.append(textNode));
  textNode.setStyle('color:transparent;');
  console.log('textNode', textNode);

This is the textNode console.log result
I couldn't find any good documentation on setStyle for TextNode.
Only one example found in playground was for selection, but even with that method, setStyle shows the style when looking at the log of the node.
You cannot check the style in the editor element to which the node is appended.
With the effect confirmed in the playground, I was able to check the style in the editor element, but I can't figure out what's wrong.
The code calls the code in editor.update when a new text value is received.
I'm suffering a lot while developing with Lexical, please help
The current behavior

And when appending the corresponding TextNode, the corresponding node is appended, but I can't understand why the style doesn't eat it. If I say that it is because it is confirmed in the node that I shoot in the console, but it is different in the node that is applied to the actual dom, isn't it a problem of lexical?
If not, can you show me an example code to see if setStyle works when creating a new node?
My point is that I want to know the predictable possibility of an error when I see a case where the style is checked in my console log but not applied to the actual DOM, and if I can't guess it, I would like to see a code example as a plugin of setStyle that works normally when I add a new text node to the editor.

repo: facebook/lexical


text:
The keyboard may not show sometimes when using Oppo phone

Generally speaking,the keyboard shows when the textinput is on focus ,however,when I use Oppo phone to test my app,the keyboard may not show sometimes,and after it happens,the keyboard will not show any more otherwise exiting the app completely or long pressing the textinput which can pop up a window to make the keyboard show.

My version is 0.39.0,and I have not tested any other version.

My app is ok on iphone and some other android phones except Oppo phone

Some people have the same problem with me

Hey, thanks for reporting this issue!
It looks like your description is missing some necessary information. Can you please add all the details specified in the template? This is necessary for people to be able to understand and reproduce the issue being reported.
I am going to close this, but feel free to open a new issue with the additional information provided. Thanks!

i have the same problem

I have the same problem, can you tell me how to solve it?

repo: facebook/react-native


text:
[PickerIOS & TabBarIOS] Breaks when rotated.

PickerIOS does not scale nicely when the device is rotated. Rotate once to the right, then back and it ends up in a weird state. Attaching screenshots to illustrate. Tried various flexbox layouts but the same issue persists. This is using the sample code stripped down to just one picker.

rotation does not works very well with flexbox model here - I believe it's layout (even simpliest one) whats broken, no picker itself since he is pure native.

watch

Collapsing #1206 into this as well

Just in case someone has not yet seen the issue...

I believe I remember seeing a commit that fixes this, if it still persists I can reopen

authors: achang28 admmasters brentvatne iostalk romanonthego


text:
[XmlHttpRequest] xhr.upload.onprogress not working with xhr.send({uri: 'file:///...'})

I think, it's a bug
I'm trying to upload video with youtube v3 API, looking on this example.
So, I wrote something like this:
var xhr = new XMLHttpRequest();
xhr.open('PUT', this.url, true);
xhr.setRequestHeader('Content-Type', this.contentType); <=== video/mp4
xhr.setRequestHeader('Content-Range', 'bytes ' + this.offset + '-' + (end - 1) + '/' + this.filesize);
xhr.setRequestHeader('X-Upload-Content-Type', this.filetype);  <=== video/mp4

if (xhr.upload) {
  xhr.upload.addEventListener('progress', this.onProgress);
}
xhr.onload = this.onContentUploadSuccess_.bind(this);
xhr.onerror = this.onContentUploadError_.bind(this);
xhr.send({uri: this.file.path});  <=== file:///.....

and it works, i have xhr.onload and xhr.onerror and video file is uploaded to youtube and played there.
But i haven't xhr.upload.onprogress.
I try xhr.onprogress, xhr.upload.onprogress, xhr.upload.addEventListener - all of this not works.
BUT!
When i use FormData
let data = new FormData();
data.append('File', {
      uri:  source.path,
      type: source.type,
      name: source.name
});
var xhr = new XMLHttpRequest();
  xhr.open('PUT', this.url, true);
  //xhr.setRequestHeader('Content-Type', this.contentType);
  //=== comment this, because it throw error 'multipart != video/mp4'
  //xhr.setRequestHeader('Content-Range', 'bytes ' + this.offset + '-' + (end - 1) + '/' + this.filesize);
  //=== comment this, because sending data size != filesize
  xhr.setRequestHeader('X-Upload-Content-Type', this.filetype);

  if (xhr.upload) {
    xhr.upload.addEventListener('progress', this.onProgress);
  }
  xhr.onload = this.onContentUploadSuccess_.bind(this);
  xhr.onerror = this.onContentUploadError_.bind(this);
  xhr.send(data); <==== FormData

xhr.upload.onprogress is working. But then youtube api return processing error, because it support only 'video/*' and 'application/octet-stream' and does not support 'multipart/form-data'.
What I do wrong and what I need to do for using xhr.upload.onprogress WITHOUT FormData?
P.S. sorry for my ugly english

react-native v0.47.2:
node v8.2.1:
npm v5.3.0:

Target Platform: Android
Development Operating System: MacOS
Build tools: Android SDK

At this point this doesn't seem like a particular bug in React Native. The issue may be in your own JavaScript code. I know it's frustrating to see your issues closed but I recommend working on this a bit more, and letting us know if you find that this is definitely an issue that occurs due to a bug in React Native itself. Thanks for understanding.

@1stman: try putting your xhr.upload.onprogress definition before you do your xhr.open. That may help.

authors: 1stman danww hramos


text:
For security reasons, WebView is not allowed in privileged processes

RN:0.58.1
OS:android 8.1
if AndroidManifest.xml set android:sharedUserId="android.uid.system",
I see the following error (on react-native run-android):
java.lang.UnsupportedOperationException: For security reasons, WebView is not allowed in privileged processes
at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:96)
at android.webkit.WebView.getFactory(WebView.java:2194)
at android.webkit.WebView.ensureProviderCreated(WebView.java:2189)
at android.webkit.WebView.setOverScrollMode(WebView.java:2248)
at android.view.View.(View.java:3588)
at android.view.View.(View.java:3682)
at android.view.ViewGroup.(ViewGroup.java:497)
at android.widget.AbsoluteLayout.(AbsoluteLayout.java:55)
at android.webkit.WebView.(WebView.java:544)
at android.webkit.WebView.(WebView.java:489)
at android.webkit.WebView.(WebView.java:472)
at android.webkit.WebView.(WebView.java:459)
at android.webkit.WebView.(WebView.java:449)

WebView in React Native is deprecated and will be removed in the future. It's forked and maintained at https://github.com/react-native-community/react-native-webview, please use it and file an issue there.


text:
Text numberOfLines={2} and other than ellipsizeMode="tail" breaks on Android

Line constraint with ellipsizeMode set on a text component cannot perform any truncation on Android when numberOfLines is greater than 1 and ellipsizeMode other than 'tail'.
This fails: <Text numberOfLines={2} ellipsizeMode="middle" >Some long text</Text>
This works: <Text numberOfLines={1} ellipsizeMode="middle" >Some long text</Text>
Problem simile to #19117
React Native version:
System:
OS: macOS 10.15.7
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 5.91 GB / 32.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 14.7.0 - /usr/local/bin/node
Yarn: Not Found
npm: 6.14.7 - /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 14.1, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
Android SDK:
API Levels: 27, 28, 29
Build Tools: 27.0.3, 28.0.3, 29.0.3, 30.0.0
System Images: android-28 | Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-R | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6626763
Xcode: 12.1/12A7403 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_252 - /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
Steps To Reproduce
On Android, combination of numberOfLines={2} and ellipsizeMode="middle" on a Text component fails to truncate the text and no ellipses are visible. When I remove ellipsizeMode it defaults to tail and it truncates the text without issue.
Code Snippet
//...
const lorem = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.';
//...
<Text numberOfLines={2} ellipsizeMode={'middle'}>
  {lorem}
</Text>
//...

Expected Results
I expect Android should have the same functionality as iOS
Correct iOS Screenshot

Actual Behavior
I have been working on this within my app and below is a screenshot of the section of my app where this is used.
Incorrect Android Screenshot

It is not supported by the androidsdk when using setMaxLines > 1. I will update the react-native docs
https://github.com/aosp-mirror/platform_frameworks_base/blob/523e3b9b7922685cff53d046884e0037004dcea7/core/java/android/widget/TextView.java#L10372-L10375
     * If {@link #setMaxLines} has been used to set two or more lines,
     * only {@link android.text.TextUtils.TruncateAt#END} and
     * {@link android.text.TextUtils.TruncateAt#MARQUEE} are supported
     * (other ellipsizing types will not do anything).
     *
     * @attr ref android.R.styleable#TextView_ellipsize
     */
    public void setEllipsize(TextUtils.TruncateAt where) {
        // TruncateAt is an enum. != comparison is ok between these singleton objects.
        if (mEllipsize != where) {
            mEllipsize = where;

            if (mLayout != null) {
                nullLayouts();
                requestLayout();
                invalidate();
            }
        }
    }

This is still happening on RN 0.64.0.

Do you still experience this issue?
I have four years of experience maintaining facebook/react-native and I specialize in the Text and TextInput components. I currently have 58 facebook/react-native PRs.
If you still experience this issue, I will prepare a patched release with the fix.
Thanks a lot


text:
Unable to run a new react native project using  react native cli on ios simulator

Description
I am trying to run a freshly created react native project, but It does not seem to work out. I receive the following error:
2022-07-22 09:31:45.006 xcodebuild[96346:8084479] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-07-22 09:31:45.006 xcodebuild[96346:8084479] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
** BUILD FAILED **

The following build commands failed:
        CompileC /Users/ramiel/Library/Developer/Xcode/DerivedData/AwesomeProject-dcybszwqvhaflbhahawancnnffvo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/x86_64/SysUio.o /Users/ramiel/Desktop/Typescript/react\ native/AwesomeProject/ios/Pods/RCT-Folly/folly/portability/SysUio.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RCT-Folly' from project 'Pods')
        CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'YogaKit' from project 'Pods')
(2 failures)

Version
0.69.2
Output of npx react-native info
System:
OS: macOS 12.4
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 136.95 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.16.0/bin/yarn
npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
Watchman: 2022.06.27.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.15 - /usr/local/opt/openjdk@11/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.0.0 => 18.0.0
react-native: 0.69.2 => 0.69.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce

create a new react native project using react native cli
run it on an ios simulator

Snack, code example, screenshot, or link to a repository
That's all I have in App.js:
import {StyleSheet, Text, View} from 'react-native';
import React from 'react';

const App = () => {
  return (
    <View style={{alignItems: 'center', justifyContent: 'center', flex: 1}}>
      <Text>App</Text>
    </View>
  );
};

export default App;

const styles = StyleSheet.create({});

I encountered the same error but it was more like a warning, I could run the app on both android and IOS platforms. (I think this error began to show up after my Xcode got updated  -v 13.4.1).

authors: JoelDeonDsouza itsramiel


text:
lineHeight not distributed evenly in TextInput

Description
When you have a TextInput with lineHeight > fontSize the remaining space isn't distributed evenly around the text. For example:
<View style={styles.container}>
  <Text style={styles.text}>Text</Text>
  <TextInput style={styles.text} value="TextInput" />
</View>

const styles = StyleSheet.create({
  container: {
    alignItems: 'center',
    flexDirection: 'row',
    gap: 10,
  },
  text: {
    fontFamily: 'Inter-Regular',
    fontSize: 16,
    lineHeight: 26,
    letterSpacing: -0.01,
    color: '#111827',
    textAlignVertical: 'top',
    padding: 0,
    backgroundColor: 'pink',
  },
});

Result:
All the extra space in the TextInput case is on top of the text, making it hard to vertically align TextInputs (e.g. with a Text label preceding it on the same line).

React Native Version
0.71.7
Output of npx react-native info
System:
    OS: macOS 13.4.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 63.06 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.16.1 - ~/.nvm/versions/node/v18.16.1/bin/node
    Yarn: Not Found
    npm: 9.5.1 - ~/.nvm/versions/node/v18.16.1/bin/npm
    Watchman: 2023.07.03.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.12.1 - /Users/tibbe/.rbenv/shims/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
    Android SDK: Not Found
  IDEs:
    Android Studio: 2022.2 AI-222.4459.24.2221.10121639
    Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.19 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0
    react-native: 0.71.7 => 0.71.7
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to reproduce
Use the above snippet in the iOS simulator.
Snack, screenshot, or link to a repository
https://snack.expo.dev/UEBid9Vxh

The best workaround I have so far is to not set lineHeight at all for single line TextInputs and use e.g. a surrounding View to try to align the Text and TextInput. That doesn't work with multiline however because there you want some amount of lineHeight. It's also a bit annoying in general because it means you have to define different styles for Text and TextInputs that only differ in lineHeight.

After some more testing it seems the issue is limited to iOS. Both web and Android look correct.

Any other information I can provide to clarify the issue?

So far unresolved! @shergin @mdvacc @sammy-SC @cortinico @RSNara @cortinico @yungsters @NickGerleman

This is still an issue.

I can also reproduce it. Problem affects only iOS and only <TextInput />. lineHeight is rendered fine for <Text />
https://snack.expo.dev/@adamfromattio/ios-problem-with-lineheight?platform=ios

Just came across this. Thought maybe #46362 fixes it, but issue is still there.
Tested on 0.77.0-nightly-20241001-223e98cc4
Can be reproduced with:
import {StyleSheet, Text, TextInput, View} from 'react-native';

function App() {
  return (
    <View style={{justifyContent: 'center', flex: 1}}>
      <View style={styles.container}>
        <TextInput value="Type something" style={styles.text} />
      </View>
      <View style={styles.container}>
        <Text style={styles.text}>Type something</Text>
      </View>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    backgroundColor: 'gray',
    padding: 16,
  },
  text: {
    backgroundColor: 'white',
    fontSize: 16,
    lineHeight: 1.52 * 16,
    color: 'black',
    padding: 0,
  },
});

export default App;

any update here? is this being worked on?

https://github.com/facebook/react-native/pull/46362 is gated right now for testing, we will open it up soon

authors: TheAdamBorek itsramiel jpope19 mellyeliu showtan001 tibbe


text:
[upgrade] 0.13 to 0.14, have to change every asset manually?

I have checked http://facebook.github.io/react-native/docs/upgrading.html#from-0-13-to-0-14
and know 0.14 use new asset system
but if upgrade from 0.13 to 0.14, to use the new asset system, do I have to change every image folder and require src location manually?

You can write a script to do it for you.

@viix Yes, unfortunately thats the case :(
But as @satya164 suggested, you can try writing a script if you have a lot of assets to deal with.

@satya164 @christopherdro got it, thanks

authors: christopherdro satya164 viix


text:
a frame time window auto popup

Description
Im using rn 0.75.4 with new arch , when app is hung or lag. or  about to crash. there come out a popup show.  [appanme]Debug xxxx ms. what is this. and how to turn off.  app  is release build

Steps to reproduce
1.make app hung for seconds
2. the frame render time window auto pops  up
React Native Version
0.75.4
Affected Platforms
Runtime - iOS
Areas
Fabric - The New Renderer
Output of npx react-native info
none

Stacktrace or Logs
none

Reproducer
none
Screenshots and Videos
No response

@landali9999 I'm sorry you are experiencing that. This is not something coming from React Native itself. It is probably something coming from some of the libraries you are using.
Do you have any library related to performance? Perhaps there are some performance lbraries that should be removed in release mode.
A couple of extra questions:

does it happens if you disable the New Architecture?
can you try to migrate to 0.76? The New Architecture should be more stable there.
if you can trigger the crash in release mode, while attached to Xcode, you can try to use the Debug View Hierarchy tool to see from where the UI element comes from.


text:
[iOS][upgrading from 0.19] XMLHttpRequest uploads file with incorrect mime-type after upgrade from 0.19?

Hi all,
I'm seeing some strange behavior after upgrading from RN 0.19. My situation is as follows: User selects an image to upload from assets from CameraRoll. App requests a signed URL from app backend to upload the image to S3, passing the file name and file mime-type (parsed from the EXT= part of asset-library URIs). File is uploaded to S3 as follows:
var xhr = new XMLHttpRequest()
xhr.onload = () => {
   ....
}
xhr.open('PUT', signedUrl)
xhr.setRequestHeader('Content-Type', parsedMimeType)
xhr.timeout = 90000
xhr.send({uri: localFileUri})

But the upload fails, as S3 will calculate the signed url always using a mime type of image/jpeg, which results in a different signature, and S3 returns a 403. I'm fairly confident that this is not an issue in the upload or signed URL logic, as the same code will work without issue on Android. On iOS on RN 0.19 however, I can upload without issue when uploading from a simulator (uploading both .jpgs and .pngs), but cannot upload from a physical device without overriding the parsed mime type in favor of using image/jpeg. Once I upgrade to RN 0.20, both iOS simulator and device fail (with and without mime type forcing) and Android continues to work.
Some questions:

Is there a better way I can view the XMLHttpRequest as it hits the network? Can I see or otherwise log the request headers that get sent and the request body? I'm curious to find where the type mismatch occurs - S3 is either inferring the image/jpeg type from the file or perhaps the Content-Type header is being overwritten?

Is there a better way to retrieve the mime-type of assets retrieved from the CameraRoll?

Try this - xhr.send({ uri: uri, type: 'image/png' }) instead. Works for me.

@satya164 I spent so much time for this issue, you saved me 👍

For me, the core cause of this issue was due to https://github.com/facebook/react-native/issues/7329.


text:
Android: Keep ScrollView content visible after edits

Suppose that the user is scrolled to the bottom of a ScrollView. Next, the ScrollView's content is edited such that the height of the content changes and the current scroll position is larger than the new height of the content. Consequently, the user sees a blank ScrollView. As soon as the user interacts with the ScrollView, the ScrollView will jump to its max scroll position.
This change improves this scenario by ensuring that the user is never staring at a blank ScrollView when the ScrollView has content in it. It does this by moving the ScrollView to its max scroll position when the scroll position after an edit is larger than the max scroll position of the ScrollView.
Here are some pictures to illustrate how this PR improves the scenario described above:

Test plan (required)
Verified ScrollView keeps the content visible after an edit in a test app. Also, my team uses this change in our app.
Adam Comella
Microsoft Corp.

Thanks for fixing this! I'll let @astreet review.

@astreet Thanks for the feedback. I pushed changes to address your comments and rebased my branch on master.
I'd like to point out one possible concern with the refactoring of the max scroll y logic into a helper. I noticed that one place that calls it used to use getHeight while the other place used getMeasuredHeight. Through reading the docs and testing, I think getHeight will work okay in the onLayoutChange method (it used to use getMeasuredHeight). However, I wanted to point this out in case you have any knowledge in this area.

I think getHeight is more correct iirc, since getMeasuredHeight just returns how big the view wants to be, not how big it actually draws.

(Also, I appreciate you sticking with this, sorry it's taking so long)

@facebook-github-bot shipit
Thanks!!

authors: astreet mkonicek rigdern


text:
Update PermissionsAndroid docs to use new APIs

It seems that the requestPermission and checkPermission APIs from PermissionsAndroid have been deprecated in react-native 0.40.0., but they are still used in the description and example.
This commit updates the description and the example to use the new APIs.

Looks good to me! Thanks @peterjuras

Cool, thanks for updating. As a reference, this is change is needed to reflect API changes in https://github.com/facebook/react-native/pull/10221

authors: cmcewen ericvicenti peterjuras


text:
Fix Metro preset version

This pull request removes the hard-coded version of the metro-react-native-babel-preset as defined in the init command. That way, the version always matches React Native version specified in its package.json, making it match Metro version.
CC: @kelset

This PR has been already merged to 0.57-stable branch and confirmed to work as a part of upcoming 0.57 release.

@facebook-github-bot shipit

Unrelated: not sure why tests are breaking, but... this change is not covered on the CI anyway.

@grabbou the failure, for Android at least is being tracked here: https://github.com/facebook/react-native/issues/20994 - unrelated as you say :)
buck fetch ReactAndroid/src/test/java/com/facebook/react/modules
2018-09-06 00:08:43,732 [WARNING][buck_tool.py:450] Not using buckd because watchman isn't installed.
Picked up _JAVA_OPTIONS: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap
PARSING BUCK FILES... 0.3s (100%)
No build file at ReactAndroid/src/main/java/com/facebook/thecount/BUCK when resolving target //ReactAndroid/src/main/java/com/facebook/thecount:thecount.

I don't know why this wasn't auto-closed by the bot, but it looks like this PR was imported successfully. It landed as 5d55f0368ee696fcd6c1b0d03e3948297215cc8b#diff-60688af6193e3175ccaf90a942922db5.

authors: Salakar grabbou hramos


text:
Added logging to push registration failure.

It seems it's a common problem people trying to register for push notifications in their simulator, and not understanding why the "register" event never works.
I've wasted a few hours myself on this issue.
This commit simply logs any failures with push registration, preventing confusion.

By analyzing the blame information on this pull request, we identified @nicklockwood and @slycoder to be potential reviewers.

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

cc @javache

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@facebook-github-bot shipit

Thanks for importing. If you are an FB employee go to Phabricator to review.


text:
use ColorPropType everywhere there is a color prop on TextInput

If using colors that are not strings react native would warn you of the problem. I made some changes so color props use ColorPropType instead of PropTypes.string.

By analyzing the blame information on this pull request, we identified @Bhullnatik and @dmmiller to be potential reviewers.

LGTM, let's wait for the CircleCI tests

@ide how long does it usually take?

@facebook-github-bot shipit

Thanks for importing. If you are an FB employee go to Phabricator to review.


text:
Issue #6936 resolved

This pull request is regarding issue
The change is made in file /node_modules/react-native/Libraries/Components/TextInput/TextInput.js
The change made is in method - componentDidUpdate
//if the typeof new value is not string then update the nativeProps.text
if (this._lastNativeText !== this.props.value && typeof this.props.value !== 'string') {
//if current value is equals to null then pass empty string so that it will replace ghost value otherwise pass new value
nativeProps.text = (this.props.value === null ? '' : this.props.value);
}

By analyzing the blame information on this pull request, we identified @JoelMarcey and @janicduplessis to be potential reviewers.

@RD1991 updated the pull request - view changes

@RD1991 updated the pull request - view changes

@RD1991 updated the pull request - view changes

Thanks for the PR! Looks like the bug is iOS-only? Will this pull request affect the Android TextInput?

Does this achieve the same purpose as https://github.com/facebook/react-native/pull/9553, which was recently merged?

@javache No, when user has already entered some text in text input and he/she tries to set it with 'null' , some ghost characters still found in that text input.
So this pull request sets the text input with actual blank string, ignoring or deleting those ghost characters.

@mkonicek This wont be affecting to android at all.
As the previous line of code was ,
nativeProps.text = this.props.value;
and the new line of code is ,
nativeProps.text = (this.props.value === null ? '' : this.props.value);
So I'm just proposing to check if current value is null, return blank string i.e '' ow current value itself

@RD1991 Check the comment by @andreicoman11 (thanks for the review!)

this wont be affecting to android at all

The code will run on Android so it should be tested on Android too.

So I'm just proposing to check if current value is null, return blank string i.e '' ow current value itself

There's also one more change from === to !==.

@mkonicek is there anyone who can test it for android ? I don't have the setup to test.

Seems like iOS bug only , #8973

Looks like this PR still needs some tests before it can be accepted.

It looks like this pull request has been abandoned. I'm going to close it but if you are still interested in working on this please feel free to reopen!


text:
"Solved": Error installing "nevergrad" in python: py_install("nevergrad", pip = FALSE)

Project Robyn
Describe issue
I was having trouble executing the following line of code:
py_install("nevergrad", pip = FALSE)
Provide reproducible example
ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly
WARNING: You are using pip version 20.2.3; however, version 22.2.2 is available.
You should consider upgrading via the '/Users/alfonso/.virtualenvs/r-reticulate/bin/python -m pip install --upgrade pip' command.
Error: Error installing package(s): "'nevergrad'"

Environment & Robyn version
Make sure you're using the latest Robyn version before you post an issue.

Check and share Robyn version: packageVersion("Robyn")
R version (Please, check and share: sessionInfo() or R.version$version.string)

packageVersion("Robyn")
[1] ‘3.7.2’
sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.4

SOLUTION:
@laresbernardo helped me to fix it as follows:
By uninstalling Python from the package and executing the following line of code:
system("pip3 install --upgrade pip")
Then the problem could be solved.

Thanks a lot for sharing this error + solution @alfonsovc15
Could you please copy/paste the whole error so users can find this thread more easily when they get the same error?

repo: facebookexperimental/Robyn


text:
tbv2: name array member types correctly

tbv2: name array member types correctly
Array members are currently being named "TODO" (whoops). Include arrays in
TopoSorter so each one can have a NameProvider generated in CodeGen. Then
pass array elements through make_field.
Test plan:

CI
Add array member names to an array test.

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (08e2faa) 62.39% compared to head (3653dec) 62.42%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #456      +/-   ##
==========================================
+ Coverage   62.39%   62.42%   +0.02%
==========================================
  Files         123      123
  Lines       12008    12012       +4
  Branches     1957     1957
==========================================
+ Hits         7492     7498       +6
+ Misses       3571     3569       -2
  Partials      945      945

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

authors: JakeHillion codecov-commenter


text:
Gracedemo process only restarts once

Gracedemo process only restarts once:

gracedemo
curl 'http://localhost:48567/sleep/?duration=30s'
kill -USR2 $GRACEDEMOPID
observe proper graceful restart; curl 'http://localhost:48567/sleep/?duration=1s' works fine
kill -USR2 $GRACEDEMOPID_NEW
gracedemo process terminates instead of restarting again

Macbook Pro 10.11 El Capitan, Go 1.5.1

Just tried it on 10.11 El Capitan, Go 1.5.1:
naitik ✇ hactar ~ gracedemo
2015/10/11 10:46:00 Serving [::]:48567, [::]:48568, [::]:48569 with pid 53209
2015/10/11 10:46:40 Graceful handoff of [::]:48567, [::]:48568, [::]:48569 with new pid 53273 and old pid 53209
2015/10/11 10:46:49 Graceful handoff of [::]:48567, [::]:48568, [::]:48569 with new pid 53275 and old pid 53273
2015/10/11 10:46:49 Exiting pid 53273.

Are you sure you used the right pids? Sounds like in step 5 you used the original pid instead of the new pid.

For anyone running into this issue and getting confused, you you have build your binary.
For some reason go run gracedemo.go will only restart once, but go build gracedemo.go && ./gracedemo works indefinitely.

authors: daaku matthewmueller nkev

repo: facebookgo/grace


text:
feature/adds custom event parameters [fixes issue #17]

addresses issue #17 (https://github.com/facebookincubator/ConversionsAPI-Tag-for-GoogleTagManager/issues/17). If eventModel includes a property name that matches 'x-fb-cd-custom-property_name', adds custom_data.property_name

resolved conflicts (meta rebrand and cookie-set feature happened since initial PR)... hopefully someone will merge it in now? Do I need to ping someone? @facebook-github-bot ?


text:
How to turn off css compression?

new HtmlWebpackPlugin({
      inject: true,
      template: paths.appHtml,
      minify: {
        removeComments: true,
        collapseWhitespace: true,
        removeRedundantAttributes: true,
        useShortDoctype: true,
        removeEmptyAttributes: true,
        removeStyleLinkTypeAttributes: true,
        keepClosingSlash: true,
        minifyJS: true,
        minifyCSS: true,
        minifyURLs: true
      }
    })

Is the setting here?

No. This is confusing but in Webpack 1, you need to explicitly opt out of compression in the loader definition. It gets turned out implicitly when Uglify plugin is used. This behavior is changed in Webpack 2 but we are not using it yet. See https://github.com/webpack-contrib/sass-loader/issues/299.

authors: erkanunluturk gaearon

repo: facebookincubator/create-react-app


text:
process.env.REACT_APP_*  :: CRA or community convention?

I have over a year experience w/ react but I still prefer to start projects using the CRA script (w/ a TS flavoring). I'm now gaining experience w/ deployment and have learned about the REACT_APP_* environment variables settings. I've hacked my way through changing the environment variable settings to work the way I want like so... (sharing for community knowledge)
const REACT_APP = /^REACT_APP_/i;

function getClientEnvironment(publicUrl) {
  let PM2_ENV = {}
  if(process.env.NODE_ENV==='production'){
    // stuff env config from pm2 //TODO update pm2 and change to env_production
    const os = require('os')
    const PM2_FILE_URL = os.homedir()+'/.pm2/ecosystem.config.js'
    const PM2_CONFIGS = require(PM2_FILE_URL).apps
    PM2_ENV = PM2_CONFIGS.find(a => a.name==='express-server').env
  }
  const raw = Object.keys(process.env)
     .filter(key => REACT_APP.test(key))
    .reduce(
      (env, key) => {
        env[key] = process.env[key];
        return env;
      },
      {
        // Useful for determining whether we’re running in production mode.
        // Most importantly, it switches React into the correct mode.
        NODE_ENV: process.env.NODE_ENV || 'development',
        // Useful for resolving the correct path to static assets in `public`.
        // For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
        // This should only be used as an escape hatch. Normally you would put
        // images into the `src` and `import` them in code to get their paths.
        PUBLIC_URL: publicUrl,
      }
    );

  raw = {...PM2_ENV, ...raw}

  // Stringify all values so we can feed into Webpack DefinePlugin
  const stringified = {
    'process.env': Object.keys(raw).reduce((env, key) => {
      env[key] = JSON.stringify(raw[key]);
      return env;
    }, {}),
  };

  return { raw, stringified };
}

Now I'm left wondering whether or not to keep the REACT_APP_ process.env filter that comes with the package. Does anyone know the reasoning for it? Is it just a nice convention for newbs or is it a community convention that I should retain for working w/ 3rd party libs?
Thanks!

Please see my reply in https://github.com/facebookincubator/create-react-app/issues/2865#issuecomment-325703406.
The convention is explicit to make it obvious what will be public. Any variable you use in client-side code will actually be shipped as part of your JS bundle.
You don’t want a rogue npm dependency to log your process.env.DB_CREDENTIALS or something like this. This is why we only provide what has been explicitly marked for use within the client-side app.

Thank you for your reply @gaearon . I'm going to follow your advice and prepend the env variables in my PM2 file with REACT_APP_* as well.
Incase the community wants it, the change to the above code would be
  if(process.env.NODE_ENV==='production'){
    // this stays the same
  }

process.env = {...process.env, ...PM2_ENV}

// and the line below is deleted
- raw = {...PM2_ENV, ...raw}

authors: Falieson gaearon


text:
Handle scoped forks in install & e2e tests

Should fix #1414

Let’s go with https://github.com/facebookincubator/create-react-app/pull/1706 instead.

authors: EnoahNetzach gaearon


text:
ModuleNotFoundError: No module named 'soundfile'

The Application will not start. I received this output:
C:\Users{ }\MusicGen\audiocraft>python app.py
Traceback (most recent call last):
File "C:\Users{ }\MusicGen\audiocraft\app.py", line 12, in
from audiocraft.models import MusicGen
File "C:\Users{ }\MusicGen\audiocraft\audiocraft_init_.py", line 8, in
from . import data, modules, models
File "C:\Users{ }\MusicGen\audiocraft\audiocraft\data_init_.py", line 8, in
from . import audio, audio_dataset
File "C:\Users{ }\MusicGen\audiocraft\audiocraft\data\audio.py", line 18, in
import soundfile
ModuleNotFoundError: No module named 'soundfile'
Same Error running the application in a virtual environment and the host environment.

looks like installation error
i would directly install into drive not into c users
i have a step by step workflow here : https://youtu.be/v-YpvPkhdO4

The error message you received indicates that the module 'soundfile' is not installed in your Python environment. The 'soundfile' module is likely a dependency of your application, and it needs to be installed for your application to work properly.
To resolve this issue, you can follow these steps:

Make sure you have the correct version of Python installed. Check that the version of Python you are using matches the requirements of your application.

Activate your virtual environment if you are using one. Run the appropriate command based on your operating system to activate the virtual environment. For example, on Windows, you can use the command:
venv\Scripts\activate

Install the 'soundfile' module in your Python environment. Open a command prompt or terminal, and use the following command:
pip install soundfile

This command will download and install the 'soundfile' module from the Python Package Index (PyPI).

After the installation is complete, try running your application again:
python app.py

The 'soundfile' module should now be found, and your application should start without the previous error.

If you're still encountering issues, ensure that all the necessary dependencies for your application are installed correctly. You may need to check the documentation or requirements file for your application to determine the complete list of dependencies and install them accordingly.

You might have installed https://pypi.org/project/musicgen/ which is completely unrelated except by name. Sounds like a separate problem, did you run pip install audiocraft?

I too am having this issue, I've also installed and uninstalled soundfile multiple times to no avail. It's really got me puzzled. Since i can clearly see the module in the site-packages folder, but it still doesn't detect that it's there.
Also when I reinstalled audiocraft and ran pip install -e .  it shows this:
Requirement already satisfied: soundfile>=0.10.2 in c:\users\daydr\miniconda3\lib\site-packages (from librosa->audiocraft==0.0.2a1) (0.12.1)
I'm at a loss. ¯|-(ツ)-|¯

cool... update can  solve  the issue

cool... update can solve the issue
you mean update soundfile module, right?

i first install this module in conda environment , it does not work.
but when i use commend pip install soundfile. it is successful and the code could run

authors: ChrisLau23 Daydricoldsmith FurkanGozukara chris911024 mettetsystems rsxdalv

repo: facebookresearch/audiocraft


text:
[Question] Results on tanks and temples

Hello! Thank you for the great work!
Could you please share a table with the results on tanks and temples? I mean for each of the 9 scenes.

Hi, here are the per-scene metrics:

Method
Scene
PSNR
SSIM
LPIPS

Nerfacto
M60
23.51
0.755
0.349

Panther
25.88
0.796
0.344

Train
15.95
0.598
0.406

Auditorium
20.91
0.791
0.388

Ballroom
11.21
0.315
0.897

Courtroom
17.63
0.592
0.498

Museum
17.03
0.627
0.387

Caterpillar
17.31
0.521
0.512

Church
18.51
0.653
0.410

Mip-NeRF360
M60
26.08
0.823
0.287

Panther
27.13
0.839
0.282

Train
21.02
0.660
0.379

Auditorium
29.93
0.858
0.338

Ballroom
14.02
0.372
0.803

Courtroom
23.63
0.694
0.436

Museum
24.55
0.704
0.340

Caterpillar
22.42
0.598
0.446

Church
24.65
0.740
0.339

NeRF++
M60
19.91
0.621
0.622

Panther
20.87
0.633
0.633

Train
19.03
0.537
0.608

Auditorium
24.96
0.765
0.582

Ballroom
15.33
0.371
0.883

Courtroom
20.97
0.579
0.680

Museum
20.52
0.523
0.682

Caterpillar
20.12
0.437
0.706

Church
20.53
0.530
0.741

Mega-NeRF
M60
17.77
0.613
0.522

Panther
18.16
0.614
0.515

Train
16.03
0.465
0.749

Auditorium
23.54
0.767
0.435

Ballroom
15.40
0.349
0.871

Courtroom
20.52
0.592
0.602

Museum
18.31
0.490
0.738

Caterpillar
18.50
0.430
0.626

Church
19.25
0.538
0.536

LocalRF (COLMAP)
M60
21.88
0.688
0.541

Panther
23.20
0.708
0.526

Train
21.89
0.663
0.395

Auditorium
27.27
0.819
0.445

Ballroom
18.79
0.529
0.566

Courtroom
23.01
0.672
0.468

Museum
22.88
0.621
0.508

Caterpillar
21.87
0.553
0.543

Church
23.69
0.671
0.471

SCNeRF (COLMAP init)
M60
14.78
0.545
0.652

Panther
16.10
0.556
0.652

Train
15.73
0.473
0.648

Auditorium
21.43
0.728
0.588

Ballroom
11.30
0.304
0.928

Courtroom
19.43
0.551
0.700

Museum
17.87
0.469
0.695

Caterpillar
16.51
0.374
0.753

Church
17.87
0.487
0.752

BARF (COLMAP init)
M60
8.05
0.431
0.858

Panther
9.38
0.451
0.852

Train
9.01
0.356
0.852

Auditorium
13.01
0.580
0.813

Ballroom
9.49
0.255
0.931

Courtroom
9.46
0.354
0.925

Museum
10.79
0.353
0.936

Caterpillar
8.55
0.255
0.945

Church
10.68
0.376
0.925

LocalRF (COLMAP init)
M60
22.93
0.709
0.504

Panther
24.22
0.727
0.497

Train
22.89
0.703
0.349

Auditorium
27.42
0.818
0.447

Ballroom
19.97
0.567
0.499

Courtroom
23.27
0.675
0.454

Museum
22.34
0.605
0.532

Caterpillar
21.98
0.559
0.528

Church
24.03
0.678
0.461

BARF
M60
10.74
0.498
0.835

Panther
11.69
0.507
0.845

Train
11.46
0.405
0.817

Auditorium
15.79
0.645
0.811

Ballroom
10.44
0.271
0.945

Courtroom
12.49
0.420
0.896

Museum
12.17
0.383
0.935

Caterpillar
11.01
0.289
0.944

Church
12.15
0.404
0.930

LocalRF
M60
18.66
0.624
0.638

Panther
20.65
0.649
0.634

Train
20.03
0.580
0.540

Auditorium
24.97
0.770
0.588

Ballroom
18.98
0.490
0.622

Courtroom
21.03
0.597
0.616

Museum
19.86
0.519
0.710

Caterpillar
20.36
0.475
0.647

Church
21.90
0.593
0.618

Yes, we use FOV=71.
How are you averaging metrics? We average PSNR in the square error domain and SSIM in sqrt(1-SSIM).

Actually I used just a simple averaging for every subsection of your table (I mean for Nerfacto, LocalRF (COLMAP), LocalRF (COLMAP init), ...) What do you mean by "average in domain"? Is this from paper [5]? Could you please share the formula of the averaging? Are mentioned results from the paper obtained from this table?

Hello! I think you can refer to render.py and train.py, which roughly means averaging the mse error values of all images, and then converting this average into a psnr value.

Hi

Hello! I think you can refer to render.py and train.py, which roughly means averaging the mse error values of all images, and then converting this average into a psnr value.

Yes, we average square error values before converting to PSNR as in render.py: $\text{MSE} = \frac1n\displaystyle\sum_{i=1}^{n} \text{MSE}_i$ and $\overline{\text{PSNR}} = 10  \log_{10}\left(\frac{1}{\text{MSE}} \right) $.
For SSIM, we convert to the $\sqrt{(1-\text{SSIM})}$ domain for averaging, before converting back to SSIM: $\overline{\text{SSIM}} = 1- \left(\frac1n\displaystyle\sum_{i=1}^{n} \sqrt{(1-\text{SSIM}_i)}\right)^2$. This is not currently implemented in render.py.

Thanks for your reply!

Hi

Hello! I think you can refer to render.py and train.py, which roughly means averaging the mse error values of all images, and then converting this average into a psnr value.

Yes, we average square error values before converting to PSNR as in render.py: MSE=1n∑i=1nMSEi and PSNR―=10log10(1MSE).
For SSIM, we convert to the (1−SSIM) domain for averaging, before converting back to SSIM: SSIM―=1−(1n∑i=1n(1−SSIMi))2. This is not currently implemented in render.py.

Thanks for your reply, I would also like to ask you whether the calculation metric is calculated using the saved render image, or is calculated directly without saving it as a image. I think there will be some errors because there is a rounding operation in saving the image.

authors: ameuleman sevashasla tb2-sy

repo: facebookresearch/localrf


text:
Rendering questions

I have rays_o, rays_d based on world coordinates. How can I render those pixels?

Hi, we have rays_o and rays_d in camera coordinates here. You should be able to render from rays in world coordinates by modifying cam2rfs so that it only has the per radiance fields transformation.

authors: EH-HU ameuleman


text:
Does the 'matched_idxs' in balanced_positive_negative_sampler refers to 'labels' in loss.py?

❓ Questions and Help
In balanced_positive_negative_sampler.py:
def __call__(self, matched_idxs):
    """
    Arguments:
        matched idxs: list of tensors containing -1, 0 or positive values.
            Each tensor corresponds to a specific image.
            -1 values are ignored, 0 are considered as negatives and > 0 as
            positives.

while in loss.py:
sampled_pos_inds, sampled_neg_inds = self.fg_bg_sampler(labels)
which may lead to a mis-understanding? Cus in matched_idxs, -1 is negative.
Or am I making a mistake?

In matched_idxs:  -1 values are ignored,  0 are negatives,  >=1 are positives
https://github.com/facebookresearch/maskrcnn-benchmark/blob/24c8c90efdb7cc51381af5ce0205b23567c3cd21/maskrcnn_benchmark/modeling/balanced_positive_negative_sampler.py#L37-L39

https://github.com/facebookresearch/maskrcnn-benchmark/blob/24c8c90efdb7cc51381af5ce0205b23567c3cd21/maskrcnn_benchmark/modeling/rpn/loss.py#L69

https://github.com/facebookresearch/maskrcnn-benchmark/blob/24c8c90efdb7cc51381af5ce0205b23567c3cd21/maskrcnn_benchmark/modeling/rpn/loss.py#L69

authors: Dorozhko-Anton SkeletonOne

repo: facebookresearch/maskrcnn-benchmark


text:
Loading models

❓ Questions and Help
Before asking:

search the issues.
search the docs.

What is your question?
I am trying to load the OPT models in a similar way as the fairseq models, but I seem to hit into quite some snags. Has anyone got a good example on how to load these models?
Code
from metaseq.models.transformer_lm import TransformerLanguageModel
model = TransformerLanguageModel.from_pretrained("./model_location")

What have you tried?
I have already tried various alternatives, but they always get the notification that the model could not get loaded, that it's missing something, etc.
What's your environment?

fairseq Version (e.g., 1.0 or master): master
PyTorch Version (e.g., 1.0): 1.11
OS (e.g., Linux): Linux
How you installed fairseq (pip, source): source
Build command you used (if compiling from source): pip install -e .
Python version: 3.9
CUDA/cuDNN version: N/A
GPU models and configuration: N/A
Any other relevant information: Just wanting to load the weights for conversion.

At HF we got the 350m checkpoint working ;-)
https://github.com/patrickvonplaten/metaseq/blob/main/README.md#7-how-to-run-the-350-model

If that's the case, I can only assume a HF conversion is not far away? We (KoboldAI team) managed to convert fairseq models to XGLM, I can assume that's the same case here. From our experience, XGLM uses the same architecture as fairseq.

@patrickvonplaten how did you makepatrickvonplaten/opt_gpt2_tokenizer? Is it just the default HF GPT2 tokenizer?

@hunterlang, it's a GPT2Tokenizer that was loaded from the tokenizer files in https://github.com/facebookresearch/metaseq/tree/main/projects/OPT/assets
I.e. patrickvonplaten/opt_gpt2_tokenizer just contains those two files and then you can load it with our GPT2Tokenizer implemenation

@hunterlang, it's a GPT2Tokenizer that was loaded from the tokenizer files in https://github.com/facebookresearch/metaseq/tree/main/projects/OPT/assets
I.e. patrickvonplaten/opt_gpt2_tokenizer just contains those two files and then you can load it with our GPT2Tokenizer implemenation

@patrickvonplaten I follow your code and readme, but I encountered Runtime error in Megatron-LM/megatron/initialize.py
at line 180
 # Call the init process
 torch.distributed.init_process_group(
        backend=args.distributed_backend,
        world_size=args.world_size, rank=args.rank,
       timeout=timedelta(days=7))
world_size = 1 rank = 0
environment?
PyTorch Version: 1.10.1
OS : Linux
Build command you used (if compiling from source): pip install -e .
Python version: 3.7.7
CUDA/cuDNN version: 11.0
command line
torchrun run_model.py --pipeline-model-parallel-size 1 --tensor-model-parallel-size 1
How can I load the model and run your code ?  many thanks

Hey @Fengwills,
Yeah we just commented out / removed this line of code in the Megatron repo

@patrickvonplaten
remove this line？ right？
#Call the init process
torch.distributed.init_process_group( backend=args.distributed_backend, world_size=args.world_size, rank=args.rank, timeout=timedelta(days=7))
get a new bug,
AssertionError: Default process group is not initialized
seem to doesn' work for me, am I doing something wrong?

There is no way that getting around the process group init that will work.
I'm going to take a look at getting these models into vanilla, non-MP format but I have many pressing demands.
The sketch of the solution, if someone wants to implement, is to slightly modify the consolidate FSDP script to load flattened parameters and then peak inside the wrapper to get Non-flattened parameters (i.e. model.module.state_dict). The latest OPT readme shows how to use the consolidate script.

Thanks for the hints here @stephenroller !

same problem.

@suchenzang @stephenroller any way that you guys could send us or open-source the param_metadata dicts?
I've tried for quite some time now to reproduce the correct parameter mapping without much success.
It's not really stated on how many GPUs (world_size models other than 175B were trained), nor was I able to reproduce the parameter mapping. Also one thing I don't fully understand is why the two checkpoints

I think maybe some of these checkpoints were saved with use_sharded_state=False which means the checkpoints are pre-consolidated. The rank0 file would then be waaaay larger but rest would be just a few kb. This is the code path that results in shards with out that shard metadata field

Closing this given https://github.com/facebookresearch/metaseq/issues/88, https://github.com/facebookresearch/metaseq/issues/78, and https://github.com/facebookresearch/metaseq/issues/77, which should cover this issue as well.

authors: Fengwills hunterlang mrseeker patrickvonplaten rgzn-aiyun stephenroller suchenzang

repo: facebookresearch/metaseq


text:
ImageNet linear classifier weights?

Hi, would you mind also uploading the weights (or whole checkpoint) for a model with the linear classifier on ImageNet? I'm running main_lincls.py myself currently, but it looks like it will take quite some time to get through the 100ep needed and I guess it can be generally useful to others to have these weights readily downloadable.

Hi, we have not planned to upload the weights of the linear classifiers or fine-tuned detectors, to keep the repo manageable. Those can be trained in a few hours given our provided pre-training weights.

Yes, the code makes learning them easy indeed. However, it looks to be ~75h on 4-GPUs :) Anyways, thanks for your answer!

Yes, the code makes learning them easy indeed. However, it looks to be ~75h on 4-GPUs :) Anyways, thanks for your answer!

Training the linear classifier using the pre-trained weights only takes ~8 to 12 hours in 8 GPUs. I guess in 4 GPUs it won't be much slower as the bottleneck is just data loading.

I switched to an 8xV100 machine and have the data on SSD and increased workers from the default 4 to 16, but given the logs below I don't think data is the bottleneck:

Estimate is still at 33h. Are you sure you get that speed with batch-size 256? I didn't want to increase batch-size compared to the README, as I don't know if it would deteriorate results. But GPUs do look pretty under-utilized

Could you please try --workers 32? We set that as the default in main_moco.py but missed it in main_lincls.py.

Sure, will try that in a second! however given my screenshot above, I don't think data input is bottleneck?

Sure, will try that in a second! however given my screenshot above, I don't think data input is bottleneck?

The interface was inherited from the official PyTorch code, and I think the "Data" time monitor is not precise. Using --workers 32 should help.

While GPU utilization seems higher in nvidia-smi (hitting 100% larger fraction of the time), the logs as well as my timing estimates remain the same as they were --workers 16: it fluctuates between 20-30min per epoch, which would be 33h in the optimistic case. I read through the code but didn't see an obvious reason for this. I also tried both DataParallel variant and distributed variant, but they get about the same ballpark speed too. I would need 5min/ep to hit 8h total.

While GPU utilization seems higher in nvidia-smi (hitting 100% larger fraction of the time), the logs as well as my timing estimates remain the same as they were --workers 16: it fluctuates between 20-30min per epoch, which would be 33h in the optimistic case. I read through the code but didn't see an obvious reason for this. I also tried both DataParallel variant and distributed variant, but they get about the same ballpark speed too. I would need 5min/ep to hit 8h total.

The timer is an average of all iterations in one epoch, and the overhead of the first few iterations would dominate the average time. Perhaps you may estimate the time after running one epoch.
This code is just the official PyTorch ImageNet code. Full end-to-end training for 100 epochs on ImageNet should take <20 hours in 8 GPUs, and I believe there are plenty of benchmarking of this kind available on Internet. Training the linear classifier should be faster as it does not backprop thorough the weights (except for the fc).

I just ran the exact command in https://github.com/facebookresearch/moco/#linear-classification and -j 32 with 8 V100s and the first epoch finished in around 6 minutes.
If you're unable to get this speed it's likely an issue of your environment.

The timing estimate is me manually looking at steps and a wall-clock, it is pretty reliable :)
In this case, I must be doing something wrong in the machine setup and will have to figure that out myself. Thanks a lot for all your information and attempts to help!

Indeed getting the same timings with the PyTorch ImageNet example, so the speed is not an issue with this repo, and I apologize for the distraction!

Final update just to confirm that indeed it was a problem with my setup, related to data i/o as Kaiming suspected.

Hello, thanks for this discussion.
@lucasb-eyer  can you please tell me what the bottleneck was specifically? With a fresh conda environment and data on an SSD, I get similar timings with 4 V100s.

Sure. I was using cloud, and had the data on a SSD disk in the same datacenter as my VM. But apparently, that's still slower than using the VM's boot-disk. So after copying the data onto the boot-disk's SSD, everything was as fast as it should be. As Kaiming pointed out, the reported timings did not reflect that reality.

Thanks! In my case, I have the data on the SSD of my local server. I guess I need to do profiling to see what the bottleneck is. Cheers!

I was using cloud too but I put the data on the boot SSD disk of the VM instance. Still see the slow training. @lucasb-eyer could you share your epoch speeds?

Just like @ppwwyyxx mentioned above in the thread: roughly 6min per epoch.

authors: KaimingHe aravindsrinivas lucasb-eyer mbsariyildiz ppwwyyxx

repo: facebookresearch/moco


text:
How to plot the same histogram as visualDL in visdom?

How to plot histogram just like the histogram in https://github.com/PaddlePaddle/VisualDL

Closing as it's been two weeks of no response and we're not planning to integrate this feature unless VisualDL wants to help support it

authors: JackUrb KeyKy

repo: facebookresearch/visdom


text:
babel-core/register

I'm trying to use this babel-plugin with babel-core/register.
entry.js
require('babel-polyfill');
require('babel-core/register')({
  plugins: ["universal-import"],
});
require('./server/server.js');

.babelrc
{
  "presets": [
    "es2015", "react", "stage-0"
  ],
  "plugins": [
    "transform-async-to-generator",
    "universal-import"
  ]
}

client side routes
import React from 'react';
import { Switch, Route } from 'react-router-dom';
import universal from 'react-universal-component';

const Routes = () => (
  <Switch>
    <Route path="/page" component={universal(import('./Page'))} />
  </Switch>
);

export default Routes;

error log
$ node ./src/entry.js

/Users/erickim/Develop/front/react/test-project/src/client/index.js:39
          return Promise.all([import( /* webpackChunkName: 'Page' */'./Page'), (0, _importCss3.default)('Page')]).then(function (proms) {
                              ^^^^^^
SyntaxError: Unexpected token import
    at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)
    at loader (/Users/erickim/Develop/front/react/test-project/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/erickim/Develop/front/react/test-project/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
error Command failed with exit code 1.

No error if I'm running a webpack build, though. So I guess this might be a  problem with babel-core/register? 🤔🤔

It's primarily for webpack, but try these 2 plugins in addition:
https://github.com/airbnb/babel-plugin-dynamic-import-node
https://github.com/airbnb/babel-plugin-dynamic-import-webpack
Without webpack, babel can't deal with import without a separate plugin.
Check these docs: https://github.com/faceyspacey/webpack-flush-chunks/blob/master/docs/babel-config.md
If you can't get it working, feel free to hit me on Reactlandia Chat. The challenge with this approach is that it's the "frameworkless approach." So we get to do a lot of the stuff you can do with Next.js, but with fare more flexibility. The challenge is all the initial setup we gotta do. But once we get it, it's smooth sailing.

@faceyspacey thanks, babel-plugin-dynamic-import-webpack works.

@faceyspacey Hi, I've tried both babel-plugin-dynamic-import-webpack and babel-plugin-dynamic-import-node, there are no Unexpected token import error, but server-side render renderToString() will always produce a Loading... state dom(Loading...)

are you using https://github.com/faceyspacey/webpack-flush-chunks? ...this is a common setback. have u read all the docs?

Yes I am using webpack-flush-chunks as setback. Everything works just fine in a production mode(client and server are all compiled by webpack). But when in development mode(client-side compiled by webpack-dev-server and server-side is not built but using babel-core/register), there are strange things happening. 👇
import React from 'react';
import { StaticRouter } from 'react-router-dom';
import { renderToString } from 'react-dom/server';
import { flushChunkNames } from 'react-universal-component/server';
import webpackFlushChunks from 'webpack-flush-chunks';
import Routes from '../../../client/routes';

const renderMiddleware = async (ctx, next) => {
  const content = renderToString(
    <StaticRouter
      location={ctx.path}
      context={ctx}
    >
      <Routes />
    </StaticRouter>
  );
  console.log(content);
  //
Loading...

  // In production mode server-side render was fine. In development mode(using babel-core/register with dynamic-import-webpack, this 'Loading...' will be rendered.

  const chunkNames = flushChunkNames();
  console.log(chunkNames);
  // [ 'default' ]

  const { js } = webpackFlushChunks(ctx.state.webpackStats.toJson(), { chunkNames });
  // FLUSH CHUNKS]: Unable to find default in Webpack chunks. Please check usage of Babel plugin.
  // THIS IS WEIRD: If no 'default' webpack chunks are found, then why scripts exist?
  console.log(js.toString());
  //
  //

  ctx.body = `
    <!doctype html>

        <title>koa-react-universal</title>

${content}

        ${js}

  `;

  await next();
};

export default renderMiddleware;

I'm gonna need a repro.
Have you checked the docs folder in webpack flush chunks. Just last night I added a link to the old boilerplate repos that supported babel. They may help. you u will see the old strategy that didn't involve a plugin. Doing that might solve things.
If you can provide me a repro I'd be happy to check it for you and make any necesssary fixes. I havent spent as much time with a babel server as I have in the past. You may even be able to make a pr to the old babel boilerplate to replicate your issue. It might be as simple as implementing the new babel plugin and removing the manual way from the past.

@faceyspacey Hi, this is the repro: https://github.com/kimjuny/koa-react-universal.
prod logs
➜  koa-react-universal git:(master) ✗ yarn prod
yarn prod v0.24.4
$ npm run clean && cross-env NODE_ENV=production node ./src/production

> @ clean /Users/erickim/Develop/github/koa-react-universal
> rm -rf build

[SYS] webpack building.
[SYS] webpack build finished.
[SYS] server started at port 3008

Home

[ 'containers/Home' ]

dev logs
➜  koa-react-universal git:(master) ✗ yarn dev
yarn dev v0.24.4
$ cross-env NODE_ENV=development node ./src/development
[SYS] server started at port 3008
(node:39093) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: require.ensure is not a function
(node:39093) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[SYS] webpack build finished
webpack built 85bd4c01ed204c5ec3d4 in 9687ms

Loading...

[ 'default' ]
[FLUSH CHUNKS]: Unable to find default in Webpack chunks. Please check usage of Babel plugin.

Ok, i reviewed it and spent some time twiddling with it. Here's what works. do this at the top of server/development.js instead:
require('babel-register')({
  "presets": [
    "es2015",
    "react",
    "stage-0"
  ],
  "plugins": [
    "transform-async-to-generator",
    "universal-import",
    "syntax-dynamic-import"
  ]
});

Notice I added the presets too. I think only if you provide no options does it use your babelrc.
Also note, babel-core/register works just as fine. babel-register is just the newer way to do things.
so you need to add babel-plugin-syntax-dynamic-import. the order doesn't matter. This babel plugin just makes sure the compiler doesn't break when it encounters import(), whereas the other 2 actually overwrite import() to be require.ensure or require(). And since this will happen before my plugin (again, regardless of the order, for whatever reason), my plugin won't be able to operate.
So syntax-dynamic-import leaves import() in tack, but if it's called server-side, it wont be replaced with anything that can work in node. That's fine--as react-universal-component will call one of the other generated options: resolve or path. And it will do so synchronously. It only calls load()which containsimport()` on the client. And only when the module cant be required synchronously.

if you run into any problems. delete your node_modules folder and reinstall it. it should be fine then.

the doc has also been updated for babel-config. thanks for drawing my attention to it:
https://github.com/faceyspacey/webpack-flush-chunks/blob/master/docs/babel-config.md

@faceyspacey ok... after days of struggling...
renderToString is always Loading... when using babel server
This is what I was doing(wrong):
universal(() => import('./Test'))

This is right:
universal(() => import(/* webpackChunkName: 'Test' */ './Test'), {
  path: require('path').resolve(__dirname, './Test'),
  resolve: () => require.resolveWeak('./Test'),
  chunkName: 'Test',
})

Or if u're using universal-import, you can do this:
universal(import('./Test'), {
  path: require('path').resolve(__dirname, './Test'),
  resolve: () => require.resolveWeak('./Test'),
  chunkName: 'Test',
})

[FLUSH CHUNKS]: Unable to find xxx in Webpack chunks. Please check usage of Babel plugin.
The key point is: 1. use babel-plugin-dynamic-import-webpack for the server-side 2. exclude babel-plugin-dynamic-import-webpack from client-side!
So this is what I do.
For the server entry:
require('babel-polyfill');
require('babel-core/register')({
  plugins: [
    'dynamic-import-webpack', // use this only in the server entry
    [
      'inline-replace-variables', {
        '__ROOT__': require('path').resolve(__dirname, '../'),
      },
    ],
  ],
});
require('./server/server.js').default();

And my .babelrc
{
  "presets": [
    "es2015",
    "react",
    "stage-0"
  ],
  "plugins": [
    "universal-import",
    "transform-async-to-generator"
  ]
}

I hope this helps if someone encounter same problem.

um, did u see what i wrote above and the PR i just did to ur repo.

but overall your approach is correct. client side you can't apply the stuff that strips import() since import() is exclusively used on the client.
On the server, it doesnt really matter what u do as long as babel compiles, since import() will never be used. The synchronous require version is used instead.

@faceyspacey I had checked out your PR just now! After yarn and yarn dev I saw an error and couldn't start up:
➜  koa-react-universal git:(master) ✗ yarn dev
yarn dev v0.24.4
$ cross-env NODE_ENV=development node ./src/development
/Users/erickim/Develop/github/fork/koa-react-universal/src/client/routes/index.jsx:43
      return Promise.all([import( /* webpackChunkName: 'containers/Home' */'../containers/Home'), (0, _importCss3.default)('containers/Home')]).then(function (proms) {
                          ^^^^^^
SyntaxError: Unexpected token import
    at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)
    at loader (/Users/erickim/Develop/github/fork/koa-react-universal/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .jsx] (/Users/erickim/Develop/github/fork/koa-react-universal/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
error Command failed with exit code 1.

It could start-up again if I remove "universal-import" from babel-core/register, but the problem remains(renderToString is always Loading... && [FLUSH CHUNKS]: Unable to find xxx in Webpack chunks. Please check usage of Babel plugin)

did u kill ur node_modules folder.

make sure not to merge it too. try what i PRed fresh. it uses the raw universal(import()) like u originally had. i.e. without the options.

@faceyspacey Yes I just checked out from your repo https://github.com/faceyspacey/koa-react-universal, there are no node_modules.
➜  koa-react-universal git:(master) ✗ rm -rf build
➜  koa-react-universal git:(master) ✗ rm -rf node_modules
➜  koa-react-universal git:(master) ✗ yarn
yarn install v0.24.4
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
✨  Done in 11.00s.
➜  koa-react-universal git:(master) yarn dev
yarn dev v0.24.4
$ cross-env NODE_ENV=development node ./src/development
/Users/erickim/Develop/github/fork/koa-react-universal/src/client/routes/index.jsx:43
      return Promise.all([import( /* webpackChunkName: 'containers/Home' */'../containers/Home'), (0, _importCss3.default)('containers/Home')]).then(function (proms) {
                          ^^^^^^
SyntaxError: Unexpected token import
    at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)
    at loader (/Users/erickim/Develop/github/fork/koa-react-universal/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .jsx] (/Users/erickim/Develop/github/fork/koa-react-universal/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
error Command failed with exit code 1.

u gotta do yarn first to install it.

thats very weird. that it worked for me and not you.
fyi, the only reason it's working server-side with the babel plugin is cuz ur providing ur own options. the babel plugin is completely destroyed by the -node or -webpack dynamic-import plugins.

in the future FYI we may completely stop supporting the babel option. U may really wanna rethink going the webpack server route now too. There's a lot to gain and it seems most people have switched.

either way, i know what needs to be done. im glad u got it working. ur solution is a fine solution. its what we did before the plugin. lets consider this completely closed unless u need something else.

@faceyspacey Yes I'm rethinking this route. I was trying to use babel-node+nodemon or node+chokidar for development because there was no koa-middleware like webpack-hot-server-middleware. Although problems are solved temporarily(still trying to figure out way to simplify universal import with options), I can't guarentee there won't be any other weird problems (so I can keep bothering you 😂), so now I'm considering making one(hot server middleware for koa), it shouldn't be too difficult.

def do it! ...im interested into looking more into Koa myself.
Also, ive just started reworking the babel plugin for a babel server. It should be up soon so it wont be causing these problems.

I updated the plugin to have a babelServer: true option, which should only be used on the server. Here's the docs:
https://github.com/faceyspacey/webpack-flush-chunks/blob/master/docs/babel-config.md
Thanks for drawing my attention to this. Let me know if you ever make that koa middleware--it will be very useful. I need to research if it's worth moving these demos to Koa. Feel free to let me know anything else you like about Koa.

@faceyspacey I have made some progress.

koa-webpack-server
koa-react-universal

I'll let you know if these are all ready.

Awesome sauce!

Hi, same as @kimjuny https://github.com/faceyspacey/babel-plugin-universal-import/issues/7#issuecomment-322123215 on dev environment: I got the Loading... message and chunkNames return [ 'default' ].
Here is my repo:
https://github.com/hrasoa/react-pwa/tree/universal-comp

@hrasoa If you are using babel-core/register or babel-server, you can try this solution.

@kimjuny  yes I saw your solution, should babel-plugin-dynamic-import-node replace the import() stuff with synchronous require on the server side ?

For the js error i rolled back babel-plugin-dynamic-import-node to fixed 1.0.2
@kimjuny as u suggested I changed this and it works now:
export default universal(import('./About'));

to
export default universal(import('./About'), {
  path: require('path').resolve(__dirname, './About'),
  resolve: () => require.resolveWeak('./About'),
  chunkName: 'About'
});

authors: faceyspacey hrasoa kimjuny


text:
🛑 Marandu is down

In d8afdb2, Marandu (https://marandu.com.ar) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Marandu is back up in 819e376.


text:
can not creat new user

server log:
INFO[2021-06-29T13:59:30+08:00] configuration values
INFO[2021-06-29T13:59:30+08:00] version      : 0.5.0-c78c8d1
INFO[2021-06-29T13:59:30+08:00] dataDir      : /root/.fairOS/dfs
INFO[2021-06-29T13:59:30+08:00] beeHost      : 127.0.0.1
INFO[2021-06-29T13:59:30+08:00] beePort      : 1633
INFO[2021-06-29T13:59:30+08:00] verbosity    : 5
INFO[2021-06-29T13:59:30+08:00] httpPort     : 9090
INFO[2021-06-29T13:59:30+08:00] pprofPort    : 9091
INFO[2021-06-29T13:59:30+08:00] cookieDomain : api.fairos.io
INFO[2021-06-29T13:59:30+08:00] corsOrigins  : []
INFO[2021-06-29T13:59:30+08:00] fairOS-dfs API server listening on port: 9090
INFO[2021-06-29T13:59:30+08:00] fairOS-dfs pprof listening on port: 9091
ERRO[2021-06-29T14:00:07+08:00] user login: no feed updates found
INFO[2021-06-29T14:00:07+08:00] api access                                    duration=0.103209544 ip=127.0.0.1 method=POST proto=HTTP/1.1 size=60 status=500 uri=/v0/user/login user-agent=Go-http-client/1.1
ERRO[2021-06-29T14:00:16+08:00] user signup: error uploading data
INFO[2021-06-29T14:00:16+08:00] api access                                    duration=0.032003651 ip=127.0.0.1 method=POST proto=HTTP/1.1 size=60 status=500 uri=/v0/user/signup user-agent=Go-http-client/1.1
create user:  user signup: error uploading data
successfully connect to swarm testnet .

What the bee version?

Reproduced with
dfs: 0.5.3-5dbb5fe-dirty
and
bee: 1.0

Not reproducible in latest version

authors: IgorShadurin asabya flybobdog

repo: fairDataSociety/fairOS-dfs


text:
Read the Docs building from master and not latest stable

Falcon Read The Docs default version builds from the master branch of the repo.  This means that the defaults docs on RTD and the latest version of falcon available from pypi do no match.  My suggestion is to create a "release" branch that is kept at the same commit as the latest release, and use this for our default RTD build branch.

How would one do that? I can take a look

A normal collaborator won't be able too, it will have to be Kurt or someone else with access to RTD.

Hmm, something funny is going on. When I browse to https://falcon.readthedocs.org I am redirected to stable (https://falcon.readthedocs.org/en/stable/). At first glance it looks like the correct docs for 0.3, which is the latest tagged version in GH. If I then go to latest (https://falcon.readthedocs.org/en/latest/), I see what looks like the docs from master.
Sounds like you are seeing something different? Or am I missing some subtle difference in the docs?

P.S. Right now there are two people with access to RTD (in case I get hit by a bus, heh). I'd love to expand the group of core maintainers/reviewers if others would like to take a more active role.

This looks OK since the 1.0.0 release. Please reopen if you are seeing something different. Thanks!

authors: kgriffs lwcolton ueg1990

repo: falconry/falcon


text:
feat(request,response): add dict to slots

adds __dict__ to the __slots__ methods to the Request and Response classes
to make it more extensible via subclassing and adding custom attributes. I have
also added tests to make sure adding custom attributes do not break and raise
an AttributeError.
fixes #785

[Current coverage][cc-pull] is 100%

Merging [#818][cc-pull] into [master][cc-base-branch] will not change coverage

@@             master       #818   diff @@
==========================================
  Files            29         29
  Lines          1775       1775
  Methods           0          0
  Messages          0          0
  Branches        298        298
==========================================
  Hits           1775       1775
  Misses            0          0
  Partials          0          0

Powered by Codecov. Last updated by [4d26f42...9438c56][cc-compare]
[cc-base-branch]: https://codecov.io/gh/falconry/falcon/branch/master?src=pr
[cc-compare]: https://codecov.io/gh/falconry/falcon/compare/4d26f428be7a0eadbc456a0cd4cf79ffeac50d7a...9438c56334a34cb040eb3f8fc6d649c2c33dfff3
[cc-pull]: https://codecov.io/gh/falconry/falcon/pull/818?src=pr

Thanks, this looks good. Just a couple inline suggestions re the tests.

@SkiftCreative just following to see if you've had a chance to review my most recent comments?

[merged with minor edits as #868]

authors: SkiftCreative codecov-io kgriffs


text:
Integrate Falco exporter into Falco pod

Motivation
So right now Falco and Falco-exporter are two different helm charts resulting in two different pods, which are pretty much dependent on each other. I have two issues with that:

The easiest way to setup is using the gRPC socket. Which means both pods need a extra host mount to set up communication. This is not a best practice. It would be better to setup communication through networking. If choosing for that, it makes way more sense from multiple perspectives to have Falco and the exporter in the same networking space. (both containers in the same pod)

We are running AKS and EKS, with the native cni. Which means that each node has a maximum amount of ips to distribute to the pods. When I have to spin up an extra daemonset it costs our developers 1 * #nodes pods to spin up.
-->

Feature
I'm willing to make a pr to integrate Falco exporter into the Falco helm chart. But I get that feeling that you guys want to keep the helm chart as slim as possible, which also makes sense. (I opened a pr for falco-ekscloudwatch before) Hence opening this ticket.
Alternatives
Another idea would perhaps to create two Falco charts:
Falco-slim: the bare minimum included to deploy Falco.
Falco-full: all extensions included
Additional context
Na

Hi @dza89
Thanks for bumping this topic up.
TBH, I would not like a big full-featured chart, for several reasons:

the chart would be more complex to test and maintain
there's a legit use case where Falco is directly installed on the host (so no pod or container); in that case, a separate falco-exporter chart will be still needed
other tools using the gRPC API may be added in the future; thus, we will even need to an extra host mount to set up communication

However, I perfectly understand your points, and I agree we should try to find a way that solves those issues.
Thus, IMHO it worths investigating any valid alternative to the current design (eg. subcharts might help?) and discussing that with the community.
Feel free to propose this discussion in the weekly Falco community call too.

Subcharts won't help as I want to place falco-exporter in the same deployment as Falco.
That's why I also suggested to split it into two charts: falco-full and falco-slim.
But maybe I should just fork it. Close for now.

repo: falcosecurity/charts


text:
False positives in Azure Kubernetes Service

Describe the bug
Spinning up Falco on AKS yields this alert:
{
  "output": "16:43:01.393393906: Notice Namespace change (setns) by unexpected program (user=<NA> command=<NA> parent=<NA> k8s.ns=<NA> k8s.pod=<NA> container=host container_id=host image=<NA>:<NA>) k8s.ns=<NA> k8s.pod=<NA> container=host k8s.ns=<NA> k8s.pod=<NA> container=host",
  "priority": "Notice",
  "rule": "Change thread namespace",
  "time": "2020-05-01T16:43:01.393393906Z",
  "output_fields": {
    "container.id": "host",
    "container.image.repository": null,
    "container.image.tag": null,
    "evt.time": 1588351381393394000,
    "k8s.ns.name": null,
    "k8s.pod.name": null,
    "proc.cmdline": "<NA>",
    "proc.pname": null,
    "user.name": null
  }
}

How to reproduce it
Install Falco 0.21.0 in a AKS 1.16.7 cluster. Check the daemonset logs.
Expected behaviour
To not fire an alert for this behavior.
Environment
Azure AKS, Kubernetes 1.16.7

Falco version:
0.21.0

Installation method:
Helm

Additional context
This is really similar to this issue: https://github.com/falcosecurity/falco/issues/439

@AlexDHoffer can you please update to Falco 0.22.0 and maybe post here the flags you start Falco with? We need to understand why that False positive happens in the first place and the output line is filled with NAs which is a thing we put a lot of effort to solve in 0.22.0 with both Falco and configuration changes.

@fntlnz upgrading to 0.22.0 seemed to help.

I think we can close this, we are on 0.23.0 now and 0.24.0 will contain even more fixes on NAs.
Thanks for your help @AlexDHoffer
/close

@fntlnz: Closing this issue.

In response to this:

I think we can close this, we are on 0.23.0 now and 0.24.0 will contain even more fixes on NAs.
Thanks for your help @AlexDHoffer
/close

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

authors: AlexDHoffer fntlnz poiana

repo: falcosecurity/falco


text:
docs: CHANGELOG for 0.29.1 cleanup

Signed-off-by: Leonardo Di Donato leodidonato@gmail.com
What type of PR is this?
/kind cleanup
/kind documentation
Any specific area of the project related to this PR?
NONE
What this PR does / why we need it:
Fixes some left-overs in the CHANGELOG for Falco 0.29.1
Which issue(s) this PR fixes:
NONE
Special notes for your reviewer:
NONE
Does this PR introduce a user-facing change?:
NONE

[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: leodido
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

OWNERS [leodido]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

I'm going to merge this manually since tide unfortunately is in a stall situation and is not able to merge this PR anymore :(

Why are we merging manually?
Doesn't sound like a good practice. I suggest to fix test-infra

Why are we merging manually?
Doesn't sound like a good practice. I suggest to fix test-infra

Hey @leodido
I totally agree with you. It was an exceptional situation. Let me add more details.
Since this PR and https://github.com/falcosecurity/falco/pull/1658 were in a definitive stall (even we fix the problem on test-infra, @poiana won't be able to merge them anymore), I merged them manually to avoid further spamming the GitHub APIs. Thus, I won't manually merge other PRs that are still mergeable by @poiana.
Btw, I and @maxgio92 are trying to debug this problem and maybe find a solution.

authors: leodido leogr poiana


text:
rule(falco_rules) Removed use cases not triggering macro curl_download

A recently added macro include values which aren't triggering the rule since the chars > and / aren't present in the proc.cmdline field so the rule won't trigger with this values.
Signed-off-by: darryk10 stefano.chierici@sysdig.com
Co-authored-by: Brucedh alessandro.brucato@sysdig.com
Co-authored-by: AlbertoPellitteri alberto.pellitteri@sysdig.com

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

If contributing rules or changes to rules, please make sure to also uncomment one of the following line:

/kind rule-update

/kind rule-create

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area build

/area engine

/area rules

/area tests

/area proposals

What this PR does / why we need it:
The PR removes values in the macro which don't trigger the falco rule since they aren't in the cmdline field.
Which issue(s) this PR fixes:
The PR removes values in the macro which don't trigger the falco rule since they aren't in the cmdline field.

Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:

rule(Launch Ingress Remote File Copy Tools in Container): Removed use cases not triggering the rule

[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: darryk10
To complete the pull request process, please assign mstemm after the PR has been reviewed.
You can assign the PR to them by writing /assign @mstemm in a comment when ready.
The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

rules/OWNERS

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

LGTM label has been added.  Git tree hash: 6c2214b6b5ffdcfb6c63c1d0fa81c5c411b0ffec

[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: darryk10, jasondellaluce
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

rules/OWNERS [jasondellaluce]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

/milestone 0.32.0

authors: darryk10 jasondellaluce poiana