log: add leveled logging

This patch implements a simple leveled logging output to provide the
ability to have DEBUG logs which are not logged by default. The
implementation allows changing the log level at runtime but in this
implementation there is no mechanism to change the value at runtime.

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

Still need to add a test for the LevelWriter


Using React Hooks in React Native

[x] Review the documentation: https://facebook.github.io/react-native
[x] Search for existing issues: https://github.com/facebook/react-native/issues
[x] Use the latest React Native release: https://github.com/facebook/react-native/releases

Environment
[skip envinfo]
OS: Windows 10
Node: 10.11.0
Yarn: Not Found
npm: 6.4.1
Watchman: Not Found
Xcode: N/A
Android Studio: Version  <IP_ADDRESS> AI-181.55<IP_ADDRESS>56338
Packages: (wanted => installed)
react: 16.7.0-alpha.0 => 16.7.0-alpha.0
react-native: https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz => 0.55.4
expo: 2.2.0
Description
When using React Hooks like useState within a function component, I get the following error message.

hooks can only be called inside the body of a function component

export default function RootContainer(props) {
  const [something, setSomething] = useState('nothing');

  return (
    <View />
  );
};

hooks can only be called inside the body of a function component

I noticed that this error also happens when you have two different instances of React being used, to double check that. (https://github.com/facebook/react/issues/13991)
I was not able to make it work on react-native too, but with a different error:
TypeError: dispatcher.useState is not a function

😢😭

We need to update the Renderer alongside React. Please wait for the React sync to land, and we will cut a new official release with 16.6 then.

We’ll do the same once 16.7 stable is released.

It would be much appreciated to have a next version of react-native synced with the next version of 16.7 so we can try hooks right now.
My project is universal (same components between web and mobile) so my hands are tied. Can't use hooks because react-native doesn't support it.

We can just do a sync with enableHooks: false feature flag and then those who want can override it locally.

We’ll do the same once 16.7 stable is released.

@hramos React team ask to the community to try hooks and give feedback about them. IMO we need a way for RN people to be able to provide this feedback too (not only React projects) before anything is stable.

Hooks is quite a change for React / RN syntax. A lot of docs will need updating too?

If you'd like to try out Hooks today, you can do the following after installing React 16.7.0-alpha in your project:

Clone the https://github.com/facebook/react repository.
Navigate to the react directory.
Run yarn install
Run yarn build -- --type=RN_OSS.
After a few seconds, you'll notice a new build/react-native/ directory has been created. Copy the contents of this directory, to your project's node_modules/react-native/Libraries/Renderer directory.

Let us know if the above steps work out for you.

We're planning on landing support for React 16.6.0 in 0.57.5. Hooks is available in the 16.7.0-alpha, and feedback from the community so far has been that upgrading to alphas of React in the stable React Native releases can be disruptive. What do people here think about a React Native 0.57.5-alpha release that includes support for 16.7.0-alpha out of the box?

Thanks @hramos for this info! So this works fine when using useState, but for some reason when I move on to try useEffect I get the following error:
failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': No function was found that matched the signature provided.

Any ideas on what could be causing this or how to mitigate?

Wouldn't it be something like a 0.57.6-alpha if you're already aiming for a stable 0.57.5?
I'm totally fine using a custom build for React Native, as long as it works. Haven't tried it yet but does the error in the above comment make sense? If it helps I can try it as well.

Thanks @hramos for this info! So this works fine when using useState, but for some reason when I move on to try useEffect I get the following error:
failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': No function was found that matched the signature provided.

Any ideas on what could be causing this or how to mitigate?

I was able to use useEffect without any issues. Anything in particular that didn't work with useEffect?

@Manishalexin Just tried it again with a completely new build, still not working for me.
I've tried useEffect in a couple of different ways, still getting errors on all of them (same error as above).
React Native Environment Info:
    System:
      OS: macOS Sierra 10.12.6
      CPU: x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
      Memory: 52.84 MB / 8.00 GB
      Shell: 5.2 - /bin/zsh
    Binaries:
      Node: 8.12.0 - ~/.nvm/versions/node/v8.12.0/bin/node
      Yarn: 1.3.2 - /usr/local/bin/yarn
      npm: 6.4.1 - ~/.nvm/versions/node/v8.12.0/bin/npm
    SDKs:
      iOS SDK:
        Platforms: iOS 11.2, macOS 10.13, tvOS 11.2, watchOS 4.2
      Android SDK:
        Build Tools: 23.0.1, 26.0.1, 26.0.2, 26.0.3, 27.0.3
        API Levels: 23, 26, 27
    IDEs:
      Android Studio: 3.0 AI-171.4443003
      Xcode: 9.2/9C40b - /usr/bin/xcodebuild
    npmPackages:
      react: ^16.7.0-alpha.0 => 16.7.0-alpha.0
      react-native: 0.57.4 => 0.57.4
    npmGlobalPackages:
      react-native-cli: 2.0.1

@dabit3 I have the exact same config for npm modules but system-wise I am Mojave and Xcode 12( Shouldn't matter, I presume). And moreover, the error seems service worker related. ( which is weird in vanilla RN project )
I'll quickly try with a fresh project and report back. ( I tried it with an existing project )

@Manishalexin did you see my comment about the remote debugger?

@dabit3 Just saw. ( Comment doesn't update till page refresh ).

@hramos Regarding your question of using react alpha in react-native: I am usually freakishly strict about using unstable versions of packages in my projects, but having played with 16.7 alpha this weekend I didn't notice any bugs.
Perhaps an alpha release of react-native including hooks could be a good idea? I assume if hooks go past RFC stage and get implemented, react-native will need a lot of pre-testing and this seems like a feature that people would actually love to start using and testing as early as now?

An alpha release of react-native would be awesome! I am working on a new app that isn't published yet, and would love to use the new hooks API.

We're planning on landing support for React 16.6.0 in 0.57.5. Hooks is available in the 16.7.0-alpha, and feedback from the community so far has been that upgrading to alphas of React in the stable React Native releases can be disruptive. What do people here think about a React Native 0.57.5-alpha release that includes support for 16.7.0-alpha out of the box?

I think letting people opt in to the React 16.7.0-alpha by way of an alpha release of RN is a great idea.
I've certainly struggled in the past with seeing alpha or even beta releases of React being included as part of a stable React Native release and would find it hard to justify in a more corporate environment.  However, for those people who are more adventurous, allowing access to it as an alpha release gives people the best of both worlds.

We've been discussing with other core contributors how to best approach this, and we're currently leaning towards focusing on landing support for React 16.6.0 stable on React Native 0.57.5 first. We're expecting 0.57.5 to be released sometime this week.
Once that happens, people who would like to experiment with React Hooks may opt to install the React 16.7.0.alpha on their project and follow the instructions I posted earlier to sync the React Native Renderer with Hooks support to their project.
As React Hooks is expected to remain experimental for a few more months, we believe this approach provides the right mix of allowing you all to opt into React Hooks, without placing additional strain on the release process for the next few months prior to React Hooks potentially reaching stable release status.

Did someone in the community that followed these steps already published a temporary package to NPM containing the alpha? Would make it easier for us to try it out by just aliasing. If not, anyone interested in it here, then I publish it myself.

for everyone who suffer from building , i have done a repo to do it, just download and copy by following
this  instructions , you can play with hooks.
https://github.com/Foveluy/rn-temp-renderer

@Foveluy I got it working (I built my own react files though), few ideas

Are you using const MyComponent = () => instead of function MyComponent () {} perhaps?

Are you calling a hook that is not directly nested in the body of component function? https://reactjs.org/docs/hooks-rules.html#only-call-hooks-at-the-top-level

@IljaDaderko i tried a simple project just like
function App(){
    const [xxx,setXXX] = useState(0);
    return <View>{xxx}</View>
}

but got the same thing showing that error.
And I built my own renderers too.

@Foveluy
This index.js should work:
import React, { useState } from "react";
import { AppRegistry, Text } from "react-native";
import { name as appName } from "./app.json";

const TestApp = () => {
  const [count, setCount] = useState(0);
  return <Text>{count}</Text>;
};

AppRegistry.registerComponent(appName, () => TestApp);

If it does not, make sure you replaced the renderer folder only after installing all the other dependencies.
I also have to replace it each time I install a new dependency (but the error message is different from yours).

@mmazzarolo   great, thanks a lot. it is helping.

So far used useState and useEffect and seems to be working just fine. Only problem is red screen while debugging, just as others have reported.

For me the instructions @hramos posted work great. But the app crashes when I try to use hot reloading. Also, when running tests it complains in certain cases about "hooks can only be used in function body", even when it is a functional component. Btw, I am using the alpha of react-test-renderer

@kodafb

But the app crashes when I try to use hot reloading.

Might be related to: https://github.com/gaearon/react-hot-loader/issues/1088

Noticed one potential bug with useEffect and animated
  useEffect(
    () => {
      if (authenticated) {
        animate();
      }

      return () => {
        animation.stopAnimation();
      };
    },
    [authenticated]
  );

  function animate() {
    Animated.timing(animation, {
      toValue: 1,
      easing: easeInOutQuad,
      duration: durationLong,
      delay: 1000,
      useNativeDriver: true
    }).start();
  }

this is a simple animation triggered when user authenticates, works fine throughout, but when this component is unmounted and then mounted again, animation has much greater delay, expected one is 1000ms on re-mounting (not updating) its random between 2000 - 400

@IljaDaderko I'm using hooks + Animated as well and I'm experiencing a similar issue.
Strangely enough, if I place a console.warn() in the component it works correctly.
e.g.:
export const Interlude = memo((props: Props) => {
  const { onDone } = props;
  console.warn(`Rendering interlude`); // <- Here is the console warn
  const [titleAnim] = useState(new Animated.Value(0));
  const [subtitleAnim] = useState(new Animated.Value(0));

  const animateEnter = Animated.stagger(300, [
    Animated.timing(titleAnim, {
      toValue: 1,
      duration: 500,
      useNativeDriver: true
    }),
    Animated.timing(subtitleAnim, {
      toValue: 1,
      duration: 500,
      useNativeDriver: true
    })
  ]);

  const animateExit = Animated.stagger(300, [
    Animated.timing(titleAnim, {
      toValue: 2,
      duration: 500,
      useNativeDriver: true
    }),
    Animated.timing(subtitleAnim, {
      toValue: 2,
      duration: 500,
      useNativeDriver: true
    })
  ]);

  useOnMount(() => {
    Animated.sequence([animateEnter, animateExit]).start(onDone);
  });

  const titleOpacity = titleAnim.interpolate({
    inputRange: [0, 0.5, 1, 1.5, 2],
    outputRange: [0, 0.2, 1, 0.2, 0]
  });
  const titleTranslateY = titleAnim.interpolate({
    inputRange: [0, 1],
    outputRange: [20, 0]
  });
  const subtitleOpacity = subtitleAnim.interpolate({
    inputRange: [0, 0.5, 1, 1.5, 2],
    outputRange: [0, 0.2, 1, 0.2, 0]
  });
  const subtitleTranslateY = subtitleAnim.interpolate({
    inputRange: [0, 1],
    outputRange: [20, 0]
  });
  return (
    <Animated.View style={styles.container}>
      <Animated.View
        style={{
          transform: [{ translateY: titleTranslateY }],
          opacity: titleOpacity
        }}
      >
        <Animated.Text style={styles.title}>Well done.</Animated.Text>
      </Animated.View>
      <Animated.View
        style={{
          transform: [{ translateY: subtitleTranslateY }],
          opacity: subtitleOpacity
        }}
      >
        <Animated.Text style={styles.subtitle}>+5</Animated.Text>
      </Animated.View>
    </Animated.View>
  );
});

I haven't tried building in release mode yet though, maybe it would solve it.

Let us know if the above steps work out for you.

I tried following these steps and still get the TypeError: dispatcher.useState is not a function error.
I can see some other folks have it working, so it must be me, but not sure what is different between my usage/env and others.
Any chance of getting an alpha or some other prebuilt rev of this going? Now that I've seen hooks it's hard to want to keep writing things the old way.

I have the same problem as @scally. I got it working before but now I can't. Perhaps recent changes in react?

@scally @woodpav I have the same issue when I install a new dependency.
The workaround for now for me is replacing the renderer dir after each time I install a new dependency.

For anybody that wants to save themselves the hassle of manually building React and remembering to update the renderer directory each time you install a new dependency, I have set up a Git repo with this already preconfigured.
Simply run the following and it will replace the current react-native installation with the 0.57.4 tag of RN + the hooks rendering code:
npm install --save https://github.com/csfrequency/react-native#0.57.4-hooks.0

This build will still suffer with the same Debug errors mentioned earlier on this thread.

Thanks @chrisbianca, your build is working for me, and is the easiest way for people to try hooks in RN right now.
But I think the useEffect error is more serious that just a dev-mode bug. It seems to prevent the effect from working on the first few renders. This simple example should change the status bar on every tap, but it only works after one or two taps:
import React, { useState, useEffect } from "react";
import { Text, View, StatusBar } from "react-native";

export default function App() {
  const [isPressed, setIsPressed] = useState(false);
  useEffect(() => {
    StatusBar.setHidden(isPressed);
  });
  return (
    <View style={{ flex: 1, justifyContent: "center" }}>
      <Text
        onPress={() => {
          setIsPressed(!isPressed);
        }}
      >
        {isPressed ? "Wohoo Hooks" : "Press Me"}
      </Text>
    </View>
  );
}

I've just pushed an update which removes the annoying Debug errors.  You can install from a new tag:
npm install --save https://github.com/csfrequency/react-native#0.57.4-hooks.1

@ericvicenti This doesn't address the issue you've flagged above, but should at least make debugging it easier.

@chrisbianca Neat! What was the cause of that?

For anyone who would like to try hooks in production replace all instances of enableHooks = false with enableHooks = true in the cloned react repo. The relevant files are in react/packages/shared.
The yarn build command uses these flags to create ReactNativeRenderer-prod.js so you have to enableHooks before copying those files to your projects node_modules.

Hey guys
You can also use my starter project.
https://github.com/jas99/starter-ts-react-native-hook
It uses monkey-patching and also have typescript setup.
Thx

I took @chrisbianca's branch and applied one more patch to it in order to get it running in Expo, you can try the project out here if you like: https://github.com/expo/sdk-31-with-hooks-experimental

There were new releases today<EMAIL_ADDRESS>and<EMAIL_ADDRESS>I know you guys will probably update your builds soon but I did my own as well:
yarn add react@next react-native@"npm:@brunolemos/react-native"
yarn add --dev @types/react @types/react-native

I published it on npm instead of git, the installation seems faster this way.
Tweet

I tested @ericvicenti's code. There seems to be two issues:

The effect call seems to be one render late. It seems to happen only when remote debug is enabled.
When remote debug is disabled, it works, but the effect takes a couple seconds to happen.

@IljaDaderko: react-spring does already support hooks, and it even offers a bit more functionality, so might worth having a look at that.

@IljaDaderko: react-spring does already support hooks, and it even offers a bit more functionality, so might worth having a look at that.
Thanks for releasing the hooks version of react-native, I didn't have time to work on this.

Indeed, but I'm trying to utilise rn API as much as I can at the moment :)

@mmazzarolo did you also face it or just referring to the gif?

@brunolemos yep, facing it from day one.
Strangely enough, adding a console.warn() in the component that uses useEffect fixes the issue.

Noticed another useEffect related issue. Code below works as expected when delay property is not passed to animated i.e. animation finishes and logoAnimationLogic is called. If I add delay (no matter what value), then logoAnimationLogic is not called after animation has finished for roughly 2 - 3 seconds (again this doesn't seem to be related to delay value).
function logoAnimationLogic({ finished }) {
    if (finished) {
      setVisible();
    }
  }

 useEffect(
    () => {
      if (authenticated) {
        Animated.timing(animatedValue, {
          delay: 100,
          duration: 600,
        }).start(logoAnimationLogic);
      }
    },
    [authenticated]
  );

@jfrolich unfortunately it looks like react-spring doesn't support useNativeDriver yet

Thanks I was considering to use react-spring in react native, but indeed if it doesn't support useNativeDriver it's not a great option.

Does anyone have the problem that component trees with hooks don't hot reload?

Does anyone have the problem that component trees with hooks don't hot reload?

I do. I think it might still be related to the useEffect issue discussed above.

Not sure if anyone tried it yet but issues outlined here
https://github.com/facebook/react-native/issues/21967#issuecomment-438483674
Also happen in release builds and on physical devices, so its likely not linked to dev mode or simulator.

@hramos Curious about timetable on this, any updates or this is on back burner awaiting react?
Thx

@slorber I believe this line should be useState.
Try const [animatedValue] = useState(new Animated.Value(initialValue));

@slorber I believe this line should be useState.
Try const [animatedValue] = useState(new Animated.Value(initialValue));

It can also be ref, you don't necessarily need to store animated value in state, but you can.

@woodpav I think using a ref is ok

Based on @slorber's comment above, I've created this local test:
https://gist.github.com/bvaughn/b590a6bfe9ae06fd100dea2a77ab3775
But I'm not seeing any problems with useEffect. Anything I'm overlooking perhaps?

@bvaughn I haven't tried example posted by @slorber but @mmazzarolo posted yield same result as his gif previews.
https://github.com/facebook/react-native/issues/21967#issuecomment-439641251

Hm...the code in @mmazzarolo's comment is a lot larger (and TypeScript based) so I was hoping to be able to repro useEffect issue with something smaller.

I wonder if anyone else in this thread that's seeing the problem can reproduce it with the small Gist I shared?

@bvaughn just tested your gist and I saw the exact same bugs that I commented here
If you don't, please share your build with us.
package.json
"react": "16.7.0-alpha.2",
"react-native": "npm:@brunolemos/react-native",

Thanks for confirming, @brunolemos.
So far, I have been trying to reproduce with the version of React Native that's running within Facebook, which was built from React commit 3ff2c7c about 3 weeks ago.

@bvaughn maybe my example is a bit too subtile because the animation seems to work, but actually it works in the wrong way: when the toggle is true, the items are in the falsy positions, and vice versa.
If you run the Expo app of the repo, and add logs to the useAnimation entry and useEffect method, you will see that when useAnimation is called, the useEffect method is not called just after while it should. The useEffect is only called once we press again on the toggle, like if the effects didn't flush on update but rather flushing on next render/interaction or something

@slorber That's interesting. Changing my gist to also show the current state of the bool should show that then, no?
<Text onTouchEnd={toggle}>Bool is {bool ? 'on' : 'off'}</Text>

But it doesn't seem to. "Bool is on" always matches the fully opaque state.

@gaearon I also tried reproducing with the OSS build of React Native (which I manually edited to set enableHooks = true) but saw the same results.

Yes, I meant specifically the GH setup, which AFAIK has its own lockfile etc.

I am able to reproduce the bug with my Gist running in an Expo app. 👍
Going to try to dig into the differences now.

I also seem to be able to reproduce the bug when connected to the remote debugger (Chrome) although I had to manually edit the scheduler package to patch a postMessage bug.

What I'm seeing in my test harness seems to be that the state update caused by calling toggle flushes the previous update's useEffect call, so the animate function is always running one version behind, like @slorber said.

Ah, so this is interesting. When I more properly patch scheduler (aka just replace it with the canary release) then the bug goes away when connected to the Chrome debugger, but still happens when I'm not connected.
However in both cases, scheduler seems to be using the MessageChannel approach so I'm not sure yet why I'd see different behavior.

I think I've found the cause. The setTimeout branch of scheduler is scheduling callbacks on a 5000ms delay. This 5000ms is supposed to be the maximum expiration time, but in this fork it ends up being the minimum callback time (unless another state update forces us to sync-flush pending callbacks). So the result is that React doesn't call useEffect until after a few seconds in that branch.
I assume we (React team) haven't noticed this because we're typically using the postMessage implementation, but on iOS with JSC– React Native ends up using the setTimeout fork.
Unless I'm misreading things, that's the problems.

Can anybody confirm useaffect bug only affects ios?

@jas99, the useEffect bug(s) are reported on Android as well by @slorber here: https://github.com/slorber

This issue impacts JavaScriptCore, which is what React Native uses on Android as well.

Fix has landed via facebook/react/pull/14358 and will go out with the next release of scheduler.
If it's necessary, we can also do a bugfix release to the current scheduler but I think the number of people this affects is probably very low so I'm not sure how important it is to do that patch release?

@bvaughn awesome 🎉🎉
I know some people that postponed playing with it on react native because of the bug, so maybe make the patch fix? Which should increase the number of testers.

For the ones having problems with useEffect, I switched to useLayoutEffect (while facebook/react#14358) gets merged, and it works.

Yup, useLayoutEffect is synchronous and so it isn't affected by the timer bug.

Thanks @bvaughn! 🎉
It's perfect now.
For anyone else, I made a new build based on<EMAIL_ADDRESS>yarn add react@next react-native@"npm:@brunolemos/react-native"
yarn add --dev @types/react @types/react-native

Also add this to your package.json:
  "resolutions": {
    "scheduler": "0.12.0-alpha.3"
  },

Niiiiice!

@brunolemos Thanks for your build, but I think the resolutions part is unnecessary<EMAIL_ADDRESS>would be resolved to the latest alpha version.

Awesome, @bvaughn! Do you know if it works with Expo?

Awesome, @bvaughn! Do you know if it works with Expo?

I don't have a lot of Expo experience (in fact, my first time using it was looking into this bug, trying to run the repro) but... why wouldn't it? Any particular reason?

@bvaughn that's because as Expo runs on its own app, sometimes they do modifications to the react-native package, that's because when you are on an expo project, the dependency react-native its resolved to something from https://github.com/expo/react-native/releases

@brunolemos I am using
"react-native": "https://github.com/expo/react-native/archive/sdk-31-with-hooks-experimental.tar.gz",

on my package.json. Everything works fine, except trying to build the app, which is a huge blocker :(

@brunolemos I installed your package but useState in undefined.. I get this warning when yarn installing:

warning Resolution field<EMAIL_ADDRESS>is incompatible with requested version<EMAIL_ADDRESS>
However I added the 'resolutions' prop in my package.json. Did you do any other step? 😐
This is my package.json:
{
  "name": "RealmsCounter",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "@brunolemos/react-native": "npm:@brunolemos/react-native",
    "react": "^16.7.0-alpha.2",
    "react-native": "npm:@brunolemos/react-native"
  },
  "devDependencies": {
    "babel-jest": "23.6.0",
    "jest": "23.6.0",
    "metro-react-native-babel-preset": "0.50.0",
    "react-test-renderer": "16.6.1"
  },
  "jest": {
    "preset": "react-native"
  },
  "resolutions": {
    "scheduler": "0.12.0-alpha.3"
  }
}

Also I'm using
yarn 1.12.3
react-native-cli: 2.0.1
react-native: 0.57.7-hooks.1

@josemigallas I think scheduler was update on latest react-native RC  0.58.0-rc.1
test it again with:
yarn add react-native@next

How do I solve this issue? Im using 0.57.8 version of React Native, 16.7.0-alpha.0 v of React and React Test Renderer and I don't know what causes this error.

@alk831 Make sure you replace all instances of enableHooks = false with enableHooks = true in react/packages/shared before running yarn build -- --type=RN_OSS

I've been using Hooks in production with zero problems so far!
Using this method I posted earlier.
You can check the source code here and the iOS app here. Haven't published the Android app yet.

@brunolemos  thanks for that, it works great even useEffect is working. Do you plan on keeping that repo up to date with new rn releases? Thanks again!

@MrLoh actually it is a release of expo/react-native: https://github.com/expo/react-native/releases.
What version of RN are you using on your project?

@kevinwolfcr, I just forked the code from that repo. Check the package.json there.

@brunolemos I followed your steps and it's working, but now when i use npm install --save somelibrary,
it seems like my npm always fails..any reason?

@sarmad1995 https://github.com/ds300/patch-package

@sarmad1995 after npm install look back in node_modules/react-native; ur changes r gone, use above package to monkey patch

Mine is working perfectly, without expo.

Can someone explain how can i do this ?
I have downloaded an expo project and then i have tried doing this.
yarn add react@next react-native@"npm:@brunolemos/react-native"
yarn add --dev @types/react @types/react-native

added to package.json
"resolutions": {
  "scheduler": "0.12.0-alpha.3"
},

however this is the error i get when i try to run it with expo start
Unable to resolve "react-native/Libraries/Components/View/ViewStylePropTypes" from "node_modules/react-native-reanimated/src/createAnimatedComponent.js"
ERROR
18:38
Building JavaScript bundle: error

The error message you pasted seems to suggest that Yarn had a problem installing @brunolemos fork of react-native, because the path the error message references (react-native/Libraries/Components/View/ViewStylePropTypes) seems valid.

@davibe for expo use this instead of my fork https://github.com/expo/sdk-31-with-hooks-experimental

Hooks es un gran cambio para la sintaxis React / RN. ¿Una gran cantidad de documentos necesitarán una actualización también?

It is optional to implement it because imagine that Hooks is a functional component with access to the state, to the life cycle, to the context. It is a "class with a wrapped in a functional component". The classes are not going to disappear or the functional components, now we have an easier way to use what the class provided us and to reuse logic.

I made a stackoverflow post with a small guide here:
https://stackoverflow.com/questions/53960785/typeerror-dispatcher-usestate-is-not-a-function-for-react-native

Wonder if anyone can help, I have followed @brunolemos guide on getting up and running with hooks on react-native, but as soon as I start to use hooks in my project I run into this error in the android simulator;

@chinds185a I'm assuming you already did this: https://github.com/facebook/react-native/issues/21967#issuecomment-449615358
And followed the upgrade guide of each react native version after the one you were using.
Upgrade your metro-react-native-babel-preset version. Change your .babelrc to this https://github.com/devhubapp/devhub/blob/master/.babelrc.
It seems you are using custom jsc. Remove the polyfills, make sure you followed the steps correctly: https://github.com/react-native-community/jsc-android-buildscripts/blob/master/README.md#how-to-use-it-with-my-react-native-app

Thanks for the suggestions @brunolemos will try these later.
I have followed the upgrade path as this is a new project and I started with the latest versions of react and react-native.

@brunolemos Thanks for the suggestions however I am still having the same issues, and it only appears when trying the useContext hook :/
I have;

Removed the polyfills
Locked react version too 16.7.0-alpha.2
Updated metro-react-native-babel-preset to ^0.51.1
Using the latest JSC for android and followed the setup/build instructions
I am running babel 7
Have react-native installed from npm:@brunolemos/react-native

React 16.8 with Hooks has been released: https://reactjs.org/blog/2019/02/06/react-v16.8.0.html
We are working on updating React Native to use React 16.8 in time for the React Native 0.59 release.

👀 https://github.com/facebook/react-native/commit/ccefc700d0120539eba73747d1d6b65effb0645d

The 0.59 release has been promoted to stable. Read more in the React Native blog: http://facebook.github.io/react-native/blog/2019/03/12/releasing-react-native-059
Now that Hooks are generally available, I'll go ahead and unpin this thread.


Feature/sdk 94 add delete directory api endpoint to net

Adds a Delete Directory API Endpoint and corresponding test.

Could we add a test for this?

Could we add a test for this?

My .NET knowledge is pretty limited and unfortunately there are no existing tests for deletion in this SDK to reference (there's no test for the delete connection endpoint). But I'm working on it 😅


[STU-285] Adding support for optional upload to cloud

Blocked by project PR
Once merge, add the new exportToCloud to the createNewTest function


Unreachable URL Error

I used Command after installing all dependencies and packages
node export.js "https://webconf.math.cnrs.fr/playback/presentation/2.0/playback.html?meetingId=75a2b065370729d36ebf62af77cfed12188c469e-1611057450210" meeting.webm 10 true
Found Error: Recording URL Unreachable
URL Perfectly open in Web Browser and
BBB_HOST = webconf.math.cnrs.fr/
Kindly provide the solution for downloading such above URL Recording.

Make sure your system is able to access url.


Add tests with larger model architectures

We should add some tests to catch potential issues with larger models. When computing Hessians it's very easy to run out of memory on consumer hardware, so some tests that check that we don't do any unnecessary allocation of memory might be useful.
Some ideas:

Have tests that checks that our supposedly memory-efficient Laplace variants (last-layer, subnetwork, KFAC, low-rank) actually scale to large models and don't throw out-of-memory errors
Have tests that fail when trying to be bold and e.g. run full Laplace on a big model (this one is kind of trivial)

Are there actually good ways to test these things? I.e. do we know which hardware the tests will be run on (probably on some CPU) and can we artificially limit the memory available (e.g. to emulate behaviour for a standard GPU with, say, 16GB of memory, if the CPU comes with more RAM than that)?
Somewhat relatedly, we could consider adding more informative error messages when running out of memory during Hessian allocation / computation. E.g., if initialising the Hessian runs out of memory, we could raise an error saying something like
"Your model is too big for using FullLaplace. It has X parameters, so the Hessian would be YTB large, while your CPU/GPU only has ZGB memory available. To use FullLaplace on your machine, your model can at most have ~V parameters. Instead, consider using a more memory-efficient Laplace variant, such as W."

@edaxberger I think this issue was sufficiently addressed in #72. I will create a new one for the descriptive error message.


Update the logic used to generate the documentation and add a python page

This PR:

Reimplement the machinery to build the website in python
introduce the config.toml file to specify the parameters required to build each version of the documentation
Add the possibility to specify additional files in the documentation
Add python-additional-info file for the documentation
Update the github action to generate the documentation

That's strange that python is not able to find toml if it is installed via conda

That's strange that python is not able to find toml if it is installed via conda

fixed adding
shell: bash -l {0}

See here: https://github.com/conda-incubator/setup-miniconda#use-a-default-shell


added Bone.rotate and Bone.scale

Here is a PG I used for testing:
http://www.babylonjs-playground.com/#I6RJJ#6
http://www.babylonjs-playground.com/#I6RJJ#7
http://www.babylonjs-playground.com/#I6RJJ#8
http://www.babylonjs-playground.com/#I6RJJ#9

This version can be used to transform a normal to itself.

Excellent! Do you mwant je updating the doc as well? http://doc.babylonjs.com/tutorials/How_to_use_Bones_and_Skeletons

No problem.  I'll do that in a few days.

I got this working while an animation is playing:
http://www.babylonjs-playground.com/#11BH6Z#177
For some reason, scaling without rotating the bone doesn't work.
http://www.babylonjs-playground.com/#11BH6Z#178
If I animate the scaling it shows some erratic movement:
http://www.babylonjs-playground.com/#11BH6Z#179
Do you know what could be causing that?


In a create react app project,it still occur wrong when set alias.

./node_modules/cesium-react/dist/cesium-react.es.js
Module not found: Can't resolve 'cesium' in 'node_modules\cesium-react\dist'
i have set alias
config.resolve = {
    alias: {
        cesiumSource: "cesium",
        cesium: "cesium/Cesium"
    }
};

For now, this is recommended.
I plan to write a document how to get started resium project with create-react-app.

Hi, you can set aliases as bellow in webpack config. It will work.
resolve: {
  alias: {
    cesium$: "cesium/Cesium",
    cesium: "cesium/Source"
  }
}

See also readme.
Reopen an issue if the issue persists.


Display versions table without truncation

I noticed the columns are truncated and it's hard for me to copy a version I want. @Zethson Could we display it without truncation? Or maybe just simply return a dataframe?

Rich tables automatically fit the terminal width. The is the same behavior that e.g. Pandas DataFrames have. Nevertheless, I added an option to return a Pandas DataFrame.


Request review on best practice of DRE, KISS and YAGNI

I'm writing to ask for your assistance in verifying that I adhered to the guidelines and best practices for our "To-Do List" project. Please verify that I have adhered to the DRY (Don't Repeat Yourself), KISS (Keep It Simple Stupid), YAGNI (You Aren't Gonna Need It), and HTML and CSS best practices.
I would be very happy if this is done and guild me on what next to do to achieve best out of this assignment
I appreciate your assistance and time. I want to hear from you as soon as possible.

Status: Approved ✔

Hi @Ellyboi
Excellent work! 💯
I have reviewed your pull request and I am happy to report that I did not find any violations of the DRY, KISS, or YAGNI principles in your code. You have done a great job implementing these principles and your code is clean, easy to read, and follows a logical flow.
Thank you for your contribution and attention to detail. Your work is much appreciated!
Your feature is complete! There is nothing else to say other than... it's time to merge it. :shipit:
Congratulations!!!🎊 🥳
Highlights 🌞
✔  Great work with github flow
✔  The project is working correctly
✔  Great implementation of DRY, KISS and YAGNI
[OPTIONAL] :
You have to add the script tag just before the closing body tag </body> if you have many functions to load is going to slow all the elements load.
https://github.com/Ellyboi/To-Do-List-Best-Practice/blob/4052badb7ae20b7807cd8cb055a9dcad0691f50c/src/index.html#L8
Cheers 🥂  and Happy coding!!! 👯
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Remember to tag me @MarcoDDM in your question so I can receive the notification.


Mcs 123: IntPhys Scene Generator: Implausible Object Permanence with Objects Moving Across

I accidentally pushed changes to this for MCS 130: IntPhys Scene Generator: Implausible Object Permanence with Objects Falling Down. If you want I can try to undo it, but I'm not positive how, so I'd rather leave them here and have this PR be fore both 123 and 130. (They're pretty closely related, at least.) Sorry.

I just realized that I was doing quartets wrong (each one as a standalone scene rather than each one a different variant of the same scene). Converting this to a draft while I fix it.


Video generation with custom image pairs

Hi,
I have a set of image pairs consisting of the first and last frames, each with bounding boxes.
How can I utilize code to create videos for custom images?
Is there any quick way to test it out?
Any guidance would be appreciated!
Best,
Chau

Hi @chaudatascience,
We trained our model exclusively on autonomous driving datasets. If your image pairs consist of street-view images from a first-person view camera (dash camera images), I can upload our trained weights to HG for you to test.
If the images are not related to cars, we do not have a pre-trained weight for such tasks at the moment. However, you can utilize our code to train a model for that purpose. We may train our model on other types of data and upload the weights in the future.
Cheers,
Olga

Got it, thank you!


🚀 Feature:  Load template from backend plugin

🔖 Feature description
Hi team.
I want to build feature.When I create component,  It can auto trigger call External API and auto register new component to Backstage.
Or backstage action can call existing API of backstage backend plugin.
And I don't want use git to store yaml file. I want store yaml file in data base of backstage plugin.
Thank you. Sr about my english.

🎤 Context
no
✌ Possible Implementation
No response
👀 Have you spent some time to check if this feature request has been raised before?

[X] I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

[X] I have read the Code of Conduct

Are you willing to submit PR?
None

Hey :wave:
So I'm not 100% sure on what you want to be able to do here.
Are you wanting to add things to the catalog without creating a catalog-info.yaml file in GitHub and using the scaffolder to do it?


Feature Request: Please consider adding support for starting the container via systemd socket activation

It would be wonderful (but not trivial!) to add support for starting the container+server via systemd socket activation. It would allow starting the server on-demand, while leaving it not running most of the time. This is a good match for servers that are rarely used and which shouldn't be left on 24/7 consuming system resources.
Since, to my knowledge, Valheim itself does not support socket activation, support would have to be "grafted on" by using proxies such as systemd-socket-proxyd to intercept and buffer the connection while the container and server are launching. From my reading, I get the impression this is possible, but that the easiest way is to have support built-in to the container image itself -- hence this feature request.
Some prior art on adding support to services that do not natively support socket activation:

https://shadowkat.net/blog/32.html
https://insanity.industries/post/socket-activation-all-the-things/

General background reading:

http://0pointer.de/blog/projects/socket-activation.html
https://www.freedesktop.org/software/systemd/man/latest/systemd.socket.html
https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdSocketActivationThoughts
https://github.com/containers/podman/blob/main/docs/tutorials/socket_activation.md#socket-activation-of-containers

Of course, another option would be to ask the upstream game developers for native support...
Would also address #687, as mentioned in the comments.

This all hinges on how Valheim's Windows client behaves when a server doesn't respond within a certain amount of time. It's going to take anywhere from 10 to around 40 seconds for the server to start up, load the world and accept connections. During that time the client's UDP packages wouldn't get any response. Systemd would buffer them and eventually forward to the server, but the client might just assume a server that doesn't respond within seconds to be dead.

I don't use Docker but I'm commenting here since this is one of the discussions I stumbled upon while working on socket activation for my Valheim dedicated server, in the interest that this is somehow useful to you. I ended up writing a small UDP proxy in Node.js (but it could be any language really) to manage the socket. I detailed it all in a blog post at https://blog.nytsoi.net/2024/07/18/valheim-systemd-socket-activation and the code repo is https://git.ahlcode.fi/nicd/valproxy.
The caveat is that as you mentioned, the server takes time to start, and on my server it's not quick enough to respond to the first connection attempt. So the first user will need to connect twice. I deem this acceptable in my use case, which is just a server for some friends.


The recent version generates incorrect import operations

I update to the recent version which supports per-channel QAT. It seems that some incorrect import operations are generated to the model description script, e.g:
import self.float_functional_simple_0
import self.float_functional_simple_1
import self.float_functional_simple_10
import self.float_functional_simple_11
import self.float_functional_simple_12
import self.float_functional_simple_2
import self.float_functional_simple_3
import self.float_functional_simple_4
import self.float_functional_simple_5
import self.float_functional_simple_6
import self.float_functional_simple_7
import self.float_functional_simple_8
import self.float_functional_simple_9
The training then cannot be done due to following error:
import self.float_functional_simple_0
ModuleNotFoundError: No module named 'self'

@liamsun2019 Will look into it.

The older version does  not have this problem. But I am not sure  from which version this issue is introduced.

@liamsun2019 Should be fixed. Would you please try again?

It works after updating. Thanks for your fast fix.


Remove isFromKeyboard in favor of :focus-visible

Feature Request
Problem description
IsFromKeyboard is not like the other states. It requires runtime style compilation. We cannot iterate over the style functions and produce stylesheets due to the presence of this runtime state value.
We could opt to transform this state into a special class name and require consumers to use isFromKeyboard to apply the class name to their own components, but this is complicated and awkward.
Proposed solution
There is a :focus-visible spec that only applies styles on focus from keyboard. There is also an official polyfill. We should investigate this spec compliant future proof selector. It will allow us to iterate style functions without a runtime necessary.
https://css-tricks.com/keyboard-only-focus-styles
https://github.com/WICG/focus-visible

    /*
      TODO: this could solve the isFromKeyboard and onFocus complication.
            Need to work out how we integrate this static style into style functions.
    [data-whatinput="mouse"] *:focus {
      outline: none !important;
    }
    [data-whatinput="keyboard"] *:focus {
      outline: 2px solid red !important;
      outline-offset: -2px;
      z-index: 1;
    }
    */

Other option is to use global selector to disable styles when input device is a mouse.

@layershifter had another idea - to use fela enhancers and allow global prefix in the selectors: https://codesandbox.io/s/young-dust-fy3b0
taking this one step further, we can have an enhancer that will allow us to do:
const buttonRule = () => ({
  background: "green",

  ":focus": {
    backgroundColor: "red",

    ':focus-visible': {
      backgroundColor: "orange"
    }
  }
});

or something similar

fixed


Add ssl_trust_store property to README

Add api property " apiProperties.ssl_trust_store" example since most users will (hopefully) be using secure communications.

Thank for your contribution, will be actioning this shortly.


Transaction converting to polygon stuck

Tried to swap from BTC --> ETH on polygon.
BTC went through and recognized the confirmations.
However, attempting to sign in metamask for the final conversion to eth and I get:
Swap unable to complete
Error swapping, token please try again
Using trezor wallet for this.
Any support?

Thanks for writing. Did you try again? Don’t worry no funds are lost. You’re using Trezor though metamask?

Keep the url of the swap page somewhere in your notes (or even put it here)

I appreciate the quick response.
url of swap page is:
https://hippodrome.cryptocolosseum.com/transaction/mint/BTC/0xceaff0d9299b8bbc8b56b9a5f2b5cbfb13fd8baa/21?swap=0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619
Normally when I have signed in the past in metamask it brings up the message in my Trezor T and in this case it just did it in the browser window and did not interface with the Trezor for signing.

Also it says 0 Bitcoin received on the window...which is incorrect

Also it says 0 Bitcoin received on the window...which is incorrect

Thank you for that. That's just a decimal place problem - will fix that ASAP

I appreciate the quick response.
url of swap page is:
https://hippodrome.cryptocolosseum.com/transaction/mint/BTC/0xceaff0d9299b8bbc8b56b9a5f2b5cbfb13fd8baa/21?swap=0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619
Normally when I have signed in the past in metamask it brings up the message in my Trezor T and in this case it just did it in the browser window and did not interface with the Trezor for signing.

Is there some place we can chat in realtime? We have a #hippodrome channel here: https://discord.gg/Z6KX7VU9ZY and i'm tobowers on all the messengers.

I appreciate the quick response.
url of swap page is:
https://hippodrome.cryptocolosseum.com/transaction/mint/BTC/0xceaff0d9299b8bbc8b56b9a5f2b5cbfb13fd8baa/21?swap=0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619
Normally when I have signed in the past in metamask it brings up the message in my Trezor T and in this case it just did it in the browser window and did not interface with the Trezor for signing.

Did you just retry the swap? sometimes it's just about the price changing and the market has been volatile.

I have tried several times to sign in Metamask including different computers and browsers with no luck.

I have tried several times to sign in Metamask including different computers and browsers with no luck.

ok - I got one suggestion from gnosis  - let's see if we can't discuss in realtime somewhere.

Normally when I have signed in the past in metamask it brings up the message in my Trezor T and in this case it just did it in the browser window and did not interface with the Trezor for signing.

Oh I am just noticing this @dadoc1 - if your Trezor didn't sign and the address is your Trezor that will be a problem. Maybe there's a misconfiguration on the metamask/trezor combo? Maybe because it's polygon?
I'm also introducing a fix here that we know is needed for Ledger/Metamask, but not sure about Trezor.

It's possible.  I've signed before using the matic/polygon bridge.  looking through other forums it looks like there is a potential issue with trezor signing from metamask.   If I am unable to sign does that mean the BTC is "stuck"?

I think we will figure it out :). Is the address the razor address in the
top right?.
Topper Bowers
@.***
github.com/tobowers
linkedin.com/in/topperbowers

Yes shows up normally in top right.  connects fine.

Could we take this to somewhere more synchronous? Like our discord or telegram, signal, etc? I'll do some more research tomorrow too.


Polynomial coefficient as ScalarField

Hello! I am trying to use a polynomial coefficient as a ScalarField of an elliptic curve, like in the following function:
pub fn coeff_committment<G: ProjectiveCurve, F: PrimeField>(p: DensePolynomial<F>, g: G) -> Vec<G> {
    let mut points = Vec::new();
    for i in 0..p.coeffs.len() {
        let point = g.mul_assign(p.coeffs[i]);
        points.push(g);
    }
    points
}

But I am getting the following error: "the trait std::convert::From is not implemented for <::ScalarField as algebra::fields::PrimeField>::BigInt".
Can someone help me, please? Thanks!

Hi!
You can do it as follows:
pub fn coeff_committment<G: ProjectiveCurve>(p: DensePolynomial<G::ScalarField>, g: G) -> Vec<G> {
	p.coeffs.iter().map(|c| g.mul(c.into_repr())).collect()

}

Almost there, but it stills gives me this error:
"expected type &<G as algebra::curves::ProjectiveCurve>::ScalarField
found type <<G as algebra::curves::ProjectiveCurve>::ScalarField as algebra::fields::PrimeField>::BigInt
consider constraining the associated type <<G as algebra::curves::ProjectiveCurve>::ScalarField as algebra::fields::PrimeField>::BigInt to &<G as algebra::curves::ProjectiveCurve>::ScalarField"

There is no need to convert to BigInt, it works now. Thank you so much!

I realise my code snippet is a bit different from what you originally posted. My snippet produces [g^a_0, g^a_1, ..., g^a_d], whereas yours produces ``[g^a_0, g^{a_0 + a_1}, ..., g^{a_0, + ... + a_d}]`.


controllerAs: 'vm' conflicts with new router component

It seems to me that the new router has an implicit scope object which ties to the component name. This seems to conflict with https://github.com/johnpapa/angular-styleguide#style-y032, which recommends using controllerAs: 'vm'. Should we now be using controllerAs: 'componentName' instead of controllerAs: 'vm'?
I commonly pass data into my controllers via $state promises as recommended https://github.com/johnpapa/angular-styleguide#style-y081. Typically, if I am resolving a movie from my movieService, I would   pass it to MovieController as 'movie' and add it to the scope as 'vm.movie'.
If I use the implicit scope name from a new router component, I would end up with 'movie.movie'. That doesn't look right. Any suggestions on how to handle these issues with the new router? Am I missing something?

Without documentation it is difficult to say exactly how the out-of-the-box conventions play out.
What is clear from looking at the code is that the JS "component" referenced by the new router does NOT take a scope and is in "As VM" style. There is no "implicit scope object"; the view is bound to an instance of the controller (instance of the "component" in ng 2.0).
But I take your main point. Judging by this example, you are expected to refer to the "controller/component" either by its root filename or by its registered camelCase name, minus the "Controller" suffix. We'd have to play with it to determine how this actually works.
Here is "welcome.js"
angular.module('example.welcome', []).
    controller('WelcomeController', WelcomeController);

function WelcomeController() {
  this.heading = 'Welcome to The New Angular Router Demo!';
}

Here is "welcome.html"

{{welcome.heading}}

Also troubling for the style guide is that the router convention appears to demand that the root name of the controller file be the same as the root name of the html file. That means we'd have to change the style guide's recommended welcomeController.js to welcome.js.
As for your example, if you call the property movie and you name your controller movie.js, you'll get movie.movie. I don't see a way around that ... other than to choose a different name for the controller or the property.

@wardbell Thanks for your thoughts. I may have used the term 'implicit scope object' incorrectly but we have the same understanding of the issue.
Practically, my controllers would normally be called something more descriptive than 'movieController', so your instinct is probably right - movieViewer.movie looks fine.
A related issue is that I will often use the same template for newMovieController and movieEditorController.  That works fine if both controllers are controllerAs: 'vm', but if one is
controllerAs: 'newMovie' and the other controllerAs: 'movieEditor', they obviously won't be able to share a template or ng-include. I suppose a movieForm directive/component would solve the problem. Any thoughts on that?
I guess this conversation may be a bit premature or misplaced, so I'm happy to wait for 1.4 to be officially released.
Maybe this will become clearer once 1.4 is officially released.

Don't use controller or controllerAs in your route config and use just a templateUrl. You will then have two templates in which you can define the template and controller pair you want through ng-include.

i'm not sure what the action item is here yet

The question at issue: should we recommend that the controllerAs variable name be "welcome"  instead of "vm".
Of course this is a 1.x style guide. But it does aspire to recommend styles that are as easy to migrate to v.2 as possible.
And if we recommend the new router in v.1.x (whatever it is called), we're not going to be able to use the word "vm" as the variable name.
I think that is going to be a serious problem. Or am I missing something?

@wardbell — Agree, PR #401 should fix this (and is conform to how Angular 2 works).
Thanks to @reflexdemon for linking this issue with the PR.

Was reading some blogs on Todd Motto website and found this really good.
A better way to $scope, angular.extend, no more “vm = this”. I think that what I was kind of looking for when I initially started moving from Backbone.JS to Angular.JS.
@johnpapa this might have answers for the questions on this topic.

I don't think we are going to solve this here, nor should we, for Angular 1.x. Good discussion though.
Naming of the vm is entirely up the user. There are many discussions in the guide about this, and my experience has lead me convincingly to start with vm and go more explicit only when the need arises.
This guide is about what is available and a good style for code you write today. What is coming is still evolving, and when that comes, it will take time to determine the right style. When that happens, I'l revisit this topic.
Closing.

@johnpapa — Good call! :+1:


Seeding OrderCloud Data fails for the region Europe

Currently it is not possible to seed the marketplace for the region "Europe-West". The reason is a hard coded apiUrl in the headstart project: https://github.com/ordercloud-api/headstart/blob/1fd1a4b50ba6031860e06591a436805a941c0b3a/src/Middleware/src/Headstart.Common/Models/Misc/EnvironmentSeed.cs#L135
Unfortunately, neither "OrderCloudSettings:ApiUrl" is used, nor can I pass the environment "westeurope-sandbox" via the seed request.

Thanks for raising an issue. Yes, regions are currently unaccounted for as they were a relatively new addition to the API.

This is resolved after this PR https://github.com/ordercloud-api/headstart/pull/353


Add initial Travis CI

This commit adds in an initial CI. Some CI scripts are pulled from the
IBM/pattern-ci repo. This commit adds CI in the following:

Linters for Shell and YAML files
Tests docker-compose yaml and one service endpoint
Tests REST APIs using Flask unit Tests

Modified tests.py to be used in command line
Modified tests.py to use local mongo instead
of recreating mongo containers on each test.
Mongo database is dropped after each test case.

This commit modified YAML files to pass the YAML linter.
This commit adds init.py in web folder so that tests.py can
import it.
This commit modifies The Dockerfile in the flask app. The base image is
now using python alpine image instead of ubuntu. This reduces the total
image size of the app.
Signed-off-by: AnthonyAmanse<EMAIL_ADDRESS>

closing since there would be some restructuring of code


Managed by external processing framework like Spring Batch?

More of a discussion point than an issue per se, (1) does it make sense to use a framework like Spring Batch manage the crawling process, and (2) can crawler4j support it?

From what I see the only way to use crawler4j in a J2EE batch container or Spring Batch is to wrap the entire thing is a batchlet/tasklet and execute it as a single step, so it doesn't play very well in these frameworks.  I would like to see some more modularization/IoC in crawler4j that would allow a container more control over the entire process.


community[patch]: bedrock: add model name to identifying params (cache keys)

I noticed that when caching is enabled with BedrockChat, I get the same answers from completely different models. So it seems the model name is missing from the cache key.
This PR adds a test and attempts to solve the problem, but I'm not sure if it's the correct solution. Any help appreciated.

Thank you!


PS bug in mobile ([Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.)

Hello,
I am having this issue with perfect scrollbar only on mobile. I guess the bug appears only on touch event. When scrolling the bar I get this error in console:
perfect-scrollbar.esm.js?b7f5:562
[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080

And this is the line where it cannot prevent default:
function mouseMoveHandler(e) {
    if (e.touches && e.touches[0]) {
      e[pageY] = e.touches[0].pageY;
    }
    element[scrollTop] =
      startingScrollTop + scrollBy * (e[pageY] - startingMousePageY);
    addScrollingClass(i, y);
    updateGeometry(i);

    e.stopPropagation();
    e.preventDefault(); // Here
  }

Steps to reproduce:

Check my fiddle: https://jsfiddle.net/671duorb/1/
Open Console (F12)
Toggle device toolbar
Select one of the mobile screens
Try to drag the scrollbar (not screen, the bar itself)

In jsfiddle console nothing will appear, but in your browsers console you will get the above mentioned error. After that the scrollbar gets stuck in focused state until refresh.

Anyone reading these?

Same issue too

is there a temporary solution for this? It seems to happen only in chrome after a touch event

I've got the same issue. It appears to be related to this chrome update https://developers.google.com/web/updates/2017/01/scrolling-intervention . It dates from 2017, but idk.. There's also a PR #946 that seems to fix it.

I've got the same issue. It appears to be related to this chrome update https://developers.google.com/web/updates/2017/01/scrolling-intervention . It dates from 2017, but idk.. There's also a PR #946 that seems to fix it.

The issue exists on Firefox as well.

Also when can we expect the update? I have project pending to deploy.

is there a temporary solution for this?


More coherent exception handling

New exceptions module with base OsbsException class and two
exceptions derived from it:

OsbsResponseException, for OpenShift 'fail' responses
OsbsNetworkException, for (possibly transient) network
failures

The OsbsResponseException is thrown by the api and core modules
when they see a fail HTTP response.
The PycurlAdapter class catches exceptions thrown during
request handling and maps them to either OsbsNetworkException
or OsbsException as appropriate.
This fixes #43.

@twaugh Tim, could you please take care of the issues found by @landscape-bot

@landscape-bot ++


Not showing right values

Hi i have 3 BMS and the BLE ESP32.
Yesterday a low temp alarm went off after i checked i saw that BMS2 had 0C.
But not only temp was at 0. A lot of other values are also zero or wrong.

I tried restart everything but nothing helped.
I checked the log from the ESP32 and there are also wrong values.
[09:28:06][D][jk_bms_ble:646]: Unknown168: <IP_ADDRESS>.00.02.FB.1D.00.00.C<IP_ADDRESS>.3C.<IP_ADDRESS>A.F<IP_ADDRESS>.00.00.00.B1.05.F<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.00.00 (46)
[09:28:06][D][jk_bms_ble:660]: Unknown189: 01 64
[09:28:06][D][jk_bms_ble:664]: Unknown192: 00
[09:28:06][D][jk_bms_ble:666]: Unknown193: 00 B1 (0x00 0x8D)
[09:28:06][D][jk_bms_ble:668]: Unknown195: 05 F6 (0x21 0x40)
[09:28:11][D][sensor:127]: 'battery2 cell voltage 1': Sending state 3.31800 V with 3 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 cell resistance 1': Sending state 0.00000 Ω with 3 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 cell voltage 2': Sending state 3.31800 V with 3 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 cell resistance 2': Sending state 0.00000 Ω with 3 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 cell voltage 3': Sending state 3.31600 V with 3 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 cell resistance 3': Sending state 0.00000 Ω with 3 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 cell voltage 4': Sending state 3.31600 V with 3 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 cell resistance 4': Sending state 0.25500 Ω with 3 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 cell voltage 5': Sending state 3.31600 V with 3 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 cell resistance 5': Sending state 0.00000 Ω with 3 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 cell voltage 6': Sending state 3.31800 V with 3 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 cell resistance 6': Sending state 3.31800 Ω with 3 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 cell voltage 7': Sending state 3.31500 V with 3 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 cell resistance 7': Sending state 0.00500 Ω with 3 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 cell voltage 8': Sending state 3.31500 V with 3 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 cell resistance 8': Sending state 0.00600 Ω with 3 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 min cell voltage': Sending state 3.31500 V with 3 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 max cell voltage': Sending state 3.31800 V with 3 decimals of accuracy
[09:28:11][I][jk_bms_ble:516]: Enabled cells: 00 00 00 00
[09:28:11][D][sensor:127]: 'battery2 average cell voltage': Sending state 0.00000 V with 3 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 delta cell voltage': Sending state 0.00000 V with 3 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 max voltage cell': Sending state 1.00000  with 0 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 min voltage cell': Sending state 1.00000  with 0 decimals of accuracy
[09:28:11][D][jk_bms_ble:540]: Unknown112: 00 00
[09:28:11][I][jk_bms_ble:545]: Wire resistance warning: 00 00 00 00
[09:28:11][D][sensor:127]: 'battery2 total voltage': Sending state 0.00000 V with 2 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 current': Sending state 0.00000 A with 2 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 power': Sending state 0.00000 W with 2 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 charging power': Sending state 0.00000 W with 2 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 discharging power': Sending state 0.00000 W with 2 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 temperature sensor 1': Sending state 0.00000 °C with 0 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 temperature sensor 2': Sending state 0.00000 °C with 0 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 power tube temperature': Sending state 0.00000 °C with 0 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 errors bitmask': Sending state 0.00000  with 0 decimals of accuracy
[09:28:11][D][text_sensor:067]: 'battery2 errors': Sending state ''
[09:28:11][D][sensor:127]: 'battery2 balancing current': Sending state 0.00000 A with 2 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 state of charge': Sending state 0.00000 % with 0 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 capacity remaining': Sending state 17629.18555 Ah with 0 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 total battery capacity setting': Sending state 0.00000 Ah with 0 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 charging cycles': Sending state 26543.00000  with 0 decimals of accuracy
[09:28:11][D][sensor:127]: 'battery2 total charging cycle capacity': Sending state 259.66800 Ah with 3 decimals of accuracy
[09:28:11][D][jk_bms_ble:630]: Unknown158: 37 26 (always 0x64 0x00?)
[09:28:11][D][jk_bms_ble:633]: Unknown160: 00 00 (always 0xC5 0x09?)
[09:28:11][D][sensor:127]: 'battery2 total runtime': Sending state 15335656.00000 s with 0 decimals of accuracy
[09:28:12][D][text_sensor:067]: 'battery2 total runtime formatted': Sending state '177d 11h'
[09:28:12][D][jk_bms_ble:646]: Unknown168: <IP_ADDRESS>.00.02.0A.1E.00.00.C<IP_ADDRESS>.3C.<IP_ADDRESS>A.F<IP_ADDRESS>.00.00.00.B6.05.F<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.00.00 (46)
[09:28:12][D][jk_bms_ble:660]: Unknown189: 01 64
[09:28:12][D][jk_bms_ble:664]: Unknown192: 00
[09:28:12][D][jk_bms_ble:666]: Unknown193: 00 B6 (0x00 0x8D)
[09:28:12][D][jk_bms_ble:668]: Unknown195: 05 F6 (0x21 0x40)

When i direct connect my phone to the bms the values are ok,
I tryed to update the esp but i just get errors.
INFO ESPHome 2023.6.5
INFO Reading configuration /config/esphome/battery-2.yaml...
INFO Updating https://github.com/syssi/esphome-jk-bms.git@main
WARNING The selected ESP-IDF framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
WARNING The selected ESP-IDF framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
INFO Generating C++ source...
INFO Updating<EMAIL_ADDRESS>INFO Compiling app...
Processing battery2 (board: nodemcu-32s; framework: espidf; platform<EMAIL_ADDRESS>--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - framework-espidf @ 3.50001.0 (5.0.1)
 - tool-cmake @ 3.16.4
 - tool-ninja @ 1.7.1
 - toolchain-esp32ulp @ 2.35.0-20220830
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Reading CMake configuration...
-- Building ESP-IDF components for target esp32
Processing 1 dependencies:
[1/1] idf (5.0.1)
-- Project sdkconfig file /config/esphome/.esphome/build/battery2/sdkconfig.battery2
-- Configuring incomplete, errors occurred!
See also "/data/battery2/.pioenvs/battery2/CMakeFiles/CMakeOutput.log".

fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
CMake Error at /data/cache/platformio/packages/framework-espidf/tools/cmake/tool_version_check.cmake:36 (message):

  Tool doesn't match supported version from list ['esp-2022r1-11.2.0']:
  /data/cache/platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc

  Please try to run 'idf.py fullclean' to solve it.

Call Stack (most recent call first):
  /data/cache/platformio/packages/framework-espidf/components/esp_common/project_include.cmake:10 (check_expected_tool_version)
  /data/cache/platformio/packages/framework-espidf/tools/cmake/build.cmake:380 (include)
  /data/cache/platformio/packages/framework-espidf/tools/cmake/build.cmake:599 (__build_process_project_includes)
  /data/cache/platformio/packages/framework-espidf/tools/cmake/project.cmake:440 (idf_build_process)
  CMakeLists.txt:3 (project)

========================== [FAILED] Took 3.90 seconds ==========================```

I'm not sure what's going on. If you need more, let me know.
Thanks in advance

Could you provide the hardware and firmware version of the devices? I assume you should pin the protocol version. The build issue is a issue of the ESPHome dashboard/ docker setup. The different build and cache directories are distributed across different filesystems which isn't supported by the build system. You could avoid this issue if you install ESPHome manually on a second (x86) host & compile+flash the device using the command line:
esphome run battery.yaml

Firmware: 2022.12.3 (Jan 4 2023, 18:55:21)
Hardware: 1.3.0
AZDelivery NodeMCU ESP32 S

My question was about the hardware and firmware version of your JK-BMS.

oh sry

It worked for at least 7 Months now.

also i can not get it to reflash...
i have now tryed esphome on windows and linux debian and i still get the same error??
INFO ESPHome 2023.6.5
INFO Reading configuration battery-2.yaml...
INFO Updating https://github.com/syssi/esphome-jk-bms.git@main
WARNING The selected ESP-IDF framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
WARNING The selected ESP-IDF framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
INFO Generating C++ source...
INFO Updating<EMAIL_ADDRESS>INFO Compiling app...
Processing battery2 (board: nodemcu-32s; framework: espidf; platform<EMAIL_ADDRESS>--------------------------------------------------------------------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - framework-espidf @ 3.50001.0 (5.0.1)
 - tool-cmake @ 3.16.4
 - tool-ninja @ 1.7.1
 - toolchain-esp32ulp @ 2.35.0-20220830
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Reading CMake configuration...
-- Building ESP-IDF components for target esp32
Processing 1 dependencies:
[1/1] idf (5.0.1)
-- Project sdkconfig file /home/login/esphome-jk-bms/.esphome/build/battery2/sdkconfig.battery2
-- Configuring incomplete, errors occurred!
See also "/home/login/esphome-jk-bms/.esphome/build/battery2/.pioenvs/battery2/CMakeFiles/CMakeOutput.log".

fatal: Kein Git-Repository (oder irgendeines der Elternverzeichnisse): .git
CMake Error at /home/login/.platformio/packages/framework-espidf/tools/cmake/tool_version_check.cmake:36 (message):

  Tool doesn't match supported version from list ['esp-2022r1-11.2.0']:
  /home/login/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc

  Please try to run 'idf.py fullclean' to solve it.

Call Stack (most recent call first):
  /home/login/.platformio/packages/framework-espidf/components/esp_common/project_include.cmake:10 (check_expected_tool_version)
  /home/login/.platformio/packages/framework-espidf/tools/cmake/build.cmake:380 (include)
  /home/login/.platformio/packages/framework-espidf/tools/cmake/build.cmake:599 (__build_process_project_includes)
  /home/login/.platformio/packages/framework-espidf/tools/cmake/project.cmake:440 (idf_build_process)
  CMakeLists.txt:3 (project)

======================================================== [FAILED] Took 3.60 seconds ========================================================

Could you provide your complete YAML? I guess the IDF platform is pinned to latest. Please use recommended instead or remove the line.

I did change that IDF platform thing and now I could reflash the ESP but still same issue.
Here my YAML:
substitutions:
  name: battery2
  device_description: "Monitor and control a JK-BMS via bluetooth"
  external_components_source: github://syssi/esphome-jk-bms@main
  mac_address: C8:47:8C:E5:5E:BC
  # Defaults to "JK02". Please use "JK04" if you have some old JK-BMS version (f.e. JK-B2A16S hw 3.0, sw. 3.3.0)
  protocol_version: JK02

esphome:
  name: ${name}
  comment: ${device_description}
  project:
    name: "syssi.esphome-jk-bms"
    version: 1.3.0

esp32:
  board: nodemcu-32s
  framework:
#  The arduino platform crashs
#    type: arduino
#    version: latest
    type: esp-idf
    version: recommended

external_components:
  - source: ${external_components_source}
    refresh: 0s

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

ota:
logger:

# If you don't use Home Assistant please remove this `api` section and uncomment the `mqtt` component!
api:

# The MQTT component is ESP-IDF compatible since ESPHome version 2022.4.0. If
# ESPHome suggests to use the arduino framework instead because of missing ESP-IDF
# framework support you should update your setup.
# mqtt:
#   broker: !secret mqtt_host
#   username: !secret mqtt_username
#   password: !secret mqtt_password
#   id: mqtt_client

esp32_ble_tracker:

ble_client:
  - mac_address: ${mac_address}
    id: client0

jk_bms_ble:
  - ble_client_id: client0
    protocol_version: ${protocol_version}
    throttle: 5s
    id: bms0

binary_sensor:
  - platform: jk_bms_ble
    balancing:
      name: "${name} balancing"
    charging:
      name: "${name} charging"
    discharging:
      name: "${name} discharging"

button:
  - platform: jk_bms_ble
    retrieve_settings:
      name: "${name} retrieve settings"
    retrieve_device_info:
      name: "${name} retrieve device info"

number:
  - platform: jk_bms_ble
    jk_bms_ble_id: bms0
    balance_trigger_voltage:
      name: "${name} balance trigger voltage"
    cell_count:
      name: "${name} cell count"
    total_battery_capacity:
      name: "${name} total battery capacity"
    cell_voltage_overvoltage_protection:
      name: "${name} cell voltage overvoltage protection"
    cell_voltage_overvoltage_recovery:
      name: "${name} cell voltage overvoltage recovery"
    cell_voltage_undervoltage_protection:
      name: "${name} cell voltage undervoltage protection"
    cell_voltage_undervoltage_recovery:
      name: "${name} cell voltage undervoltage recovery"
    balance_starting_voltage:
      name: "${name} balance starting voltage"
    voltage_calibration:
      name: "${name} voltage calibration"
    current_calibration:
      name: "${name} current calibration"
    power_off_voltage:
      name: "${name} power off voltage"
    max_balance_current:
      name: "${name} max balance current"
    max_charge_current:
      name: "${name} max charge current"
    max_discharge_current:
      name: "${name} max discharge current"

sensor:
  - platform: jk_bms_ble
    jk_bms_ble_id: bms0
    min_cell_voltage:
      name: "${name} min cell voltage"
    max_cell_voltage:
      name: "${name} max cell voltage"
    min_voltage_cell:
      name: "${name} min voltage cell"
    max_voltage_cell:
      name: "${name} max voltage cell"
    delta_cell_voltage:
      name: "${name} delta cell voltage"
    average_cell_voltage:
      name: "${name} average cell voltage"
    cell_voltage_1:
      name: "${name} cell voltage 1"
    cell_voltage_2:
      name: "${name} cell voltage 2"
    cell_voltage_3:
      name: "${name} cell voltage 3"
    cell_voltage_4:
      name: "${name} cell voltage 4"
    cell_voltage_5:
      name: "${name} cell voltage 5"
    cell_voltage_6:
      name: "${name} cell voltage 6"
    cell_voltage_7:
      name: "${name} cell voltage 7"
    cell_voltage_8:
      name: "${name} cell voltage 8"
    cell_resistance_1:
      name: "${name} cell resistance 1"
    cell_resistance_2:
      name: "${name} cell resistance 2"
    cell_resistance_3:
      name: "${name} cell resistance 3"
    cell_resistance_4:
      name: "${name} cell resistance 4"
    cell_resistance_5:
      name: "${name} cell resistance 5"
    cell_resistance_6:
      name: "${name} cell resistance 6"
    cell_resistance_7:
      name: "${name} cell resistance 7"
    cell_resistance_8:
      name: "${name} cell resistance 8"
    total_voltage:
      name: "${name} total voltage"
    current:
      name: "${name} current"
    power:
      name: "${name} power"
    charging_power:
      name: "${name} charging power"
    discharging_power:
      name: "${name} discharging power"
    temperature_sensor_1:
      name: "${name} temperature sensor 1"
    temperature_sensor_2:
      name: "${name} temperature sensor 2"
    power_tube_temperature:
      name: "${name} power tube temperature"
    state_of_charge:
      name: "${name} state of charge"
    capacity_remaining:
      name: "${name} capacity remaining"
    total_battery_capacity_setting:
      name: "${name} total battery capacity setting"
    charging_cycles:
      name: "${name} charging cycles"
    total_charging_cycle_capacity:
      name: "${name} total charging cycle capacity"
    total_runtime:
      name: "${name} total runtime"
    balancing_current:
      name: "${name} balancing current"
    errors_bitmask:
      name: "${name} errors bitmask"

switch:
  - platform: jk_bms_ble
    charging:
      name: "${name} charging"
    discharging:
      name: "${name} discharging"
    balancer:
      name: "${name} balancer"

  - platform: ble_client
    ble_client_id: client0
    name: "${name} enable bluetooth connection"

  - platform: gpio
    name: "Battery_2 Fan"
    pin: 16
    inverted: False
    restore_mode: RESTORE_DEFAULT_OFF

text_sensor:
  - platform: jk_bms_ble
    errors:
      name: "${name} errors"
    total_runtime_formatted:
      name: "${name} total runtime formatted"

Please change this setting:
# from
substitutions:
  protocol_version: JK02

# to
substitutions:
  protocol_version: JK02_32S

And reflash your ESP again. This should fix the issue!

Thanks, that fixed the issue. But I'm not sure why it randomly stopped working?

I tried to auto-detect the protocol version but the mechanism doesn't work reliable. I will remove the auto-detection soon.


Re-adding the test suite for checking constant propagation phase

This commit enables some parts of the test suite diagnostic_constant_propagation.swift. It enables all test cases that pass under the latest swift implementation. It also has some false negatives, which should ideally be reported as an error but currently  pass the diagnostics phase. The commit also separate tests that have diverging behavior in Swift 3 and Swift 4.

@swift-ci Please smoke test

Some other, super nit-picky drive by style nits:
We try to use the imperative mood for commit message titles and we often prefix commit messages with the affected subsystem. So, for example, for your commit message we would idiomatically write: "[Tests] Re-add the test suite for checking constant propagation phase" This way someone scanning commit messages to try to understand a regression will know based on the prefix whether they need to dig into your commit or can skip it and move on.
We also try to include necessary background for understanding the motivation for a commit in the commit message. I would suggest adding an explanation of the reason the tests were disabled and and a description of why we have the false negatives in the commit message. This will help future maintainers understand why some but not all of the tests were re-enabled.

@moiseev Hi max, does it look good to you and should I merge it.

@ravikandhadai yeah. I gave a 👍 on your comment above expressing agreement =)

@swift-ci Please smoke test and merge

@swift-ci Please smoke test and merge

@swift-ci Please smoke test and merge


add violations count on cli output (#224)

Codecov Report

Merging #235 (ecc87d2) into main (680b43d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##               main     #235   +/-   ##
=========================================
  Coverage     92.98%   92.98%
  Complexity      314      314
=========================================
  Files            52       52
  Lines           812      813    +1
=========================================
+ Hits            755      756    +1
  Misses           57       57

Impacted Files
Coverage Δ

src/CLI/Check.php
84.50% <100.00%> (+0.22%)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 680b43d...ecc87d2. Read the comment docs.

Why the PR is in draft status? What does it miss @ricfio?

Why the PR is in draft status? What does it miss @ricfio?

Because I have a pending question about the row 146 in src/CLI/Check.php.
Can you see my related comment on the 'Files changed' page?

In truth it is not a comment... I'm not sure this is the right way...
I have added a 'code review' request for my self?

@ricfio I can't see your comment, but in my opinion, you can try to write the feature, and after we can discuss it together :)

Ok, I have removed the last commit on this branch.
The new PR is here: https://github.com/phparkitect/arkitect/pull/237


[Enhancement] Added EnumToObjectConverter

Description of Change

A converter that allows you to convert and Enum to value binding to a specific object.
Bugs Fixed

Fixes #1450

API Changes

Behavioral Changes

PR Checklist

[ ] Has a linked Issue, and the Issue has been approved
[ ] Has tests (if omitted, state reason in description)
[x] Has samples (if omitted, state reason in description)
[ ] Rebased on top of main at time of PR
[ ] Changes adhere to coding standard

[ ] Updated documentation

Thanks! However, we are no longer adding new features to Xamarin Community Toolkit, focusing on the .NET MAUI Community Toolkit.
Please open a New Feature Discussion to implement this feature in the .NET MAUI Community Toolkit.
I've posted more information about the Future Of Xamarin Community Toolkit here: https://devblogs.microsoft.com/xamarin/the-future-of-xamarin-community-toolkit/?WT.mc_id=mobile-0000-bramin


Document navigation

The user guide doc structure isn't as the table of contents suggests. Rather than restructure the doc I've added links back to the table of contents at the end of each section. I'll restructure it in the future if any significant additions are made.

+1


Please publish

this is broken...  Please give me access to publish

0.0.6  was published 24 days ago https://www.npmjs.com/package/ep_webrtc to work with the current release. can also give you access to publish, how does that work?

I think you just npm owner add johnyma22 ep_webrtc
https://docs.npmjs.com/cli/owner

ok done


chore: should clog write to stdout?

Currently, clog creates a markdown file by default. As discussed in https://github.com/thoughtram/clog/issues/57, I think it'd make sense if writers could be swapped out.
This raises my next question: Unix commands usually write to stdout by default. If we implement a writer abstraction, so we can plug more into clog, we shouldn't prefer one over the other. Which brings me to the point, that it might be better if clog writes to stdout by default.
Of course, this adds the complexity that you always have to provide a writer option in case you don't want to write to stdout, but this is how most/all UNIX commands work.
Thoughts on this?

I'm actually a big fan of this as it follows the unix standard, and upon seeing everything output to the screen, most users will simply
$ clog [options] > changelog.md

What's TBD though is should clog automatically detect previous changelogs? Only if specified in a .clog.toml? Speaking of the .clog.toml that also makes even easier, as you can already specify a file. So if this option is present in the .clog.toml use it, if not, print to stdout.

What's TBD though is should clog automatically detect previous changelogs?

Is that needed when clogs simply always prepends?

Speaking of the .clog.toml that also makes even easier, as you can already specify a file. So if this option is present in the .clog.toml use it, if not, print to stdout.

Right, I think .clog.toml is the first place to check. Then provided options. Then defaults.

Is that needed when clogs simply always prepends?

I agree, if the path given (via > changelog.md, or in .clog.toml) points to an already existing file, then it's going to prepend anyway. Otherwise, it's going to create a file. I don't think clog needs to automatically detect changelogs if the default output will be to stdout.

I agree. I'd propose the following:

If the user does a clog -o changelog.md and that file exists, prepend and output to the file
If the user does a clog -o changelog.md and the file doesn't exist, create it and output to a file
If the user has the output file set in the .clog.toml check for existance, prepend if needed unless there is a -o which overrides the .clog.toml
If there is no output file specified in the .clog.toml and no -o option, output to stdout

This is actually how clog already functions, minus number 4 which is an easy addition. But should be talked about with #55
Unfortunately, we can't check if clog > mychangelog.md exists because the > mychangelog.md is interpreted by the shell, not clog.

Unfortunately, we can't check if clog > mychangelog.md exists because the > mychangelog.md is interpreted by the shell, not clog.

Yes sorry, my bad. Obviously if the user uses > then they know they are taking the entire output of clog and overwriting whatever might already exist in mychangelog.md. But yes, :+1: to what you propose.

@kbknapp

Unfortunately, we can't check if clog > mychangelog.md exists because the > mychangelog.md is interpreted by the shell, not clog.

How do other UNIX command handle that case? git log > logs also creates a file logs if it doesn't exist. ... Ah but it doesn't prepend if it exists...

Maybe we should just assume that the user knows how to use > and >> operators?

Maybe we should just assume that the user knows how to use > and >> operators?

That's what I'd recommend :+1:  (and hope they don't try &> :P )

@kbknapp this can easily be part of the developer guide documentation.

Maybe we should just assume that the user knows how to use > and >> operators?

Well yes, see my previous comment. As @kbknapp says, you can't do anything otherwise because > is a shell construct.
If you want to prepend, best use something like:
$ clog > mychangelog.md | cat - mychangelog.md > /tmp/temp && mv /tmp/temp mychangelog.md

Of course, you should just use -o for clog, but for other things you can use that provided you don't have anything important in /tmp/temp.

We also shouldn't forget that this would be a breaking change and bumps the version to 1.0.0. I think this is a great opportunity to land this together with the new website, which makes the announcement even nicer :)


wrong status of unresponsive outlets

I do have a number of outlets in use and some of them are not always active. Although I do let update() return false, it briefly reports in homekit "not reachable" but switches back then as like they are online - what could that be?
Rgrds,
Thomas

update() should never return false unless there is a hardware error.  For example if you have code to operate a relay and you can also detect that the relay is broken, you can return false if the user tries to operate the relay from the Home App.  But in almost all cases it should return true.  If you return false the Home App will report a problem.

Behavior is uncertain in Home App when update returns a false.  Also, what do you mean that the outlet is not powered?  Do you mean the ESP32 has power but AC power is not available for the outlet itself?  To represent that state you may want to try using the OutletInUse Characteristic (it's not exactly on point, but may serve the purpose).


Create valgrind test

Make sure the extension isn't leaking memory

https://pypi.org/project/pytest-valgrind/


Offer users a build and watch task

Initially implemented in Gulp.

Build task is done but no watch task yet, moving to next release.

Closing due to watch task not currently being needed, once there's a compile step then one will be required.

Reopening as this is now required with the amended project setup.

Implemented in 0.2.0


Fix slow block execution

After one of the recent change performance was degraded from 30-60ms block execution time using WAVM wasm engine to 150-300ms. Need to localize the issue and resolve it

Short investigation shows that ext_crypto_sr25519_verify_version_1 host api invocation itself in sum takes 100 - 150 ms of block execution time.


best way to construct bower dependencies graph

Hello guys,
I was going through the source code, trying to understand what's the most efficient way to construct all dependencies graph for the bower registry.
The only solution I've found so far is to download all dependencies from https://bower-component-list.herokuapp.com/ and then for each dependency go to repository and try to find bower.json file.
Is there any faster way of getting dependencies?
Thank you!

I ended up crawling bower.json for each found module: https://github.com/anvaka/allbower/blob/master/lib/getAllPackages.js

Yes, currently it's the only way


Support DotFeatures in neural networks

Currently neural nets require DenseFeatures input which restricts its usage a bit.
There is a good idea by @sonney2k (see COFFIN paper) that most of the things depend on dot product of feature vector with some weight vector. This enables magic training on out-of-core data like local or remote files and even data generated on the fly. This task proposes to use input of CDotFeatures instead of CDenseFeatures as a general idea, but concrete suggestions are welcome!
Good for Deep learning applicants

@lisitsyn From what I understand, CDenseFeatures have to be replaced by CDotFeatures as neural nets training involves lots of dot products. Tell me if I'm wrong.
I know what Sparse (most zero entries) and Dense (most non-zero entries) matrices are. Are CSparseFeatures and CDenseFeatures also derived from the same logic? Then there are SGSparseVectors in shogun as well.
I didn't get the "magic training" part. Please elaborate, how training will be easy for out-of-core data (external memory, data not stored in RAM) etc. if we use CDotFeatures?
I saw the COFFIN paper is on Linear SVMs. Is there any particular section that I need to focus on? I'll read it tomorrow.

@sanuj

Yes, CDenseFeatures -> CDotFeatures
Yes, both dense and sparse features are examples of dot features
Dense features have to be in-memory but DotFeatures can be anything. As access is usually sequential it could be file or some resource accessed through network

@lisitsyn I see. Basically CDenseFeatures are matrices of all the features (as columns) so if we make a CDenseFeature then all the features are loaded at once in the matrix. I don't know how CDotFeatures are stored. Seems quite an abstract class to me. Also there are no unit tests for CDotFeatures from where I can get the idea of how to use them.
If I'm not wrong, the idea is if we use CDotFeatures, then all the features which are child classes of CDotFeatures can be supplied to the neural nets. (Right?)
I think following classes would be changed (CDenseFeatures -> CDotFeatures):
CNeuralNetwork CDeepBeliefNetwork CRBM CAutoencoder CDeepAutoencoder
and also the unit-tests related to the above.
Your views?

@lisitsyn sergey?

@sanuj sorry.
CDotFeatures is abstract class for sure. Inheriting from it means that these features can compute dot product with some arbitrary vector. It doesn't restrict any internal structure of data, anything like that. I have some not-yet-merged thing in PR #2788 so I am unsure how to proceed.

@lisitsyn I see. Then we can have a look at this later. I'll start working on something else ;)


Add option to build-script to skip running lit-based tests

Useful if you’re only interested in the result of the XCTests.

@swift-ci Please test


bserver_remote: add pings and disconnect on timeouts

Also add timeout disconnects for mdserver as well, factoring out a bit of common code.
Since bserver actually has two connections, this required a bit of refactoring of bserver connection handling as well.
This helps the case where a (Linux?) device loses its network (e.g., due to a suspend).  Normally it would take a long time (15-20 mins) for the TCP connections to figure out that they need to reconnect.  This brings that down to ~40s.
One downside is that connection.go now spams the log every 2 seconds while the device is offline, and before it wouldn't do that until the TCP connection noticed the disconnect.  We might want to suppress some of that logging in a future PR.
Issue: KBFS-1982

Rebased and ready for review again.

Rebased again, ready for review.


Add power connections for flash_clkrst_buffers

This is the gatelevel, you can't change that. @mo-hosni please fix


PriorityBasedExecution: Adds PriorityLevel in CosmosClientOptions

Description
Adding PriorityLevel to CosmosClientOptions to allow users to set PriorityLevel at the client level
Type of change

[] New feature (non-breaking change which adds functionality)
[] This change requires a documentation update

/cc: @kundadebdatta ideal if we can also get this PR for 3.38 release.


Floating button - possible to show font-icon instead of image?

hi @msaelices @NathanWalker

Android
emulator

I am using
nativescript-material-floatingactionbutton v3.2.19
floating button works but is there any support for font-icon in src?
in the documentation its mentioned that, it supports only image as icon.
MDFloatingActionButton
(tap)="fabTap()"
text=""
rippleColor="#f1f1f1"
class="fas fab-button"
>
.fab-button {
height: 40;
width: 40;
margin: 15;
color: #fff !important;
background-color: coral;
font-size: 9;
horizontal-align: right;
vertical-align: bottom;
}
.fas {
font-family: 'fa-solid-900';
font-weight: 900;
}

Same for the bottom navigation, I want to use a font icon for the icons but you can't, if you use it as the text you get the issue that you can't set the class on the component.

@aaitken80 @svmashok not supported yet.
The way i do it is to use as MDButton as a floatingbutton
You can see an example here https://github.com/nativescript-community/ui-material-components/blob/master/demo-vue/app/examples/Buttons.vue#L43
I will need to add this. Sorry i did not do it as i would never use it as it is "slow" (creating a image to apply).
But i will think about it, PR are welcom if you want to have a look at it

@aaitken80 @svmashok,
You can try to add a font-icon to the tab from the ts file.
  this.homeTab.icon = ImageSource.fromFontIconCodeSync("\uf015", new Font("Font-Awesome", 48, FontStyle.NORMAL, FontWeight.NORMAL), new Color("white"));     this.homeTab.title = this.homeTitle;

I'm successfully using it with fontawesome and https://github.com/Akylas/nativescript-fonticon
<MDFloatingActionButton class="fa floating-action-button"
         :text="'fa-arrow-right' | fonticon"
         rippleColor="#C81F41"
         @tap="goToSelectPlayers"
 />

Just can't change the font-color. Apart from that it seems to be working.

@MrSnoozles can you show an example with color? and does it not work on both platforms?

@farfromrefug I changed MDFloatingActionButton to MDButton because the font color works with MDButton.
Color didn't work on both platforms with MDFloatingActionButton. I tried setting the color both via XML and via CSS.

@MrSnoozles Thanks but would be nice to share some code for me to be able to fix it for floating action button

Ah sorry, misunderstood somehow.
Here's the file in an example repository: https://github.com/MrSnoozles/nsc-fab-color-bug/blob/master/app/components/Home.vue#L25
The color is set to red but the font icon still appears in white (tested on Android with this repository, tested on both platforms in another repository)
It was no problem however solving it using MDButton.

I think it's a problem with Theme.MaterialComponents since it also affected another FloatingActionButton plugin I was using before coming here.
@MrSnoozles thanks for the hint to use MDButton instead.
What is even the difference between MDFloatingActionButton and MDButton other than border-radius: 50% on the former?

I think it's a problem with Theme.MaterialComponents since it also affected another FloatingActionButton plugin I was using before coming here.
@MrSnoozles thanks for the hint to use MDButton instead.
What is even the difference between MDFloatingActionButton and MDButton other than border-radius: 50% on the former?

@ray007 for us mostly the fact that floating button can be extended

@ray007 for us mostly the fact that floating button can be extended

Using an MDButton as floating action button with font-icon works fine with border-radius: 50% on Android, but not on iOS.

@ray007 what does that mean ? please when you report an issue give details.

It was a very weird render, but I think I just fixed it by changing the border-radius from 50% to the correct pixel-value.