text:
property export

while working on #6 i found some problems with the export submodule as adding new properties isn't as straightforward as it seems.
the attempted properties under util.py
    @property
    def red_dec(self):
        """Red value as decimal."""
        return "%s" % hex_to_rgb(self.hex_color)[0]

    @property
    def green_dec(self):
        """Green value as decimal."""
        return "%s" % hex_to_rgb(self.hex_color)[1]

    @property
    def blue_dec(self):
        """Blue value as decimal."""
        return "%s" % hex_to_rgb(self.hex_color)[2]

trying to use these on a template results in a pywal error:
 File "/home/ed/.local/lib/python3.10/site-packages/pywal/export.py", line 27, in template
    new_color = util.Color(colors[cname].hex_color)
AttributeError: 'str' object has no attribute 'hex_color'

this clearly shows that there is a problem in the template exporting code as it is necesary to to specify lenght of the format string "%3s" to make the colors export, the lenght of the string should not matter at all and the end result padding with spaces may not be desirable.
there clearly was a problem with that part of the code as evidenced by a2ddff38fdd16f6e16e7be82a433ed022a3c8a8b , in order to continue the development of this fork the important functions such as the template function of the export submodule should be clear on what they do, for that reason i'm asking @AmitPr and @loiccoyle if they can chime in to help with the debugging the problem so that we can iron out these kinks.

I had a quick look and I think you're running into an issue where the export.template function is modifying the colors dictionary these changes compound the more templates get rendered, leading to entries in colors which are strings which collide with entries which should be instances of utils.Color. An easy way to see this is to add some print statements.
diff --git a/pywal/export.py b/pywal/export.py
index 061c151..aabc231 100644
--- a/pywal/export.py
+++ b/pywal/export.py
@@ -14,6 +14,10 @@ def template(colors, input_file, output_file=None):
        save the file elsewhere."""
     # pylint: disable-msg=too-many-locals
     template_data = util.read_file_raw(input_file)
+    print(input_file)
+    for key, value in colors.items():
+        print(repr(key), repr(value))
     for i, l in enumerate(template_data):
         for match in re.finditer(r"(?<=(?<!\{))(\{([^{}]+)\})(?=(?!\}))", l):
             # Get the color, and the functions associated with it

You'll see that as templates get rendered more and more garbage gets added into the colors dict which collide at some point leading to what you observe. This is a consequence of the jankiness with which this was implemented in pywal.
The correct solution is to redo the templating with a more robust solution.
A bandaid fix is to work on a copy of the colors dictionary,
diff --git a/pywal/export.py b/pywal/export.py
index 061c151..aabc231 100644
--- a/pywal/export.py
+++ b/pywal/export.py
@@ -14,6 +14,10 @@ def template(colors, input_file, output_file=None):
        save the file elsewhere."""
     # pylint: disable-msg=too-many-locals
     template_data = util.read_file_raw(input_file)
+    colors = colors.copy()
     for i, l in enumerate(template_data):
         for match in re.finditer(r"(?<=(?<!\{))(\{([^{}]+)\})(?=(?!\}))", l):
             # Get the color, and the functions associated with it

thanks for your input, i will test and add the bandaid for the current goal release, i would appreciate to have your input and/or collaboration to create a more robust solution for a future release.

Sure feel free to ping me whenever.

hmmm even with the change of using a copy of the colors dict the problem persists when the length of the string is not specified, oh well still will add the commit to the release in hopes this helps with any possible problem that may happen with user templates.

can you give me an example template which doesn't work ?

i'm using this template for testing of the properties i added recently.
# Special
background='{background}'
foreground='{foreground}'
cursor='{cursor}'

# colors
 color0='{color0}'
 color1='{color1}'
 color2='{color2}'
 color3='{color3}'
 color4='{color4}'
 color5='{color5}'
 color6='{color6}'
 color7='{color7}'
 color8='{color8}'
 color9='{color9}'
color10='{color10}'
color11='{color11}'
color12='{color12}'
color13='{color13}'
color14='{color14}'
color15='{color15}'

# colors rgbspce
 color0='{color0.rgbspace}'
 color1='{color1.rgbspace}'
 color2='{color2.rgbspace}'
 color3='{color3.rgbspace}'
 color4='{color4.rgbspace}'
 color5='{color5.rgbspace}'
 color6='{color6.rgbspace}'
 color7='{color7.rgbspace}'
 color8='{color8.rgbspace}'
 color9='{color9.rgbspace}'
color10='{color10.rgbspace}'
color11='{color11.rgbspace}'
color12='{color12.rgbspace}'
color13='{color13.rgbspace}'
color14='{color14.rgbspace}'
color15='{color15.rgbspace}'

# Colors float
 color0='{color0.red} {color0.green} {color0.blue}'
 color1='{color1.red} {color1.green} {color1.blue}'
 color2='{color2.red} {color2.green} {color2.blue}'
 color3='{color3.red} {color3.green} {color3.blue}'
 color4='{color4.red} {color4.green} {color4.blue}'
 color5='{color5.red} {color5.green} {color5.blue}'
 color6='{color6.red} {color6.green} {color6.blue}'
 color7='{color7.red} {color7.green} {color7.blue}'
 color8='{color8.red} {color8.green} {color8.blue}'
 color9='{color9.red} {color9.green} {color9.blue}'
color10='{color10.red} {color10.green} {color10.blue}'
color11='{color11.red} {color11.green} {color11.blue}'
color12='{color12.red} {color12.green} {color12.blue}'
color13='{color13.red} {color13.green} {color13.blue}'
color14='{color14.red} {color14.green} {color14.blue}'
color15='{color15.red} {color15.green} {color15.blue}'

# Colors hex
 color0='{color0.red_hex} {color0.green_hex} {color0.blue_hex}'
 color1='{color1.red_hex} {color1.green_hex} {color1.blue_hex}'
 color2='{color2.red_hex} {color2.green_hex} {color2.blue_hex}'
 color3='{color3.red_hex} {color3.green_hex} {color3.blue_hex}'
 color4='{color4.red_hex} {color4.green_hex} {color4.blue_hex}'
 color5='{color5.red_hex} {color5.green_hex} {color5.blue_hex}'
 color6='{color6.red_hex} {color6.green_hex} {color6.blue_hex}'
 color7='{color7.red_hex} {color7.green_hex} {color7.blue_hex}'
 color8='{color8.red_hex} {color8.green_hex} {color8.blue_hex}'
 color9='{color9.red_hex} {color9.green_hex} {color9.blue_hex}'
color10='{color10.red_hex} {color10.green_hex} {color10.blue_hex}'
color11='{color11.red_hex} {color11.green_hex} {color11.blue_hex}'
color12='{color12.red_hex} {color12.green_hex} {color12.blue_hex}'
color13='{color13.red_hex} {color13.green_hex} {color13.blue_hex}'
color14='{color14.red_hex} {color14.green_hex} {color14.blue_hex}'
color15='{color15.red_hex} {color15.green_hex} {color15.blue_hex}'

# Colors dec
 color0='{color0.red_dec} {color0.green_dec} {color0.blue_dec}'
 color1='{color1.red_dec} {color1.green_dec} {color1.blue_dec}'
 color2='{color2.red_dec} {color2.green_dec} {color2.blue_dec}'
 color3='{color3.red_dec} {color3.green_dec} {color3.blue_dec}'
 color4='{color4.red_dec} {color4.green_dec} {color4.blue_dec}'
 color5='{color5.red_dec} {color5.green_dec} {color5.blue_dec}'
 color6='{color6.red_dec} {color6.green_dec} {color6.blue_dec}'
 color7='{color7.red_dec} {color7.green_dec} {color7.blue_dec}'
 color8='{color8.red_dec} {color8.green_dec} {color8.blue_dec}'
 color9='{color9.red_dec} {color9.green_dec} {color9.blue_dec}'
color10='{color10.red_dec} {color10.green_dec} {color10.blue_dec}'
color11='{color11.red_dec} {color11.green_dec} {color11.blue_dec}'
color12='{color12.red_dec} {color12.green_dec} {color12.blue_dec}'
color13='{color13.red_dec} {color13.green_dec} {color13.blue_dec}'
color14='{color14.red_dec} {color14.green_dec} {color14.blue_dec}'
color15='{color15.red_dec} {color15.green_dec} {color15.blue_dec}'

as for pywal i'm using the latest commit form master of this repo with the added line to copy the color dict, when i test changing the definitions of the property red_dec the error appears again but now points to line 69
Traceback (most recent call last):
  File "/home/ed/.local/bin/wal", line 8, in <module>
    sys.exit(main())
  File "/home/ed/.local/lib/python3.10/site-packages/pywal/__main__.py", line 234, in main
    parse_args(parser)
  File "/home/ed/.local/lib/python3.10/site-packages/pywal/__main__.py", line 211, in parse_args
    export.every(colors_plain)
  File "/home/ed/.local/lib/python3.10/site-packages/pywal/export.py", line 129, in every
    template(colors, file.path, join(output_dir, file.name))
  File "/home/ed/.local/lib/python3.10/site-packages/pywal/export.py", line 69, in template
    template_data = "".join(template_data).format(**colors)
TypeError: str.format() argument after ** must be a mapping, not builtin_function_or_method

    @property
    def red_dec(self):
        """Red value as decimal."""
-        return "%3s" % hex_to_rgb(self.hex_color)[0]
+        return "%s" % hex_to_rgb(self.hex_color)[0]

I suspect its a variant of what I described, I'll take a look shortly.

Thanks, I was able to reproduce the issue.
Yeah it's related to the issue above, this seems to fix it but I haven't tested it properly so please run your own tests.
Note that the copy is no longer needed as now the colors dict is not changed in the export.template method.
diff --git a/pywal/export.py b/pywal/export.py
index 061c151..5ba35a3 100644
--- a/pywal/export.py
+++ b/pywal/export.py
@@ -55,15 +55,10 @@ def template(colors, input_file, output_file=None):

             if isinstance(new_color, util.Color):
                 new_color = new_color.strip
-            # If the color was changed, replace with a unique identifier.
+            # If replace the format placeholder with the new color
             if new_color is not colors[cname]:
                 new_color = str(new_color)
-                new_color_clean = (new_color.replace('[', '_')
-                                            .replace(']', '_')
-                                            .replace('.', '_'))
-                template_data[i] = l.replace(replace_str,
-                                             "color" + new_color_clean)
-                colors["color" + new_color_clean] = new_color
+                template_data[i] = l.replace("{" + replace_str + "}", new_color)
     try:
         template_data = "".join(template_data).format(**colors)
     except (ValueError, KeyError, AttributeError) as exc:
diff --git a/pywal/util.py b/pywal/util.py
index f949355..81d3b1d 100644
--- a/pywal/util.py
+++ b/pywal/util.py
@@ -122,17 +122,17 @@ class Color:
     @property
     def red_dec(self):
         """Red value as decimal."""
-        return "%3s" % hex_to_rgb(self.hex_color)[0]
+        return "%s" % hex_to_rgb(self.hex_color)[0]

     @property
     def green_dec(self):
         """Green value as decimal."""
-        return "%3s" % hex_to_rgb(self.hex_color)[1]
+        return "%s" % hex_to_rgb(self.hex_color)[1]

     @property
     def blue_dec(self):
         """Blue value as decimal."""
-        return "%3s" % hex_to_rgb(self.hex_color)[2]
+        return "%s" % hex_to_rgb(self.hex_color)[2]

     def lighten(self, percent):
         """Lighten color by percent."""

authors: eylles loiccoyle


text:
被chrome标记为诈骗网站

今天用chrome打开网站发现居然标记为危险欺诈提示

