Why same browserslist option makes different target results - browser

I'm using browserslist option on package.json in two projects. One is react, and the other is next.js project. But I could find when I put debug: true option on babel and check actual targets, I could see they are having different target results.
"browserslist": [
">0.25%",
"android >= 4.2",
"ios_saf >= 10",
"and_chr >= 56",
"ie 11"
]
I'm using option above.
In next.js project the result is
{
"android": "4.2",
"chrome": "56",
"edge": "97",
"firefox": "96",
"ie": "11",
"ios": "10",
"opera": "83",
"safari": "13.1",
"samsung": "16"
}
However, the result from react project is
{
"android": "4.2",
"chrome": "49",
"edge": "18",
"firefox": "74",
"ie": "11",
"ios": "10",
"opera": "67",
"safari": "12.1",
"samsung": "4"
}
How same browserslist option can have different target output?

Related

detect if mobile or tablet with logstash v7 filter user-agent

Using logstash v7, filter user-agent, How can I get information about device type?
I got:
{
"version": "92.0.4515.105",
"name": "Chrome",
"device": "Huawei Browser",
"os_major": "10",
"minor": "0",
"os_version": "10",
"os_name": "Android",
"major": "92",
"patch": "4515",
"os_full": "Android 10",
"os": "Android"
}
I see this is not possible with UAP library (https://github.com/ua-parser/uap-core/issues/31) and elasticsearch have done its own implementation for ingest pipeline feature: https://github.com/elastic/elasticsearch/pull/69322 .
I really want to stay with logstash, is that possible?

v8 no local variables in debugger

I compiled v8 on Linux Min 20.2 using VsCode.
My build tasks.json task looks like this
"tasks": [
{
"label": "gm x64.debug all",
"type": "shell",
"command": "tools/dev/gm.py x64.debug all",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "dedicated",
"clear": true
},
"problemMatcher": {
"fileLocation": [
"relative",
"${workspaceFolder}out/x64.debug/"
],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
launch.json config
{
"name": "(gdb) launch hello_world",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/out/x64.debug/v8_hello_world",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
Breakpoints working well also callstack is available but there is no local variables.
I use extension "C/C++ (by Microsoft)".
How I can enable them?
(V8 developer here.)
Inspecting local variables should work by default. You could try running the compiled binary in GDB to see if something is missing from the binaries, or it's an issue with VSCode's integrated debugger or its configuration.
One thing to keep in mind is that tools/dev/gm.py will not overwrite existing build settings. If you e.g. manually put symbol_level = 1 or v8_optimized_debug = true (two examples for settings that will break your debugging experience) into out/x64.debug/args.gn, then gm.py will maintain these settings, assuming that you put them there on purpose. To get back to the defaults, you can rm -rf out/x64.debug. You can also look up the default settings in gm.py's source.

How to show gcc compiler warnings in VSCode terminal of a .c file

I have the C/C++ ms-vscode.cpptools extension installed (and the Code Runner).
This is my task.json
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: gcc build active file",
"command": "/usr/bin/gcc",
"args": [
"-g",
"-Wall",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "compiler: /usr/bin/gcc"
}
]
Note the -Wall option in the args part.
When I compile and run the code the warnings don't show up in my terminal, the errors only.
Am I missing something?
Solved it was the configuration of code runner to be edited as well.
"code-runner.executorMap": {
...
"c": "cd $dir && gcc -Wall $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
...
Now if I build via VSCode and via code runner I have my warnings displayed.

TypeError: Object.values is not a function -- How to correctly polyfill with babel-preset-env in jest?

I get the following error after upgrading to Jest v20 where they removed the automatic babel-polyfill due to memory leaks:
TypeError: Object.values is not a function
I realize I need to polyfill this on my own now, I am using babel-preset-env and have the following .babelrc file:
"env": {
"development": {
"plugins": ["transform-react-jsx-source"]
},
"test": {
"presets": [
"react",
"stage-3",
["env", {
"targets": {
"browsers": [
"firefox >= 36",
"chrome >= 38",
"opera >= 25",
"safari >= 9",
"ios >= 9"
],
"node": "6.11.4"
},
"useBuiltIns": "usage",
"include": ["es7.object.values"],
"debug": true
}],
"jest"
],
"plugins": [
"transform-class-properties"
],
}
}
I can see that es7.object.values is being polyfilled in the debug output:
Using polyfills:
...
es7.object.values {"chrome":"38","firefox":"36","ios":"9","safari":"9","node":"6.11.4"}
But I am still getting the error message, help!
Some of the options are:
bump node version to the one supporting Object.values (which
seems to be 7.0 judging from this answer),
polyfill it using babel-polyfill (via import 'babel-polyfill' in setupTests.js file).
In my case, the Node version was the reason.
I just updated the node 6 to node 7 and it fixed.

SublimeREPL scala error... Same error, but existing solution does not fix the issue

While running SublimeREPL: SBT for opened folder, I have the exact same problem as in The similar question asked before (OSError(2, 'No such file or directory')).
Unofrtunately, the solution provided there did not help much.
Would anybody be kind enough to give some clues as to what might still be wrong here?
I'm currently running Ubuntu 12.04.
My Main.sublime-menu config is as follows:
[
{
"id": "tools",
"children":
[{
"caption": "SublimeREPL",
"mnemonic": "r",
"id": "SublimeREPL",
"children":
[
{"caption": "Scala",
"id": "Scala",
"children":[
{"command": "repl_open",
"caption": "scala REPL",
"id": "repl_scala",
"mnemonic": "s",
"args": {
"type": "subprocess",
"encoding": "utf8",
"external_id": "scala",
"cmd": {"linux": ["scala"],
"osx": ["scala"],
"windows": ["scala.bat", "-i"]},
"soft_quit": "\nexit\n",
"cwd": "$file_path",
"cmd_postfix": "\n",
"extend_env": {"osx": {"EMACS": "1", "PATH": "{PATH}:/home/helluin/apps/sbt/bin"},
"linux": {"EMACS": "1", "PATH": "{PATH}:/home/helluin/apps/sbt/bin/"},
"windows": {"EMACS": "1"}},
"suppress_echo": false,
"syntax": "Packages/Scala/Scala.tmLanguage"
}
},
{"command": "repl_open",
"caption": "SBT for opened folder",
"id": "repl_sbt",
"mnemonic": "b",
"args": {
"type": "subprocess",
"encoding": "utf8",
"external_id": "scala",
"cmd": {"linux": ["sbt"],
"osx": ["sbt"],
"windows": ["sbt"]},
"soft_quit": "\nexit\n",
"cwd": "$folder",
"cmd_postfix": "\n",
"extend_env": {"osx": {"EMACS": "1", "PATH": "{PATH}:/usr/bin"},
"linux": {"EMACS": "1", "PATH": "{PATH}:/usr/bin"},
"windows": {"EMACS": "1"}},
"suppress_echo": false,
"syntax": "Packages/Scala/Scala.tmLanguage"
}
}
]}
]
}]
}
]
Also, the scala and sbt system paths are defined thusly
λ → which scala
/usr/bin/scala
λ → which sbt
/home/helluin/apps/sbt/bin/sbt
You have your paths mixed up. The "caption": "scala REPL" menu item has scala as its command, but the extended PATH is /home/helluin/apps/sbt/bin. The "caption": "SBT for opened folder" item has sbt as its command, yet the extended PATH is /usr/bin. You should switch them.
Alternatively, for the Scala REPL, make the first line of the command:
"cmd": {"linux": ["/usr/bin/scala"],
(although /usr/bin should already be in the system PATH). For the sbt REPL, make the first line of the command:
"cmd": {"linux": ["/home/helluin/apps/sbt/bin/sbt"],
and then you don't need to worry about extending that particular environment variable.

Resources