域名下的其他二级域名都正常。

source: gharchive/issue

repo: eysp/portainer-ce

license: Zlib

license_type: permissive

license_source: github-api


text:
Gestures? Crown?

Have you tried using other gestures for moving forward or back? Like Swiping the full screen instead of the buttons? Or turning the crown up/down to move between slides?
Not sure if the raise to wake has an API also but that would make for a nice interaction.
Anyways, my two cents :)
Best,
Sidney

@funky-monkey Thanks for your comment!
I Think this is great ideas, and in my spare time I will try to implement this :)

@funky-monkey Added digital crown support in #2. Gestures can't be done easy. Will need to look deeper in it. Also added Shake support.

authors: Eliottiosdevs ezefranca funky-monkey

repo: ezefranca/WatchNote


text:
forestry compatibility

Is it possible to have bee hives spawn normally? forge events yes don't seem to matter
Also forestry green house make world gen crashing only in combination with ezwasteland, if I turn normal worldgen on everything generate normally, when I turn ezwasteland on world gen crashes and hang my computer. Could it be an issue on their side?
Thank you for your time.

Regarding hives I'm not sure how forestry spawns then, I assume it's looking for specific conditions and not finding them.  (Since there is no dirt, grass, Stone, tree, or logs in the world)
I'd recommend using recurrent complex or other structure mod to define some (admittedly very small) structures to spawn the hives you want at the frequency you want. Its possible something else would be possible but obviously the alternative spawn conditions would need to be considered.
The greenhouse however I'll need to check the log to be sure but you didn't find a bug on my side but the wastelands ought not cause the crash, regardless send a crash log and I'll look into it more.

Thank for the reply, I will look into cohf-world to spawn the hives, as for the log i'll send it asap.

authors: Ganjalf-Amsterdoom ezterry

repo: ezterry/ezwasteland


text:
[RFE] ATC CF support

support API flows for cloud-failover

implemented with last couple of versions


text:
Fix semantics of JSONUnkeyedDecodingContainer

The following behaviors are now handled correctly:

It is no longer possible for self.count or self.isAtEnd to accidentally get out of sync with reality, they are now computed.
Bounds are now correctly checked and a more useful DecodingError thrown (may have performance implications; removing this check is not strictly against protocol if so).
Decoding no longer incorrectly increments the current index if the decode fails for any reason.
decodeNil() no longer incorrectly increments the current index if the result is not nil.

If anything I've done affects performance significantly please let me know so I can undo it.

@gwynne Thanks so much, from what I’ve skimmed this looks awesome. I’m on vacation right now, but I’ll have a thorough look on Sunday.

Thanks @gwynne and @calebkleveter!

source: gharchive/pull-request

authors: fabianfett gwynne

repo: fabianfett/pure-swift-json


text:
Change Xamarin link to English Wikipedia

Change Xamarin link from Italian to English Wikipedia

Thanks, I have also searched for any other it.wiki* link: there isn't any other non-english link. For now.

repo: fabianoriccardi/killed-by-microsoft

license: MIT


text:
[Master] Error: No running instance found

Hi,
I've successfully set up Scrapoxy on AWS EC2 following the instructions from the Quick Start guide. Scrapoxy successfully creates the necessary instances and I'm also able to access the GUI on port 8889. However this is what I see there:

So, the instance gets created but it's not available. The cloud icon is red. Also, when I try to test the Scrapoxy like this:
curl --proxy http://{AWS INSTANCE PUBLIC ADDRESS}:8888 http://api.ipify.org
I'm getting this error:
[Master] Error: No running instance found
I've set it up for the region Ohio but copied the AMI as suggested. Also created the security group and set up the rule for 3128 port.
Any ideas what I'm doing wrong?
Thanks,
Edgar.

Hi,
I got this running on "eu-west-1". I used to copy the AMI from "eu-west-1" to "us-east-2" but then was being told that the configuration was not supported any more. Probably because that proxy instance was on t1.micro. Anyway, I've installed this on "eu-west-1" and it works fine.
Thanks!

I cannot get this fixed in any region on any instance.
Test returns:
[Test] Error: Cannot get IP address: 407: [Master] Error: No running instance found

I have tried all regions and AMIs, it appears the ping server will time out which suggests there is no way for commander to ping the server.

@aaronfranco Open the inbound connections for the ports 8888 and 8889 for the instance you installed Scrapoxy on. The connection should be open with type "Anywhere".

The proxy is installed on my localhost, not AWS. The EC2 instances are launched from my local machine.

{
    "commander": {
        "password": "xxxxxxxxxx"
    },
    "instance": {
        "port": 3128,
        "scaling": {
            "min": 1,
            "max": 1
        }
    },
    "providers": [
        {
            "type": "awsec2",
            "accessKeyId": "xxxxxxxxxxxxxxxx",
            "secretAccessKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "region": "eu-west-1",
            "instance": {
                "InstanceType": "t2.micro",
                "ImageId": "ami-485fbba5",
                "SecurityGroups": [
                    "forward-proxy"
                ]
            }
        }
    ]
}

@aaronfranco Try with these instead:
"InstanceType": "t1.micro",
"ImageId": "ami-c74d0db4"

same issue exists on all AMIs in any region I launch in.. I created a new issue for this. I think it is related to the fact that I am not using Docker.

authors: aaronfranco edgarmkrtchyan

repo: fabienvauchelles/scrapoxy

license: mit

license_source: bigquery


text:
source ~/.linuxify

For everything to work correctly, the script adds source ~/.linuxify to ~/.bashrc. But this assumes:

that the user is using bash
that ~/.bashrc does not use commands that will only work after the $PATH has been patched (e.g.  export MAKEFLAGS="-j$(nproc)" will fail if declared before source ~/.linuxify because nproc is not yet in the $PATH)

Should the script continue to try to add source ~/.linuxify to ~/.bashrc.  like this or should the users be responsible for handling this stitching themselves?

I think appending something to users' profile is kind of unwanted.
If user is competent enough to run this script, they're competent enough to add it to their profile accordingly

Plenty of things append an install with instructions to "add  to your ~/.bashrc or equivalent". Even if it supported my shell (zsh), automatically appending would be annoying because I structure my dotfiles in a particular way, etc.

automatically appending would be annoying because I structure my dotfiles in a particular way, etc.

Yeah that's very true. I didn't like it much either. But I still stuck to it in the spirit of an automagical one-step install.
I'll probably change this tonight.

I'll add that I'm using fish, so it'd probably be better to add an instruction at the end of the install requesting the user add . linuxify.sh/source linuxify.sh to their .bashrc/.zshrc/config.fish/etc.

Alright I've changed the behavior of the script in https://github.com/fabiomaia/linuxify/commit/9140a9c4da69994f753c9a5159133d18686b4fd6
Any comments?

authors: azah fabiomaia techwizrd zmilonas

repo: fabiomaia/linuxify


text:
Saved lane name as environment variable

Summary
Saved lane name as environment variable
Why
Give the opportunity to all fastlane tools to  invoke different actions based on the lane name
Example
Use Appfile configuration for_lane block as fastlane lane #146

👍

authors: fabiomassimo serluca

repo: fabiomassimo/fastlane


text:
[reflection]: obj.ReferenceEquals not reflexive

type mytype = { a : int ; b : int }

let inline (==) (a: 'a) (b: 'b) = obj.ReferenceEquals(a, b)

let inline get<'a>() = typeof<'a>

let _ =
    let t = get<mytype>()
    printfn "%A" <| (typeof<mytype> == t)
    printfn "%A" <| (t == typeof<mytype>)

(*
False
True
*)

This bug is detected for both 0.0.25 and 0.0.26..

The generated code:
def expr_4() -> TypeInfo:
    return record_type("Prog.mytype", [], mytype, lambda: [["a", int32_type], ["b", int32_type]])

class mytype(Record):
    def __init__(self, a: int, b: int) -> None:
        super().__init__()
        self.a = a or 0
        self.b = b or 0

mytype_reflection = expr_4

t : Any = mytype_reflection()

arg10 : bool = mytype_reflection() is t

to_console(printf("%A"))(arg10)

arg10_1 : bool = t == mytype_reflection()

to_console(printf("%A"))(arg10_1)

I think types shall have referential/physical equality, which is now not a truth in Fable.Python.
A simple solution is we design TypeInfo as a reference type in Python
class CurrentTypeInfo:  # the current impl
      ...

class TypeInfo:   #  has object identity and corresponding __hash__
      def __init__(self):
            self.impl = None

And any reflection like expr_4 should return the same object for the same type parameters:
_type_creation_cache_for_expr_4 = {}
def expr_4(*gens) -> TypeInfo:
    if type_info := _type_creation_cache_for_expr_4.get(gens):
        return type_info

    type_info = _type_creation_cache_for_expr_4[gens] = TypeInfo()
    type_info.impl = record_type("Prog.mytype", [], mytype, lambda: [["a", int32_type], ["b", int32_type]])
    return type_info

Such solution has several merits that cover the current approach, and promises referential equality for the same instantiation of a generic type constructor:

reflection becomes efficient.
For instance, automatic serialization needs reflection. I made a cross-backend Fable alternative to FSharp.Json. However, without efficient reflection, the library is extremely slow, as parsing and to-F#-data conversion themselves are even faster than reflection...
recursive references are resolved, just like the current approach
correct equality for TypeInfo are promised.

Could we re-use functool.cache here?
from typing import Any
from functools import cache
from fable_modules.fable_library.reflection import TypeInfo, int32_type, record_type
from fable_modules.fable_library.string import to_console, printf
from fable_modules.fable_library.types import Record

@cache
def expr_1() -> TypeInfo:
    return record_type("QuickTest.mytype", [], mytype, lambda: [["a", int32_type], ["b", int32_type]])

class mytype(Record):
    def __init__(self, a: int, b: int) -> None:
        super().__init__()
        self.a = a or 0
        self.b = b or 0

mytype_reflection = expr_1

t: Any = mytype_reflection()

arg10: bool = mytype_reflection() is t

to_console(printf("%A"))(arg10)

arg10_1: bool = t == mytype_reflection()

to_console(printf("%A"))(arg10_1)

After pondering for a while, I think simply caching it works... Never mind the above proposal..

Besides, we should still omit __eq__  and __hash__ for TypeInfo, leaving them to use referential equality.

Oh, functools.cache works only for Python >=3.9.
For Python 3.8 compatibility, We could just implement our own cache. This is safe because the cache entry is always a tuple of TypeInfo, which is a simple case.
def cache(func):
     local_cache = {}
     def instantiate_type(*args):
          if type_info := local_cache.get(args):
                pass
          else:
               type_info = local_cache[args] = func(*args)
          return type_info
     return instantiate_type

Note that cache returns the same as lru_cache(maxsize=None) so we can just use lru_cache instead. I'm making a PR for this right now.

Thank you!

I btw had to add a proper __hash__ method to TypeInfo or other tests would start to fail. Fixed in https://www.nuget.org/packages/fable-py/4.0.0-alpha-027

Thanks! I will do some local tests to figure out why it fails when __hash__ is missing.

I got it, I forgot it was a dataclass.

@lru_cache should be @lru_cache(maxsize=None), otherwise the reflection function does not return the same object.

I don't understand why maxsize=None (unbounded) should give different result than maxsize=128 (default). I can fix it, but the test is working MyRecord_reflection() is t. Could you produce a negative test?
@lru_cache
def expr_1035() -> TypeInfo:
    return record_type_1("Fable.Tests.Reflection.MyRecord", [], MyRecord, lambda: [["String", string_type], ["Int", int32_type]])

class MyRecord(Record):
    def __init__(self, String: str, Int: int) -> None:
        super().__init__()
        self.String = String
        self.Int = Int or 0

MyRecord_reflection = expr_1035

def test_obj_reference_equals_not_reflexive() -> None:
    t : Any = MyRecord_reflection()
    Testing_equal(True, MyRecord_reflection() is t)
    Testing_equal(True, t == MyRecord_reflection())

The difference can be observed in the following code:
from functools import lru_cache

class S:
    pass

class S:
    def __init__(self, i):
        self.i = i

@lru_cache
def f1(x: int):
    return S(x)

@lru_cache(maxsize=None)
def f2(x: int):
    return S(x)

def test(f):
    res = set()
    for i in range(256 * 100):
        res.add(f(i%256))
    return len(res)

test(f2)  # 25600

test(f1)  # 256

LRU cache stores a limited number of the recently used entries.

But we have only 1 entry. Our function does not take any arguments:
class S:
    def __init__(self, i):
        self.i = i

@lru_cache
def f1():
    return S(42)

@lru_cache(maxsize=None)
def f2():
    return S(42)

def test(f):
    res = set()
    for i in range(256 * 100):
        res.add(f())
    return len(res)

test(f2)  # 1

test(f1)  # 1

IIRC , for generic types, their reflection functions are
def expr_XXX(gen1, gen2, ..., genN) -> TypeInfo:
     ...

😱 Yes, you are absolutely right. I will fix ...

authors: dbrattli thautwarm


text:
Implemented new form styles

Implemented a new style for inputs and selects

Implemented new color style for badges

Added sort icon

👍 Styling looks good. Thanks!

👍

authors: fokusferit fragsalat schluchter

repo: fabric-design/scss


text:
testing actions

just testing out if the new actions CI works

@sawood14012 Your image is available in the registry: docker pull MISSING_REGISTRY_NAME/MISSING_IMAGE_NAME:SNAPSHOT-PR-72


text:
Environment variables

we have one build for prod and pre-prod, right now environment variables are "inserted" with sed into the settings.json file and index.hml. We need a better / more robust way of handling this. Maybe add perl to NGINX and serve the settings like that?

Useful links:
https://hackerbox.io/articles/dockerised-nginx-env-vars/
https://medium.com/comparethemarket/environment-configuration-with-react-nginx-2444e1f11a4c

a very interesting article which talk about different solution for this problem depending on the context with pros and cons:
https://medium.freecodecamp.org/environment-settings-in-javascript-apps-c5f9744282b6
Since we serve the html using nginx, I like this solution:
https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#injecting-data-from-the-server-into-the-page
using this in nginx:
http://nginx.org/en/docs/http/ngx_http_sub_module.html

I am going to try out the nginx filter solution and suggest a PR.

I've found a working solution, I think it's quite nice and transparent:
I added those lines in index.html
<script>
    try {
      window.INIT_CONFIG = JSON.parse('__INIT_JSON_CONFIG__');
    } catch (e) {
      window.INIT_CONFIG = undefined;
      console.info("INIT_CONFIG is not set");
    }
</script>

the script entrypoint.sh then sed the INIT_JSON_CONFIG with the environment variables as a json string.
Here is the new synchronous LaunchConfig
declare var INIT_CONFIG: object;

@Injectable()
export class LaunchConfig extends Config {
  static settings = {};

  constructor() {
    super();
    this.processInitConfig();
    this.processEnvironment();
  }

  private processInitConfig() {
    if (INIT_CONFIG) {
      console.log("INIT_CONFIG is : " + JSON.stringify(INIT_CONFIG));
      LaunchConfig.settings = Object.assign(LaunchConfig.settings, INIT_CONFIG);
    }
  }

The process is really close to what we had
We avoid a request to load settings.json
It's transparent for dev use which can still use process.env..
We don't need multiple js / images
The sed is quite safe since it only process one variable in one small html file

If you like it, I can provide a PR tomoz?

authors: edewit gastaldi ia3andy


text:
upgrade fabric8

upgrade fabric8

[merge]


text:
[BUG] Cannot Add Title After Clicking Away

When creating a new Work Item using the full-form method (in the Detail Panel), I am unable to return to the Title field after leaving the input box. At this point, the user is unable to save their new Work Item.
Steps to Reproduce:

Click on the '+' to bring up the full-form Create Work Item options
Select a Work Item type (any will do)

Title field is autofocused

Leave the Title field by clicking into the Description field.
Close the Description field
Title field can no longer be interacted with - breaking bug

Looks similar to : https://github.com/fabric8io/fabric8-planner/issues/740

Closing as it is a duplicate of #740.


text:
This shit not working

I got this goofy ah code:
mf x be 1 rn
sus (x fr 2){
    waffle("thing is 2")
} imposter{
    waffle("thing is not 2")
}

but when I run it I get this:
Parser error:
 Semicolon (";") expected following "identifier" in "Object" expression. { value: '(', type: 15 } Expecting:  12

tf is up with that.

Seems like it assumed the code block inside the "sus" statement as an object. Could you try running the same in legacy Bussin?

how I do that

const x = 1;
if (x == 2){
println("test")
} else{
println("test 2")
}

when I did that it printed out test 2 like normal.

That's weird, must be an issue with the transcriber. I'll check tomorrow

Grammatical mistake, it's impostor not imposter

bruh i'm actually stupid, thanks

repo: face-hh/bussin


text:
Font resolution is low on MacOS without building (will test built version later)

Also, Zed was not built exclusively for MacOS and they're working on a Linux and Windows release.
Plus, I could build the Mac version for you if you want

We won't support the fruit os as I don't want to rely on someone else to test each build

Duplicate of #72

wait why was it posted twice damn

authors: MinecraftPublisher face-hh

repo: face-hh/griddycode


text:
Make Separate folders for separate resources

like for linux , web development resources there should be separate folder

Why do we need separate folders?

it will be looking nice and all  are files will not be look like a long list.
its my opinion at the end its your wish thanks.

Happy to have a PR from you if you think it can be arranged in a better manner.

authors: import-keshav saranshkataria


text:
yv3.5: cl: Increase stack size for preventing BIC crash

[Summary]

Stack size change for common:
Thread_Name                 | File                       | Define_Argument                                 | From |  To
send_postcode_thread        | common/dev/include/snoop.h | SENDPOSTCODE_STACK_SIZE                         | 1000 | 1024
snoop_thread                | common/dev/include/snoop.h | SNOOP_STACK_SIZE                                |  400 |  512
USB_Handler                 | common/usb/usb.h           | USB_HANDLER_STACK_SIZE                          | 2000 | 2048
kcs_polling                 | common/host/kcs.h          | KCS_POLL_STACK_SIZE                             | 2500 | 2560
IPMB_SEQ_TIMEOUT_STACK_SIZE | common/ipmb/ipmb.h         | IPMB_SEQ_TIMEOUT_STACK_SIZE                     |  500 |  512
IPMB_TX_STACK_SIZE          | common/ipmb/ipmb.h         | IPMB_TX_STACK_SIZE                              | 1500 | 4096
IPMB_RX_STACK_SIZE          | common/ipmb/ipmb.h         | IPMB_RX_STACK_SIZE                              | 2000 | 4096
IPMI_THREAD_STACK_SIZE      | common/ipmi/include/ipmi.h | IPMI_THREAD_STACK_SIZE                          | 4000 | 4096
SENSOR_POLL_STACK_SIZE      | common/sensor/sensor.h     | SENSOR_POLL_STACK_SIZE                          | 2048 | 2048 (No change)
pldm_wait_resp_to           | common/pldm/pldm.c         | K_THREAD_DEFINE                                 | 1024 | 1024 (No change)
monitor_tid                 | common/mctp/mctp_ctrl.c    | K_THREAD_DEFINE                                 | 1024 | 1024 (No change)
gpio_workq                  | common/hal/hal_gpio.h      | GPIO_STACK_SIZE                                 | 2048 | 3072

Stack size change for CL:
Thread_Name                 | File                       | Define_Argument                                 | From |  To
shell_uart                  | ast1030_evb.conf           | CONFIG_SHELL_STACK_SIZE                         | 2048 | 2048 (No change)
ADC0                        | ast1030_evb.conf           | CONFIG_ADC_ASPEED_ACQUISITION_THREAD_STACK_SIZE |  400 |  512
ADC1                        | ast1030_evb.conf           | CONFIG_ADC_ASPEED_ACQUISITION_THREAD_STACK_SIZE |  400 |  512
sysworkq                    | ast1030_evb.conf           | CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE              | 1024 | 4096
usbdworkq                   |                            |                                                 | 1024 | 1024 (No change)
usbworkq                    | ast1030_evb.conf           | CONFIG_USB_WORKQUEUE_STACK_SIZE                 | 1024 | 1024 (No change)
logging                     | ast1030_evb.conf           | CONFIG_LOG_PROCESS_THREAD_STACK_SIZE            |  768 |  768 (No change)
idle                        | ast1030_evb.conf           | CONFIG_IDLE_STACK_SIZE                          |  320 |  512
IRQ                         |                            |                                                 | 2048 | 2048 (No change)

[Test Plan & Log]

Build code:              Pass
Stack Size Check:        Pass
uart:~$ kernel stacks
0x49730 send_postcode_thread (real size 2048):  unused 1836     usage 212 / 2048 (10 %)
0x497f8 snoop_thread (real size 1024):          unused 764      usage 260 / 1024 (25 %)
0x4da28 USB_handler (real size 2048):           unused 1748     usage 300 / 2048 (14 %)
0x4a9a8 kcs_polling (real size 4096):           unused 2508     usage 1588 / 4096 (38 %)
0x4ae58 IPMB_SeqTimeout (real size 1024):       unused 796      usage 228 / 1024 (22 %)
0x4ab38 RX_ME_IPMB_TASK (real size 2560):       unused 1148     usage 1412 / 2560 (55 %)
0x4b3e8 TX_ME_IPMB_TASK (real size 2560):       unused 1652     usage 908 / 2560 (35 %)
0x4aa70 RX_BMC_IPMB_TASK (real size 2560):      unused 1180     usage 1380 / 2560 (53 %)
0x4b320 TX_BMC_IPMB_TASK (real size 2560):      unused 1636     usage 924 / 2560 (36 %)
0x4b708 IPMI_thread (real size 4096):           unused 2404     usage 1692 / 4096 (41 %)
0x4c960 sensor_poll (real size 2048):           unused 1172     usage 876 / 2048 (42 %)
0x4c898 pldm_wait_resp_to (real size 1024):     unused 812      usage 212 / 1024 (20 %)
0x4c7d0 monitor_tid (real size 1024):           unused 820      usage 204 / 1024 (19 %)
0x4dbf0 shell_uart (real size 2048):            unused 1004     usage 1044 / 2048 (50 %)
0x498c0 gpio_workq (real size 2560):            unused 2292     usage 268 / 2560 (10 %)
0x44ba8 ADC0       (real size 1024):            unused 788      usage 236 / 1024 (23 %)
0x45150 ADC1       (real size 1024):            unused 788      usage 236 / 1024 (23 %)
0x56038 sysworkq   (real size 2048):            unused 1788     usage 260 / 2048 (12 %)
0x4dda0 usbdworkq  (real size 1024):            unused 556      usage 468 / 1024 (45 %)
0x4dcb8 usbworkq   (real size 1024):            unused 764      usage 260 / 1024 (25 %)
0x4db28 logging    (real size 1024):            unused 460      usage 564 / 1024 (55 %)
0x4de98 idle 00    (real size 512):             unused 460      usage 52 / 512 (10 %)
0x69af8 IRQ 00     (real size 2048):            unused 1504     usage 544 / 2048 (26 %)

Given these changes it looks like we can no longer fit in SRAM.
Are you getting the same problems when you build locally?
/data/users/goldenbug/OpenBIC/sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/zephyr_prebuilt.elf section `noinit' will not fit in region `SRAM'
/data/users/goldenbug/OpenBIC/sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: region `SRAM' overflowed by 976 bytes

Given these changes it looks like we can no longer fit in SRAM. Are you getting the same problems when you build locally?
/data/users/goldenbug/OpenBIC/sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/zephyr_prebuilt.elf section `noinit' will not fit in region `SRAM'
/data/users/goldenbug/OpenBIC/sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: region `SRAM' overflowed by 976 bytes

Hi @GoldenBug,
We didn't meet the condition during the build but we modified the sysworkq thread from 4096 to 3072.
Please try it again.

authors: DelphineChiu GoldenBug KaidanWu-wiwynn

repo: facebook/OpenBIC


text:
Update clap usage in poc and fixture generator

Some functions have been deprecated in clap, we should replace them with the replace their use.
❯ cargo test
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /Users/eoz/src/Github/novifinancial/akd/akd_client/Cargo.toml
workspace: /Users/eoz/src/Github/novifinancial/akd/Cargo.toml
   Compiling akd_test_tools v0.7.0 (/Users/eoz/src/Github/novifinancial/akd/akd_test_tools)
   Compiling akd v0.7.0 (/Users/eoz/src/Github/novifinancial/akd/akd)
   Compiling akd_mysql v0.7.0 (/Users/eoz/src/Github/novifinancial/akd/akd_mysql)
   Compiling akd_client v0.7.0 (/Users/eoz/src/Github/novifinancial/akd/akd_client)
warning: use of deprecated variant `clap::ArgAction::StoreValue`: Replaced with `ArgAction::Set` or `ArgAction::Append`
  --> akd_test_tools/src/fixture_generator/parser.rs:55:15
   |
55 |         parse(try_from_str = parse_user_events),
   |               ^^^^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: use of deprecated variant `clap::ArgAction::StoreValue`: Replaced with `ArgAction::Set` or `ArgAction::Append`
  --> akd_test_tools/src/fixture_generator/parser.rs:62:9
   |
62 |     pub epochs: u32,
   |         ^^^^^^

warning: use of deprecated variant `clap::ArgAction::StoreValue`: Replaced with `ArgAction::Set` or `ArgAction::Append`
  --> akd_test_tools/src/fixture_generator/parser.rs:68:9
   |
68 |     pub max_updates: u32,
   |         ^^^^^^^^^^^

warning: use of deprecated variant `clap::ArgAction::StoreValue`: Replaced with `ArgAction::Set` or `ArgAction::Append`
  --> akd_test_tools/src/fixture_generator/parser.rs:74:9
   |
74 |     pub min_updates: u32,
   |         ^^^^^^^^^^^

warning: use of deprecated variant `clap::ArgAction::StoreValue`: Replaced with `ArgAction::Set` or `ArgAction::Append`
  --> akd_test_tools/src/fixture_generator/parser.rs:80:9
   |
80 |     pub capture_states: Option<Vec<u32>>,
   |         ^^^^^^^^^^^^^^

warning: use of deprecated variant `clap::ArgAction::StoreValue`: Replaced with `ArgAction::Set` or `ArgAction::Append`
  --> akd_test_tools/src/fixture_generator/parser.rs:88:9
   |
88 |     pub capture_deltas: Option<Vec<u32>>,
   |         ^^^^^^^^^^^^^^

warning: use of deprecated variant `clap::ArgAction::StoreValue`: Replaced with `ArgAction::Set` or `ArgAction::Append`
  --> akd_test_tools/src/fixture_generator/parser.rs:93:9
   |
93 |     pub out: Option<String>,
   |         ^^^

warning: use of deprecated associated function `clap::ArgMatches::is_present`: Replaced with either `ArgAction::SetTrue` or `ArgMatches::contains_id(...)`
   --> akd_test_tools/src/fixture_generator/parser.rs:100:31
    |
100 |     pub no_generated_updates: bool,
    |                               ^^^^

warning: use of deprecated associated function `clap::Arg::<'help>::multiple_occurrences`: Replaced with `Arg::action` (Issue #3772)
  --> akd_test_tools/src/fixture_generator/parser.rs:57:16
   |
57 |     pub users: Vec<User>,
   |                ^^^

warning: use of deprecated associated function `clap::Arg::<'help>::validator`: Replaced with `Arg::value_parser(...)`
  --> akd_test_tools/src/fixture_generator/parser.rs:55:30
   |
55 |         parse(try_from_str = parse_user_events),
   |                              ^^^^^^^^^^^^^^^^^

warning: use of deprecated associated function `clap::Arg::<'help>::multiple_occurrences`: Replaced with `Arg::action` (Issue #3772)
  --> akd_test_tools/src/fixture_generator/parser.rs:54:9
   |
54 |         multiple_occurrences = true,
   |         ^^^^^^^^^^^^^^^^^^^^

warning: use of deprecated associated function `clap::Arg::<'help>::validator`: Replaced with `Arg::value_parser(...)`
  --> akd_test_tools/src/fixture_generator/parser.rs:62:9
   |
62 |     pub epochs: u32,
   |         ^^^^^^

warning: use of deprecated associated function `clap::Arg::<'help>::validator`: Replaced with `Arg::value_parser(...)`
  --> akd_test_tools/src/fixture_generator/parser.rs:68:9
   |
68 |     pub max_updates: u32,
   |         ^^^^^^^^^^^

warning: use of deprecated associated function `clap::Arg::<'help>::validator`: Replaced with `Arg::value_parser(...)`
  --> akd_test_tools/src/fixture_generator/parser.rs:74:9
   |
74 |     pub min_updates: u32,
   |         ^^^^^^^^^^^

warning: use of deprecated associated function `clap::Arg::<'help>::multiple_occurrences`: Replaced with `Arg::action` (Issue #3772)
  --> akd_test_tools/src/fixture_generator/parser.rs:80:25
   |
80 |     pub capture_states: Option<Vec<u32>>,
   |                         ^^^^^^

warning: use of deprecated associated function `clap::Arg::<'help>::validator`: Replaced with `Arg::value_parser(...)`
  --> akd_test_tools/src/fixture_generator/parser.rs:80:9
   |
80 |     pub capture_states: Option<Vec<u32>>,
   |         ^^^^^^^^^^^^^^

warning: use of deprecated associated function `clap::Arg::<'help>::multiple_occurrences`: Replaced with `Arg::action` (Issue #3772)
  --> akd_test_tools/src/fixture_generator/parser.rs:88:25
   |
88 |     pub capture_deltas: Option<Vec<u32>>,
   |                         ^^^^^^

warning: use of deprecated associated function `clap::Arg::<'help>::validator`: Replaced with `Arg::value_parser(...)`
  --> akd_test_tools/src/fixture_generator/parser.rs:88:9
   |
88 |     pub capture_deltas: Option<Vec<u32>>,
   |         ^^^^^^^^^^^^^^

warning: use of deprecated associated function `clap::Arg::<'help>::validator`: Replaced with `Arg::value_parser(...)`
  --> akd_test_tools/src/fixture_generator/parser.rs:93:9
   |
93 |     pub out: Option<String>,
   |         ^^^

warning: `akd_test_tools` (lib) generated 19 warnings
warning: `akd_test_tools` (lib test) generated 19 warnings (19 duplicates)
   Compiling akd_integration_tests v0.0.0 (/Users/eoz/src/Github/novifinancial/akd/integration_tests)
   Compiling akd_app v0.0.0 (/Users/eoz/src/Github/novifinancial/akd/poc)
warning: use of deprecated variant `clap::ArgAction::StoreValue`: Replaced with `ArgAction::Set` or `ArgAction::Append`
  --> poc/src/main.rs:65:9
   |
65 |         num_users: u64,
   |         ^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: use of deprecated variant `clap::ArgAction::StoreValue`: Replaced with `ArgAction::Set` or `ArgAction::Append`
  --> poc/src/main.rs:66:9
   |
66 |         num_updates_per_user: u64,
   |         ^^^^^^^^^^^^^^^^^^^^

warning: use of deprecated variant `clap::ArgAction::StoreValue`: Replaced with `ArgAction::Set` or `ArgAction::Append`
  --> poc/src/main.rs:70:9
   |
70 |         num_users: u64,
   |         ^^^^^^^^^

warning: use of deprecated variant `clap::ArgAction::StoreValue`: Replaced with `ArgAction::Set` or `ArgAction::Append`
  --> poc/src/main.rs:71:9
   |
71 |         num_lookups_per_user: u64,
   |         ^^^^^^^^^^^^^^^^^^^^

warning: use of deprecated variant `clap::ArgAction::StoreValue`: Replaced with `ArgAction::Set` or `ArgAction::Append`
  --> poc/src/main.rs:74:21
   |
74 |     BenchDbInsert { num_users: u64 },
   |                     ^^^^^^^^^

warning: use of deprecated variant `clap::ArgAction::StoreValue`: Replaced with `ArgAction::Set` or `ArgAction::Append`
  --> poc/src/main.rs:99:5
   |
99 |     console_debug: PublicLogLevels,
   |     ^^^^^^^^^^^^^

warning: use of deprecated variant `clap::ArgAction::StoreValue`: Replaced with `ArgAction::Set` or `ArgAction::Append`
   --> poc/src/main.rs:110:5
    |
110 |     mysql_insert_depth: usize,
    |     ^^^^^^^^^^^^^^^^^^

warning: use of deprecated associated function `clap::Arg::<'help>::validator`: Replaced with `Arg::value_parser(...)`
  --> poc/src/main.rs:65:9
   |
65 |         num_users: u64,
   |         ^^^^^^^^^

warning: use of deprecated associated function `clap::Arg::<'help>::validator`: Replaced with `Arg::value_parser(...)`
  --> poc/src/main.rs:66:9
   |
66 |         num_updates_per_user: u64,
   |         ^^^^^^^^^^^^^^^^^^^^

warning: use of deprecated associated function `clap::Arg::<'help>::validator`: Replaced with `Arg::value_parser(...)`
  --> poc/src/main.rs:70:9
   |
70 |         num_users: u64,
   |         ^^^^^^^^^

warning: use of deprecated associated function `clap::Arg::<'help>::validator`: Replaced with `Arg::value_parser(...)`
  --> poc/src/main.rs:71:9
   |
71 |         num_lookups_per_user: u64,
   |         ^^^^^^^^^^^^^^^^^^^^

warning: use of deprecated associated function `clap::Arg::<'help>::validator`: Replaced with `Arg::value_parser(...)`
  --> poc/src/main.rs:74:21
   |
74 |     BenchDbInsert { num_users: u64 },
   |                     ^^^^^^^^^

warning: use of deprecated associated function `clap::ArgMatches::is_present`: Replaced with either `ArgAction::SetTrue` or `ArgMatches::contains_id(...)`
  --> poc/src/main.rs:85:16
   |
85 |     memory_db: bool,
   |                ^^^^

warning: use of deprecated associated function `clap::ArgMatches::is_present`: Replaced with either `ArgAction::SetTrue` or `ArgMatches::contains_id(...)`
  --> poc/src/main.rs:89:12
   |
89 |     debug: bool,
   |            ^^^^

warning: use of deprecated associated function `clap::Arg::<'help>::possible_values`: Replaced with `Arg::value_parser(PossibleValuesParser::new(...)).takes_value(true)`
  --> poc/src/main.rs:99:20
   |
99 |     console_debug: PublicLogLevels,
   |                    ^^^^^^^^^^^^^^^

warning: use of deprecated associated function `clap::Arg::<'help>::validator`: Replaced with `Arg::value_parser(...)`
   --> poc/src/main.rs:110:5
    |
110 |     mysql_insert_depth: usize,
    |     ^^^^^^^^^^^^^^^^^^

Resolved in https://github.com/facebook/akd/pull/361

repo: facebook/akd


text:
Print output path after building a target

I'm playing around with Buck2 (long time advanced Bazel user). One thing that I immediately missed from Bazel is the ability to easily click the output path in my terminal and open the generated file in my editor. Buck2 doesn't currently print anything to help you find the built file, and I also haven't found any flags to enable that.

The flag(s) you're looking for are --show-output and --show-full-output

Oh, that's right. Missed that. Any reason why this is not enabled by default?

Any reason why this is not enabled by default?

Hmm, at this point the answer is probably "because buck1 did it this way and that's not something we've taken the time to revisit right now". I know it's not a great answer but that's all I have :)

authors: burdiyan krallin


text:
Update supported-browsers-features.md

Minor textual change

Thanks for the PR but this doesn't seem like a necessary change.

authors: iansu rameezj

repo: facebook/create-react-app


text:
Replace deprecated eslint-loader by eslint-webpack-plugin

As describe here, eslint-loader has been deprecated in favor of eslint-webpack-plugin
I followed the migration guide for this PR after some discussions with @mrmckeb
https://github.com/facebook/create-react-app/issues/9726

@tooppaaa I've made a small change to the formatter as the loader included filenames (but only ever one file at a time), and the Plugin doesn't do that.
@ianschmitz @iansu ready for you to have a look.

Thanks again @tooppaaa!

Just saw this was merged. Anecdotally, I was seeing huge re-compile times (both on start-up and subsequent changes) running the new config versus the previous config. I don't know if there is anything to do now but I'd keep an eye on:

https://github.com/webpack-contrib/eslint-webpack-plugin/issues/20
https://github.com/webpack-contrib/eslint-webpack-plugin/issues/23

Subscribed, thanks @buchanaf. We don't have performance testing today for CRA and it's something we should look at implementing.

authors: buchanaf mrmckeb tooppaaa


text:
Docusaurus upgrade CLI command

🚀 Feature
It would be convenient to have a yarn docusaurus upgrade command.
It would just bump the @docusaurus version numbers and run docusaurus clear to ensure caching does not cause any trouble (like https://github.com/facebook/docusaurus/issues/4070)
It's complicated to automate the update of breaking changes so it wouldn't be an initial goal of this CLI (but maybe we can improve it later)

Worked on a solution to this.
Accepts a --tag option to pass custom npm tags (alpha, beta, next, latest.. any)
Preview of docusaurus upgrade -t alpha:

Preview of docusaurus upgrade:

It automatically detects if you're using yarn or npm, to use npm install x@tag or yarn upgrade x@tag.
Probably this should be enough =)

Worked on a solution to this.
Accepts a --tag option to pass custom npm tags (alpha, beta, next, latest.. any)
Preview of docusaurus upgrade -t alpha:

Preview of docusaurus upgrade:

It automatically detects if you're using yarn or npm, to use npm install x@tag or yarn upgrade x@tag.
Probably this should be enough =)

authors: semoal slorber

repo: facebook/docusaurus


text:
fix(theme-translation): add and update Japanese translations

Pre-flight checklist

[x] I have read the Contributing Guidelines on pull requests.
[ ] If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
[ ] If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Complete missing translations for Japanese locale.
Test Plan

Test links

Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/
Related issues/PRs

Thanks 👍

authors: Ryoga-exe slorber


text:
chore(module-type-aliases): add react as peer dependency

Motivation
Fix the last installation warning we have: @docusaurus/module-type-aliases@npm:0.0.0-4615 doesn't provide react (peecbe), requested by react-helmet-async
Have you read the Contributing Guidelines on pull requests?
Yes

was wondering if there's a way to turn such warnings as errors and fail CI?

It's not very easy in classic 🤷♂ We can figure it out once we migrated to Berry in #6028

authors: Josh-Cena slorber


text:
Support for tables

Is there any plans for adding support for tables to draft.js? I can't find any mention of it in the documentation.

This is more a framework than a feature complete wysiwyg editor. I guess you could try implementing tables with custom block components.

Yep, custom block components would be the way to do this. The TeX example might help get you started on this.

authors: bkniffler hellendag orf

repo: facebook/draft-js


text:
Promise.all: array type is incompatible with iterable.

const products = await Promise.all(Object.keys(cart.cartItems).map(cartItem => getProduct(cartItem)));

This line throws an error of:
array type This type is incompatible with Iterable See also: call of method `all`

I expected it to not throw an error because Promise.all accepts arrays.
Let me know if you need more information
Mac OS X 10.11.6 (15G31)
Flow: v0.35.0

Can you make an isolated test case?

Not sure what you mean. This code block throws the error for me:
function promiseReturner(id: number): Promise<number> {
  return new Promise((resolve, reject) => resolve(id));
}

const arr = [1, 2, 3];

function promiseGenerator() {
  return Promise.all(arr.map(id => promiseReturner(id)));
}

When running 'flow' on my codebase I see this
server/router/webservice/promoCodesUtility.js:221
221:   const cartItems = await Promise.all(cartItemsProductIdArray
                               ^ call of method `all`
221:   const cartItems = await Promise.all(cartItemsProductIdArray
                                           ^ array type. This type is incompatible with
601:     static all<Elem, T:Iterable<Elem>>(promises: T): Promise<$TupleMap<T, typeof $await>>;
                            ^^^^^^^^^^^^^^ Iterable. See lib: /private/tmp/flow/flowlib_641b6b7/core.js:601

That block on core.js
/* Promises
   cf. https://github.com/borisyankov/DefinitelyTyped/blob/master/es6-promises/es6-promises.d.ts
*/

declare class Promise<+R> {
    constructor(callback: (
      resolve: (result: Promise<R> | R) => void,
      reject:  (error: any) => void
    ) => mixed): void;

    then<U>(
      onFulfill?: (value: R) => Promise<U> | U,
      onReject?: (error: any) => Promise<U> | U
    ): Promise<U>;

    catch<U>(
      onReject?: (error: any) => ?Promise<U> | U
    ): Promise<U>;

    static resolve<T>(object: Promise<T> | T): Promise<T>;
    static reject<T>(error?: any): Promise<T>;
    static all<Elem, T:Iterable<Elem>>(promises: T): Promise<$TupleMap<T, typeof $await>>;
    static race<T, Elem: Promise<T> | T>(promises: Array<Elem>): Promise<T>;
}

Line being referenced:
    static all<Elem, T:Iterable<Elem>>(promises: T): Promise<$TupleMap<T, typeof $await>>;

Seems to have been fixed; tried in both 0.39 and 0.37.2 with no errors.

Still reproduced on 0.64.0.
My code
const requests: AxiosPromise[] = someArray.map(() => axios.put('some/url));
const responses: AxiosResponse[] = await Promise.all(requests);

Error log:
$ flow
Error: src/services/apiService.js:44
 44:   const responses: AxiosResponse[] = await Promise.all(requests);
                                                            ^^^^^^^^ array type. This type is incompatible with
608:     static all<T: Iterable<mixed>>(promises: T): Promise<$TupleMap<T, typeof $await>>;
                       ^^^^^^^^^^^^^^^ $Iterable. See lib: C:\Users\_.h\AppData\Local\Temp\flow\flowlib_3a83ce6e\core.js:608
  Property `@@iterator` is incompatible:
    197:     @@iterator(): Iterator<T>;
             ^^^^^^^^^^^^^^^^^^^^^^^^^ function type. This type is incompatible with. See lib: C:\Users\___.h\AppData\Local\Temp\flow\flowlib_3a83ce6e\core.js:197
    503:     @@iterator(): $Iterator<Yield,Return,Next>;
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function type. See lib: C:\Users\___.h\AppData\Local\Temp\flow\flowlib_3a83ce6e\core.js:503
      This parameter is incompatible:
        197:     @@iterator(): Iterator<T>;
                               ^^^^^^^^^^^ Iterator. This type is incompatible with. See lib: C:\Users\_.h\AppData\Local\Temp\flow\flowlib_3a83ce6e\core.js:197
        503:     @@iterator(): $Iterator<Yield,Return,Next>;
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ $Iterator. See lib: C:\Users\_.h\AppData\Local\Temp\flow\flowlib_3a83ce6e\core.js:503
          Property `@@iterator` is incompatible:
            503:     @@iterator(): $Iterator<Yield,Return,Next>;
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `@@iterator` of `$Iterator`. Property not found in. See lib: C:\Users\_.h\AppData\Local\Temp\flow\flowlib_
3a83ce6e\core.js:503
            197:     @@iterator(): Iterator<T>;
                                   ^^^^^^^^^^^ Iterator. See lib: C:\Users\_.h\AppData\Local\Temp\flow\flowlib_3a83ce6e\core.js:197

Error: src/services/apiService.js:44
 44:   const responses: AxiosResponse[] = await Promise.all(requests);
                                                            ^^^^^^^^ array type. This type is incompatible with
608:     static all<T: Iterable<mixed>>(promises: T): Promise<$TupleMap<T, typeof $await>>;
                       ^^^^^^^^^^^^^^^ $Iterable. See lib: C:\Users\_.h\AppData\Local\Temp\flow\flowlib_3a83ce6e\core.js:608
  Property `@@iterator` is incompatible:
    197:     @@iterator(): Iterator<T>;
             ^^^^^^^^^^^^^^^^^^^^^^^^^ function type. This type is incompatible with. See lib: C:\Users\_.h\AppData\Local\Temp\flow\flowlib_3a83ce6e\core.js:197
    503:     @@iterator(): $Iterator<Yield,Return,Next>;
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function type. See lib: C:\Users\_.h\AppData\Local\Temp\flow\flowlib_3a83ce6e\core.js:503
      This parameter is incompatible:
        197:     @@iterator(): Iterator<T>;
                               ^^^^^^^^^^^ Iterator. This type is incompatible with. See lib: C:\Users\_.h\AppData\Local\Temp\flow\flowlib_3a83ce6e\core.js:197
        503:     @@iterator(): $Iterator<Yield,Return,Next>;
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ $Iterator. See lib: C:\Users\_.h\AppData\Local\Temp\flow\flowlib_3a83ce6e\core.js:503
          Property `next` is incompatible:
                     v--------
            297:     next(): {
            298:         done: boolean,
            299:         value?: T
            300:     }
                     ^ function type. This type is incompatible with. See lib: node_modules/mobx/lib/mobx.js.flow:297
            498:     next(value?: Next): IteratorResult<Yield,Return>;
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function type. See lib: C:\Users\_.h\AppData\Local\Temp\flow\flowlib_3a83ce6e\core.js:498
              This parameter is incompatible:
                                 v
                297:     next(): {
                298:         done: boolean,
                299:         value?: T
                300:     }
                         ^ object type. This type is incompatible with. See lib: node_modules/mobx/lib/mobx.js.flow:297
                498:     next(value?: Next): IteratorResult<Yield,Return>;
                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ union: object type(s). See lib: C:\Users\_.h\AppData\Local\Temp\flow\flowlib_3a83ce6e\core.js:498
                  Member 1:
                  493:   | { done: true, value?: Return }
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ object type. See lib: C:\Users\_.h\AppData\Local\Temp\flow\flowlib_3a83ce6e\core.js:493
                  Error:
                  inconsistent use of library definitions
                                   v
                  297:     next(): {
                  298:         done: boolean,
                  299:         value?: T
                  300:     }
                           ^ object type. This type is incompatible with. See lib: node_modules/mobx/lib/mobx.js.flow:297
                  493:   | { done: true, value?: Return }
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ object type. See lib: C:\Users\_.h\AppData\Local\Temp\flow\flowlib_3a83ce6e\core.js:493
                    Property `done` is incompatible:
                      298:         done: boolean,
                                         ^^^^^^^ boolean. Expected boolean literal `true`. See lib: node_modules/mobx/lib/mobx.js.flow:298
                      493:   | { done: true, value?: Return }
                                       ^^^^ boolean literal `true`. See lib: C:\Users\___\AppData\Local\Temp\flow\flowlib_3a83ce6e\core.js:493
                  Member 2:
                  494:   | { done: false, value: Yield };
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ object type. See lib: C:\Users\___\AppData\Local\Temp\flow\flowlib_3a83ce6e\core.js:494
                  Error:
                  inconsistent use of library definitions
                                   v
                  297:     next(): {
                  298:         done: boolean,
                  299:         value?: T
                  300:     }
                           ^ object type. This type is incompatible with. See lib: node_modules/mobx/lib/mobx.js.flow:297
                  494:   | { done: false, value: Yield };
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ object type. See lib: C:\Users\_.h\AppData\Local\Temp\flow\flowlib_3a83ce6e\core.js:494
                    Property `done` is incompatible:
                      298:         done: boolean,
                                         ^^^^^^^ boolean. Expected boolean literal `false`. See lib: node_modules/mobx/lib/mobx.js.flow:298
                      494:   | { done: false, value: Yield };
                                       ^^^^^ boolean literal `false`. See lib: C:\Users\___\AppData\Local\Temp\flow\flowlib_3a83ce6e\core.js:494

Found 2 errors

authors: damncabbage johntran m1n0s vkurchatkin

repo: facebook/flow


text:
Unexpected token

Freshly installed Flow 0.51.0 constantly dies from default by parsing json files in my working directory.
testfile.json:
{<% var ngVer = "1.6.5" %>
...
}

$ flow

Error: testfile.json:1
1: {<% var ngVer = "1.4.0" %>
^ Unexpected token <
Found 1 error

Why is Flow parsing json files by default? Is that a normal behaviour?

Yes. You should add this file to your .flowconfig's ignore section.

authors: btford ivanherczeg


text:
Trailing comma in dynamic import fails to parse

https://flow.org/try/#0JYWwDg9gTgLgFAKAJAHIoFMCGAbbBPbCAOwHNRJYUAaBASiA
import(
	'reallylongimport',
)

If I have a long import path prettier puts the path in on a separate line and adds a trailing comma. For some reason flow trips on it.

For some reason flow trips on it.

If I read the spec correctly, Flow’s parser is correct here (and Babylon
is not). The argument to an ImportCall is an AssignmentExpression,
and an AssignmentExpression may not have a trailing comma.
By contrast, the argument to a normal function call or a SuperCall is
an Arguments, which explicitly may have a trailing comma.
See also: https://github.com/tc39/proposal-dynamic-import/issues/15

If I have a long import path prettier puts the path in on a separate
line and adds a trailing comma

I have not been able to reproduce this behavior. With a line width of 20
and trailing-comma set to all, Prettier turns
const x = import("12345678901234567890");
const y = import("1234567890" + "1234567890");
const z = normal("1234567890" + "1234567890");

into
const x = import("12345678901234567890");
const y = import("1234567890" +
  "1234567890");
const z = normal(
  "1234567890" +
    "1234567890",
);

You can observe that it does not add a trailing comma in an import,
even though it does with a normal function call.
Here is a Prettier playground link for the above example. If
you can reproduce the Prettier failure, please file a bug with Prettier.

authors: masad-frost wchargin


text:
Autocomplete crashes iTorch when pressing tab

When I launch an interactive session with itorch
It crashes when I press the tab key for autocomplete.
Here is the crash log:
 itorch
Jupyter Console 4.0.3

[ZMQTerminalIPythonApp] Loading IPython extension: storemagic
Torch 7.0  Copyright (C) 2001-2011 Idiap, NEC Labs, NYU
Torch 7.0  Copyright (C) 2001-2011 Idiap, NEC Labs, NYU

WARNING: history_request not handled yet

In [1]: itoqlua: /Users/pp/torch/install/share/lua/5.1/itorch/main.lua:265: attempt to index local 'line' (a nil value)
stack traceback:
	[C]: in function '__index'
	/Users/pp/torch/install/share/lua/5.1/itorch/main.lua:265: in function 'extract_completions'
	/Users/pp/torch/install/share/lua/5.1/itorch/main.lua:306: in function </Users/pp/torch/install/share/lua/5.1/itorch/main.lua:304>
	/Users/pp/torch/install/share/lua/5.1/lzmq/poller.lua:75: in function 'poll'
	/Users/pp/torch/install/share/lua/5.1/lzmq/impl/loop.lua:307: in function 'poll'
	/Users/pp/torch/install/share/lua/5.1/lzmq/impl/loop.lua:325: in function 'sleep_ex'
	/Users/pp/torch/install/share/lua/5.1/lzmq/impl/loop.lua:370: in function 'start'
	/Users/pp/torch/install/share/lua/5.1/itorch/main.lua:350: in main chunk
	[C]: in function 'require'
	[string "arg={'/Users/pp/Library/Jupyter/runtime/kerne..."]:1: in main chunk

When I try to clean Install iTorch with luarocks make, I get the following output which seems strange:
luarocks make
   ipy=$(which ipython)
   if [ -x "$ipy" ]
   then
	ipybase=$(ipython locate)
	rm -rf $ipybase/profile_torch
	ipython profile create torch
	echo 'c.KernelManager.kernel_cmd = ["/Users/pp/torch/install/bin/itorch_launcher","{connection_file}"]' >>$ipybase/profile_torch/ipython_config.py
	echo "c.Session.key = b''" >>$ipybase/profile_torch/ipython_config.py
	echo "c.Session.keyfile = b''" >>$ipybase/profile_torch/ipython_config.py
	mkdir -p $ipybase/profile_torch/static/base/images
	mkdir -p $ipybase/kernels/itorch
	cat kernelspec/kernel.json | sed "s@LUA_BINDIR@/Users/pp/torch/install/bin@" > $ipybase/kernels/itorch/kernel.json
	cp kernelspec/*.png $ipybase/kernels/itorch/
	cp ipynblogo.png $ipybase/profile_torch/static/base/images
	mkdir -p $ipybase/profile_torch/static/custom/
	cp custom.js $ipybase/profile_torch/static/custom/
	cp custom.css $ipybase/profile_torch/static/custom/
	cp itorch /Users/pp/torch/install/bin/
	cp itorch_launcher /Users/pp/torch/install/bin/
	cp -r ~/.ipython/profile_torch ~/.ipython/profile_itorch
	cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/Users/pp/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/Users/pp/torch/install/lib/luarocks/rocks/itorch/scm-1" && make
   else
	echo "Error: could not find ipython in PATH. Do you have it installed?"
   fi

[ProfileCreate] Generating default config file: u'/Users/pp/.ipython/profile_torch/ipython_config.py'
[ProfileCreate] Generating default config file: u'/Users/pp/.ipython/profile_torch/ipython_kernel_config.py'
-- The C compiler identification is AppleClang 7.0.2.7000181
-- The CXX compiler identification is AppleClang 7.0.2.7000181
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Torch7 in /Users/pp/torch/install
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/pp/iTorch/build
cd build && make install
Install the project...
-- Install configuration: "Release"
-- Installing: /Users/pp/torch/install/lib/luarocks/rocks/itorch/scm-1/lua/itorch/_env.lua
-- Installing: /Users/pp/torch/install/lib/luarocks/rocks/itorch/scm-1/lua/itorch/bokeh.lua
-- Installing: /Users/pp/torch/install/lib/luarocks/rocks/itorch/scm-1/lua/itorch/completer.lua
-- Installing: /Users/pp/torch/install/lib/luarocks/rocks/itorch/scm-1/lua/itorch/gfx.lua
-- Installing: /Users/pp/torch/install/lib/luarocks/rocks/itorch/scm-1/lua/itorch/init.lua
-- Installing: /Users/pp/torch/install/lib/luarocks/rocks/itorch/scm-1/lua/itorch/IOHandler.lua
-- Installing: /Users/pp/torch/install/lib/luarocks/rocks/itorch/scm-1/lua/itorch/main.lua
-- Installing: /Users/pp/torch/install/lib/luarocks/rocks/itorch/scm-1/lua/itorch/Plot.lua
-- Installing: /Users/pp/torch/install/lib/luarocks/rocks/itorch/scm-1/lua/itorch/test.lua
-- Installing: /Users/pp/torch/install/lib/luarocks/rocks/itorch/scm-1/lua/itorch/util.lua
-- Installing: /Users/pp/torch/install/lib/luarocks/rocks/itorch/scm-1/lua/itorch/bokeh-0.7.0.min.js
-- Installing: /Users/pp/torch/install/lib/luarocks/rocks/itorch/scm-1/lua/itorch/bokeh-0.7.0.min.css
Updating manifest for /Users/pp/torch/install/lib/luarocks/rocks
itorch scm-1 is now built and installed in /Users/pp/torch/install/ (license: BSD)

The thing is it IS installed and the PATH is in my path!!! : which ipython > /usr/local/bin/ipython
Another symptom I have is that when I run the command itorch qtconsole I get a console that only understands Python!!!
Please help!!

I reinstalled everything after running brew update and brew upgrade

repo: facebook/iTorch


text:
Is .babelrc actually read?

I am trying to add new plugins to my .babelrc at the root of my project, and using the jest-cli.
No matter what I put in my .babelrc it seems to not change anything at all, even if I put some gibberish content inside it, jest will just works maybe because it's not reading .babelrc at all?

Ok this is only a matter of cleaning the cache.

repo: facebook/jest


text:
[Question] ListView code coverage, renderRow method

When using Jest to measure code coverage, how can I achieve 100% coverage of my component that uses a ListView? I notice the renderRow method is never executed, and I'm guessing this is because the ListView is mocked (since Jest v15).

You may need a proper ListView mock. The one that's currently in jest-react-native is very simply and doesn't really do much. We are merging the preset into react-native, so it's best to send a PR to https://github.com/facebook/react-native directly.

authors: cpojer lewisbarber


text:
Jest 22 fails when disabling node TLS checking

Do you want to request a feature or report a bug?
bug
What is the current behavior?
It fails with:

$ jest
 FAIL  test/failing.test.js
  Micro servers
    ✓ should work (29ms)
    ✕ should work too (579ms)

  ● Micro servers › should work too

    expect(received).toEqual(expected)

    Expected value to equal:
      "{\"hello\":\"world\"}"
    Received:
      undefined

    Difference:

      Comparing two different types of values. Expected string but received undefined.

      79 |         }
      80 |
    > 81 |         expect(actual).toEqual(expected);
      82 |         resolve(actual);
      83 |       });
      84 |     });

      at cb (test/failing.test.js:81:24)

  console.error src/requests.js:53
    Request Error: Error: self signed certificate
        at Error (native)
        at TLSSocket.<anonymous> (_tls_wrap.js:1092:38)
        at emitNone (events.js:86:13)
        at TLSSocket.emit (events.js:185:7)
        at TLSSocket._finishInit (_tls_wrap.js:610:8)
        at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:440:38)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 passed, 2 total
Snapshots:   0 total
Time:        1.469s, estimated 2s
Ran all test suites.

If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can yarn install and yarn test.

Repository
yarn install
yarn test: Doesn't work
yarn add --exact --dev jest@21 and yarn test: Works fine

What is the expected behavior?
Should work, right?!
Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.
All configuration can be found in the repository above.

Not sure if related but we see problems with Jest 22 on lint-staged repo:
https://travis-ci.org/okonet/lint-staged/jobs/318338723

Not exactly the same message, but seems to be related to "testEnvironment": "node"

I'm still having this issues.

@geovanisouza92 did you find a fix?

@cyphercodes no, I tested Jest 23 last week, and the problem is still there.

See https://github.com/facebook/jest/issues/8449#issuecomment-1053649387

authors: SimenB cyphercodes geovanisouza92 okonet


text:
No tests found when running from webstorm in linked folder(linux)

🐛 Bug Report
no tests found when running from webstorm in linked folder(linux)
To Reproduce
Steps to reproduce the behavior:
-in some place place code folder (ex: /run/media/denis/data/code)
-create link to this folder in your home(ex: /home/denis/code)
-open project in webstorm (ex: /run/media/denis/data/code/test-project)
-try to run tests
Expected behavior
tests runs as expected
Actual behaviour
Generated command failed for linked folder:
cd /home/denis/code/test-project
node --require /home/denis/.local/share/JetBrains/Toolbox/apps/WebStorm/ch-0/192.6603.19/plugins/JavaScriptLanguage/helpers/jest-intellij/lib/jest-intellij-stdin-fix.js /home/denis/code/test-project/node_modules/jest/bin/jest.js --colors --reporters /home/denis/.local/share/JetBrains/Toolbox/apps/WebStorm/ch-0/192.6603.19/plugins/JavaScriptLanguage/helpers/jest-intellij/lib/jest-intellij-reporter.js --verbose "--testNamePattern=^<Tabs /> tabs set render correct$" --runTestsByPath /home/denis/code/test-project/src/js/tabs/tabs.spec.ts
No tests found, exiting with code 1 Run with --passWithNoTeststo exit with code 0 No files found in /run/media/denis/data/code/test-project. Make sure Jest's configuration does not exclude this directory. To set up Jest, make sure a package.json file exists. Jest Documentation: facebook.github.io/jest/docs/configuration.html Files: "/home/denis/codetest/project/src/js/tabs/tabs.spec.ts"
Generated command worked for real folder:
cd /run/media/denis/data/code/test-project
/usr/bin/node --require /home/denis/.local/share/JetBrains/Toolbox/apps/WebStorm/ch-0/192.6603.19/plugins/JavaScriptLanguage/helpers/jest-intellij/lib/jest-intellij-stdin-fix.js /run/media/denis/data/code/test-project/node_modules/jest/bin/jest.js --colors --reporters /home/denis/.local/share/JetBrains/Toolbox/apps/WebStorm/ch-0/192.6603.19/plugins/JavaScriptLanguage/helpers/jest-intellij/lib/jest-intellij-reporter.js --verbose "--testNamePattern=^<Tabs /> tabs set render correct$" --runTestsByPath /run/media/denis/data/code/test-project/src/js/tabs/tabs.spec.ts
Link to repl or repo (highly encouraged)

envinfo
System:
OS: Linux 4.19 Manjaro Linux undefined
CPU: (12) x64 AMD Ryzen 5 2600X Six-Core Processor
Memory: 2.95 GB / 15.66 GB
Container: Yes
Shell: 5.0.9 - /bin/bash
Binaries:
Node: 12.9.1 - /usr/bin/node
Yarn: 1.17.3 - /usr/bin/yarn
Utilities:
CMake: 3.15.2 - /usr/bin/cmake
Make: 4.2.1 - /usr/bin/make
GCC: 9.1.0 - /usr/bin/gcc
Git: 2.23.0 - /usr/bin/git
IDEs:
Nano: 4.4 - /usr/bin/nano
Languages:
Bash: 5.0.9 - /usr/bin/bash
Perl: 5.30.0 - /usr/bin/perl
Python: 3.7.4 - /usr/bin/python
Databases:
SQLite: 3.29.0 - /usr/bin/sqlite3
Browsers:
Firefox: 69.0.1

I believe this is rather Webstorm issue. Please send it to their support forum. Happy to accept PRs if there's anything on our side that we could improve

authors: gdbd thymikee


text:
Fix misspell in ja/index.html

Summary
Fixed misspell on https://jestjs.io/ja/ page
Test plan
'でｓ' would change into 'です'

signing done. @facebook-github-bot

Thanks for the PR @shin1ohno! However, the file you've changed is generated - the translations lives on crowdin: https://crowdin.com/project/jest/ja. Maybe https://crowdin.com/translate/jest/1221/en-ja? I'm sad to admit I don't really know how Crowdin works, but that looks correct.
Once you update there, a new deploy of the website will pull in that change.


text:
generator functions*

add support for testing using generator functions per https://github.com/mxstbr/react-boilerplate/pull/980
cc @mxstbr

Amazing turnaround time! 😱  Color me impressed!

Current coverage is 89.93% (diff: 100%)

Merging #1687 into master will not change coverage

@@             master      #1687   diff @@
==========================================
  Files            31         31
  Lines          1143       1143
  Methods           0          0
  Messages          0          0
  Branches          0          0
==========================================
  Hits           1028       1028
  Misses          115        115
  Partials          0          0

Powered by Codecov. Last update 968ca38...25abe7b

please rebase and then merge. LGTM.

🎉

I don’t quite understand this, can you please help me get the use case?
@mxstbr
Can you clarify what you meant by "generator support" in https://github.com/mxstbr/react-boilerplate/pull/980#issuecomment-246182724?
I’m confused because your comment was about redux-saga but I don’t think it uses generators via co at all, it interprets them. So I don’t understand why the feature this PR added was needed.
Thanks!

In particular I’m not sure why this function (presumably being the reason for this PR?) is a generator. It doesn’t yield anything, does it? Are there some special semantics I’m missing?

actually, i think i just implemented the generators support without understanding the full context first.
and yes. it seems like this PR doesn't affect  this function
It seemed very straightforward to me, but it turned out to be not :) we should probably revert this PR and then i'll look into how we can make react boilerplate tests work after that

That was as a reply to

jest/jasmine does not support generator functions in test descriptions. We can either add suporrt for it to jest and remove those tests from react boilerplate for now.

@mxstbr Thanks, I guess my question is why was this test function a generator in the first place? What was is supposed to yield? How did you expect generator functions to be handled as test cases?

This is what we do, which works fine with Mocha: https://github.com/mxstbr/react-boilerplate/blob/master/app/containers/HomePage/tests/sagas.test.js#L85-L91
I'm not married to this, if somebody has a better way of testing these that works with Jest as-is I'm happy to merge that 😊

@mxstbr I’m just not sure why this function is a generator at all. It doesn’t yield, does it?

You are right, me neither. Let's get rid of it, ignore this PR and merge Jest into r-b!
Sorry for the troubles! blushesfuriously

Just ran into this converting a bunch of tests that use generators from mocha to jest.

@garth Why were the functions written as generators? Can you show an example? I think we're open to adding support but it's just not clear what the semantics are supposed to be.

Generator tests are mainly backend, for example:
    it('returns 404 for wrong username/password', function* () {
        const res = yield server.inject({
             method: 'POST',
             url: '/login',
             payload: {
                 username: 'bar',
                 password: 'foo'
             }
         });
        expect(res.statusCode).to.equal(404);
     });
 });

I've now converted them to return promises, but would have been nice to have it work with generators.

Why not use async / await?
    it('returns 404 for wrong username/password', async () => {
        const res = await server.inject({
             method: 'POST',
             url: '/login',
             payload: {
                 username: 'bar',
                 password: 'foo'
             }
         });
        expect(res.statusCode).to.equal(404);
     });
 });

Unlike ad-hoc special treatment of generators returning promises, async / await is (almost) well-specified part of the language designed specifically for this.

Yep, that works also. Either way I had to redo them. Not a big issue, just a mechanical task to convert.

authors: codecov-io cpojer dmitriiabramov gaearon garth mxstbr


text:
Feature: support $convertFromMarkdownString in a headless environment

Description
Currently, as far as I can tell, $convertFromMarkdownString does not work in a headless (Node.js) environment. I believe this may be because it depends on the DOM.
Using the headless editor and calling $convertFromMarkdownString on valid markdown content seems to just result in an empty lexical structure being created. It seems like it (silently) fails to create nodes or get some other response back from DOM APIs.
Impact
This could help users working with the Ghost blogging platform, for example. If a solution was found, it could allow users to benefit from more extensive integrations where editing blog content can be done programmatically, via APIs etc (in particular, allow users to send markdown to Ghost's content API). Currently, awkward conversion steps are required to programmatically update content, or you're forced to work with a more complex format like html.

I don't think this is the case, but even if it was, you can use jsdom in a headless environment when dom is needed

@etrepum I have tried jsdom as a workaround, with no luck. I even proxied document to spy on DOM calls but didn't see any.
Here is a small repro that seems to result in an empty lexical structure:
import { $convertFromMarkdownString, TRANSFORMERS } from "@lexical/markdown";
import { CodeNode } from "@lexical/code";
import { createHeadlessEditor } from "@lexical/headless";
import { HeadingNode, QuoteNode } from "@lexical/rich-text";
import { LinkNode } from "@lexical/link";
import { ListNode, ListItemNode } from "@lexical/list";
import { ParagraphNode, TextNode, EditorState } from "lexical";

function convertMarkdownToLexical(markdown: string): string {
  const editor = createHeadlessEditor({
    nodes: [
      HeadingNode,
      ParagraphNode,
      TextNode,
      LinkNode,
      ListNode,
      ListItemNode,
      CodeNode,
      QuoteNode,
    ],
  });

  editor.update(() => {
    $convertFromMarkdownString(markdown, TRANSFORMERS);
  });

  const editorState: EditorState = editor.getEditorState();

  console.log(editorState.toJSON()); // Produces an empty structure

  return JSON.stringify(editorState.toJSON());
}

convertMarkdownToLexical("# This is a heading\n\nThis is some content");

Maybe I am missing something?

If you provide something runnable somewhere like stackblitz or codesandbox I'll take a look. In situations where DOM is needed you will need to set globalThis with window and document for the duration of the call.

Ok looking closer at your example, the reason why you're getting an empty editor is that you're using editor.update and expecting the update to be reconciled to the editorState synchronously. You need to use editor.update(…, {discrete: true}); in this use case.
https://lexical.dev/docs/concepts/editor-state#synchronous-reconciliation-with-discrete-updates

@etrepum you are right, thanks a lot!
The types led me to believe this option was defaulting to true:
export type EditorUpdateOptions = {
    onUpdate?: () => void;
    skipTransforms?: true;
    tag?: string | Array<string>;
    discrete?: true;
};

That type means the opposite, false can't be explicitly specified.

authors: etrepum sgb-io

repo: facebook/lexical


text:
Unknown field t1.c1:array

After renaming a column in Hive:
ALTER TABLE t1 CHANGE COLUMN old_c1 c1 array\<bigint\>

This throws an exception:
SELECT * FROM t1
Query failed: Unknown field t1.c1:array\<bigint\>
java.lang.IllegalArgumentException: Unknown field t1.c1:array\<bigint\>
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
	at com.facebook.presto.sql.analyzer.TupleAnalyzer.visitTable(TupleAnalyzer.java:252)
	at com.facebook.presto.sql.analyzer.TupleAnalyzer.visitTable(TupleAnalyzer.java:135)
	at com.facebook.presto.sql.tree.Table.accept(Table.java:36)
	at com.facebook.presto.sql.tree.AstVisitor.process(AstVisitor.java:22)
	at com.facebook.presto.sql.analyzer.TupleAnalyzer.analyzeFrom(TupleAnalyzer.java:958)
	at com.facebook.presto.sql.analyzer.TupleAnalyzer.visitQuerySpecification(TupleAnalyzer.java:349)
	at com.facebook.presto.sql.analyzer.TupleAnalyzer.visitQuerySpecification(TupleAnalyzer.java:135)
	at com.facebook.presto.sql.tree.QuerySpecification.accept(QuerySpecification.java:98)
	at com.facebook.presto.sql.tree.AstVisitor.process(AstVisitor.java:22)
	at com.facebook.presto.sql.analyzer.StatementAnalyzer.visitQuery(StatementAnalyzer.java:520)
	at com.facebook.presto.sql.analyzer.StatementAnalyzer.visitQuery(StatementAnalyzer.java:115)
	at com.facebook.presto.sql.tree.Query.accept(Query.java:80)
	at com.facebook.presto.sql.tree.AstVisitor.process(AstVisitor.java:22)
	at com.facebook.presto.sql.analyzer.Analyzer.analyze(Analyzer.java:52)
	at com.facebook.presto.execution.SqlQueryExecution.doAnalyzeQuery(SqlQueryExecution.java:252)
	at com.facebook.presto.execution.SqlQueryExecution.analyzeQuery(SqlQueryExecution.java:238)
	at com.facebook.presto.execution.SqlQueryExecution.start(SqlQueryExecution.java:202)
	at com.facebook.presto.execution.QueuedExecution.lambda$start$163(QueuedExecution.java:68)
	at com.facebook.presto.execution.QueuedExecution$$Lambda$222/659591746.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

This is caused by #3105

authors: electrum joy-yao

repo: facebook/presto


text:
Added simple mulltisecond case

Implement date_diff('millisecond', x, y) #2599

Could you add some tests?

It's hard to test it because joda library doesn't provided method to get millisecond difference. I had tried different manner but I've stucked on computing too big numbers. I can force to write sth ugly but I'm not sure about it.

Merged. Thanks!

authors: Myrthan cberner


text:
Adjust few TypeScript's documentation formatting

What
This PR has only documentation formatting adjustments.
I have added some new indentation where needed in the code example and add a missing space in style declaration.

Thanks for submitting these!

authors: luisfmsouza rachelnabors

repo: facebook/react-native-website


text:
Update docs related to position to account for static

position: static has existed for some time now, but no documentation on it, so I updated all of that for position that I could find. Besides the docs themselves, the only other thing I updated was the package.json for the linting examples. That was linting against RN 0.73, so I changed it to be the same as the expo version that is running on the website snippets which is 0.74.1

https://github.com/user-attachments/assets/9a59a610-4777-46d5-b0db-41eb14ab0268
https://github.com/user-attachments/assets/a494afe3-8b12-400e-bcac-8397299df00c

That was linting against RN 0.73, so I changed it to be the same as the expo version that is running on the website snippets which is 0.74.1

Any chance we could update this to the 0.76 RC? That would be needed to add the docs for boxShadow and filter.

We have some other new arch layout props that were previously being excluded from documentation, that we could also add 😅. I had a todo here for myself. https://github.com/facebook/react-native/commit/3b44182c1d5f880f3253354d16707a81d1ea66d5

@joevilches There is no need to take screenshots and videos when editing the docs.
Our automation will deploy your diff to a staging website, so reviewers can explore your changes themselves! ;)
But thanks for doing that!

That was linting against RN 0.73, so I changed it to be the same as the expo version that is running on the website snippets which is 0.74.1

Any chance we could update this to the 0.76 RC? That would be needed to add the docs for boxShadow and filter.

Yeah I can. I think the expo playgrounds we use will be on 74, but its also old arch anyway so the point is moot in reference to boxShadow and filter

@cipolleschi done!

authors: NickGerleman cipolleschi joevilches


text:
'react-native init MyApp --template demo' is not work

react-native init MyApp --template navigation is OK for me , but why react-native init MyApp --template demo  is not.

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

authors: MarnoDev hramos

repo: facebook/react-native


text:
[Navigator] Components of inactive Navigator scenes intercepting touch events

With master (0.5.0-rc) I occasionally encountered touch events being received by components in a scene that's not visible but is in my initial route stack. The initial route stack has two scenes, the bottom scene and top scene. The initial route is the bottom scene's.
Some touches in the bottom scene are sent to the components in the top scene, even though the top scene isn't active. That is, the bottom scene is still visible and has focus. The top scene has never been pushed/jumped to.
Looking at the UIView hierarchy, the root of the top scene is 0px wide and 667px tall and its children are not clipped. If it makes sense for the Navigator to mount scenes that aren't active, it might make sense to implement visibility: hidden (#1322) so that only the shadow views are created. In the meantime, opacity: 0 seems to stop intercepting the touch events.

@ide Do you have any update here? I have the same at the moment

I dont really know what you mean with "opacity:0" here - should I set it dynamically on all inactive scenes?

Yes but this works only on iOS.

But thats not really a good solution, is it? Gives a lot of non-functional code for something which sounds like a bug for me. Can you give me a hint how to tackle this issue by creating a PR?

It's not a great solution which is why I only use it in my own copy of react native. The problem is that navigator hides scenes using overflow:hidden on a zero-width element but the overflowing elements still receive touches. There's also that prop to clip overflowed subviews that might work as well though I haven't tried it. If you discover a good approach you could submit a PR.

Another approach is to use initialRoute instead of initialRouteStack.

Adding
            removeClippedSubviews={true}

worked. I'll create a PR for that, or do you see any disadvantage here?

I would send the PR and then the engineers at FB working on navigator could take a look at it. It seems like a good approach to me though.

authors: PhilippKrone ide


text:
Discussion: react-devtools dependency still has PATENTS file

The react-devtools-core dependency in package.json still has the PATENTS file, effectively meaning that React Native is still impacted by that.
To Reproduce
Inspect the react-devtools repo and observe that it's still under the BSD 3-clause LICENSE and critically, still has the PATENTS file.
I've also scanned all Facebook dependencies of a clean React Native CLI install:

Install a sample React Native project via the current CLI: react-native init TodoLicense
Install license-checker: npm i -h license-checker
license-checker --json > rn-licenses.json
Install jq
Run jq '[.[] | select(.repository | tostring | contains("facebook")) | { (.repository): .licenses } ] | unique | add' rn-licenses.json
Manually inspect the resulting repos.  I did this, and all are in the clear re: PATENTS except react-devtools.

Expected Behavior
React Native is no longer (transitively!) affected by the PATENTS file clause.  I believe this was an oversight from the previous switch of React Native's own license.
The corresponding issue has been also been filed as facebook/react-devtools#1342

Please bring this up on the react-devtools repo. We should be able to get it removed.

authors: cpojer jwhitley


text:
[iOS] Crash in RCTWebSocketModule didFailWithError

Description:
We're seeing some crashes in our Crashlytics dashboard with the following error:
Fatal Exception: NSInvalidArgumentException
*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]

coming from
RCTWebSocketModule.m
-[RCTWebSocketModule webSocket:didFailWithError:]

React Native version: 0.61.5
Steps To Reproduce
Unknown, although having a WebSocket would be a good start to reproduce.
Expected Results
The app should not crash.

This issue exists for a long time. The reason is the socketID and error in RCTWebSocketModule.m could sometimes be nil .
I patched the file like below and it never bothered me again.
-    @"message": error.localizedDescription,
-    @"id": socketID
+    @"message": error.localizedDescription ?: @"",
+    @"id": socketID ?: @(-1)

Can you produce a minimal repo so we can narrow this down? (e.g. a Snack or pointer to a repo of a minimal repo)
You provided the version (thank you!), but can you run 'react-native info' to get the rest of the context?

Can you produce a minimal repo so we can narrow this down? (e.g. a Snack or pointer to a repo of a minimal repo)
You provided the version (thank you!), but can you run 'react-native info' to get the rest of the context?

Hello! Sorry, it took me a while to get you this info. There you:
System:
OS: macOS Mojave 10.14.6
CPU: (3) x64 Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz
Memory: 10.96 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.13.0 - ~/.nvm/versions/node/v12.13.0/bin/node
npm: 6.14.3 - ~/.nvm/versions/node/v12.13.0/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
IDEs:
Xcode: 11.3.1/11C505 - /usr/bin/xcodebuild
npmPackages:
@react-native-community/cli: 3.0.4 => 3.0.4
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5

As for steps to reproduce, I can't really help you with that, I'm sorry

This issue still occurs

authors: Etienne-M chrisglein luatnd xiao99xiao


text:
ERROR: “ 'backgroudColor' is not supported by native animation module”. Not using native animation module. (iOS & Android)

I am aware that native react animations do not support 'color' animations. I am not using native animation module. And the color animation on the Animated.View works completely fine. but the catch is i get this error as soon as i touch the TouchableOpacity which has wrapped my Animated.View or if i switch screen. Here is the code of my component:
  constructor(props){
   super(props){
      this.state = {
         srcollY : new Animated.Value(0)
      }
   }
}
renderSearchBar(){
        const searchBarWidth = this.state.scrollY.interpolate({
            //some range
        });
        const colorSearchBar = this.state.scrollY.interpolate({
            //some range
        });
      return (
            <View style={[styles.searchBarOuterContainer, { marginTop: moderateScale(searchBarMargin) }]}>
                <TouchableOpacity style={{ height: "100%", width: '90%', transform: [{ scaleX: searchBarWidth }] }} onPress={() => alert("open hotel")}>
                    <Animated.View elevation={5} style={[styles.searchBarInnerContainer,{backgroundColor:colorSearchBar}]}>
                        <Text style={styles.placeholderContainer}>
                            //some text
                        </Text>
                        <View style={styles.searchIconContainer}>
                            <Image
                                source={constants.SEARCH_ICON}
                                style={styles.searchIcon}
                                onTouchStart={() => console.log("po")}
                            />
                        </View>
                    </Animated.View>
                </TouchableOpacity>
            </View>
        );
}
render() {

        return (
            <Animated.View style={styles.container} onLayout={(e) => this.setScreenHeight(e)}>
                <ScrollView onScroll={
                    Animated.event(
                        [{ nativeEvent: { contentOffset: { y: this.state.scrollY } } }],
                    )}
                    scrollEventThrottle={16}
                    stickyHeaderIndices={[1]}
                >
                    {this.renderSomething1()}
                    {this.renderSearchBar()}
                    {this.renderSomething2()}
                </ScrollView>

            </Animated.View>
        );
    }

What i am trying to achieve is a search bar at the middle of the screen which has some translucent color and is not covering full screenWidth, when the view is scrolled the search bar stick at top with full screenWidth and opaque color. The animation works perfectly fine exactly the way i want it. but as soon as i tap on the ToucableOpacity i get the error:
backgroundColor is not supported by native animation module
when i dismiss that error and tap on the touchableOpacity again the alert on its onPress() works just fine. same thing happen if i move from this screen to another and then come back again.
I do not under why i get this error when i am not using native animation module. Even though the default value of useNativeDriver is false i still tried explicitly defining it as false but it didn't help.
React Native version: 0.59

@krishnagupta71 I solved replacing Animated.event with a function that call yourAnimation.setValue(yOffset)


text:
[Android] XMLHttpRequest response doesn't return response headers

While writing the android code for the app, the XHR is sent to the server and returned successfully, with the correct response text. However, there are no response headers.
I've been using XHR directly, and i checked this by using the superagent library and it yields the same result.
Both methods work correctly in the iOS app with headers and everything.

I've a pull request open for this - https://github.com/facebook/react-native/pull/3062