text:
Add support for private object/class methods

If the name of a class or object method starts with an underscore, then make it a
private method.  It can be used by class/object methods in the current class
and by classes derived from the current class.

A coding pattern I use more and more frequently  in another language is private constructor and static method that returns an object. I have no idea how useful that would be in vim9script. Of course it's a moot point at this time since
vim9script
class C
    static def Create(): C
    enddef
endclass

gives E1010: Type not recognized: C
And a private constructor could be added later without breaking source compatibility.

Doh! But the following does work
vim9script
class C
    static def Create(): any
        return C.new()
    enddef
endclass

var x: C = C.Create()

To recap, when a class variable is declared "public" it is readable and
writable from outside the class. If "public" is omitted, the variable is
readable but not writable. If the variable name starts with an underscore,
it's private and neither readable nor writable from outside the class.

Yes.  Just to clarify, this PR introduces the support for private class/object
methods and doesn't change the accessibility of the class/object members
described above.

This is already quite a lot to remember, imo.
In my opinion the current syntax for classes is too complex. I would remove
the "public" keyword entirely and just use underscores for both variables and
methods. There's no need for read-only class variables. If someone needs to
access a variable from outside the class just write a setter like in any
other language. Vimscript should stay as simple as possible.
Like others already mentioned on vim_dev, an alternative to underscores is
to use "public" and "private" access modifiers for both variables and
methods.

I do have the changes ready to make the object members "public" by default.
I will send a separate email on this and open a separate PR.

I have created the PR https://github.com/vim/vim/pull/12932 to make the member variable access
public by default.

Like others already mentioned
that maybe was me?
aha, i've pointed out several times, but not sure the final version was going to be now -_-#
anyway, maybe it was designed to be completed and secured, but truly a bit complex,
if you insist leading underscore was better for private var/method, it's ok,
but meanwhile perhaps we may no need public/private keyword anymore,
as for interface/abstract (and 'static'?), vim9 maybe basic class was good enough, specially for scripting.

authors: Shane-XB-Qian errael yegappan


text:
Problem: Hollywood 9 syntax highlighting not supported.

Solution: Update the existing Hollywood Vim syntax file.

Standard answer: Have you contacted the maintainer?

Yes (strictly speaking it was the other way around, he contacted me so that I could integrate this).

Yes (strictly speaking it was the other way around, he contacted me so
that I could integrate this).

So are you the maintainer now?
--
hundred-and-one symptoms of being an internet addict:
110. You actually volunteer to become your employer's webmaster.
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \
///                                                                      \
\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

No, I was just asked by the maintainer to upstream the latest version since I'm currently  doing most of the Amiga specific work, see MUI-Vim.

OK, so I'll just include this without adjusting the maintainer.

source: gharchive/pull-request

authors: brammool sodero

repo: vim/vim

license: Vim

license_type: permissive

license_source: github-api


text:
Speed up vim9 hot function exec_instructions()

Patch 8.2.3199 was meant to speed up vim9 slightly,
but it slows down slightly for me.
Here are perf measurements of the vim9 sum benchmark.
I tried to measure when my machine is as idle
as possible (no web browser running, etc.).
I waited for my machine to be idle for ~ 1 min
in all cases to try to rule out CPU throttling
due to CPU temperature. All measurements are done
3 times (to assess stability) with clang-12 -O2
with a i7-7700T CPU @ 2.90GHz CPU.
version        3 measurements of vim9 speed in sec.
------------   ----------------------------
Vim-8.2.3204   0.149043  0.145434  0.145422
Vim-8.2.3202   0.144110  0.144017  0.144112
Vim-8.2.3200   0.143610  0.144038  0.143227
Vim-8.2.3199   0.151458  0.151073  0.150976
Vim-8.2.3198   0.133861  0.134268  0.133766

These are strange results:

Vim-8.2.3199 was meant to speed up, but it actually
slows down. Looking at the patch, I could not see
why it would speed up. A local variable should be
faster in general and the local variable breakcheck_count
was reset more often, hence calling line_breakcheck()
less often.  At least that can explain why Vim-8.2.3199
is slower than Vim-8.2.3198
I also don't understand why a small speed improvement
happened between Vim-8.2.3199 and Vim-8.2.3200.  I could
not believe it, but rebuilding and remeasuring shows
consistent results.  It looks like random changes that
can make the optimizer take different decisions.

Then I built Vim-8.2.3204 (latest) after:

(a) reverting patch 8.2.3199 as it looks wrong
(b) same as (a) + moving got_int check to check
it less often. I'm not 100% sure it's correct,
but I think it is OK to not check got_it in each iteration.
(c) same as (b) + use the unlikely(...) macro to help
branch prediction (which can move cold branch code
improving instruction cache hit and improve branch
prediction when there are too many branches for the
dynamic prediction to work well.
I only used unlikely(...) in a fee places but if adopted
in Vim, it would most certainly have other valid uses
We should not abuse it because programmers can
notoriously get it wrong. Only use it for things
that are clearly rare condition (e.g. error paths
such as alloc errors).
This is the fastest version so far, which is
propose change in this PR.

(a)  0.134506  0.134516  0.134490 (perf regression is fixed)
(b)  0.129192  0.129184  0.129165 (even better)
(c)  0.124428  0.124558  0.124313 (even better)

Your mileage may vary, but the improvement makes sense to
me at least. Independent perf measurement with -O2 is welcome
to confirm the speed up with the Vim9 sum benchmark.

Dominique wrote:

Patch 8.2.3199 was meant to speed up vim9 slightly,
but it slows down slightly for me.

This can depend on a lot of things.  First of all the compiler, what
instruction it generates for variables on the stack and in global
memory.  And especially caching mechanisms, which depend on the type of
processor, branch prediction, etc.  You are using an Intel i7, I'm using
an AMD Ryzen, that can make a big difference on specific instruction
sequences.

Here are perf measurements of the vim9 sum benchmark.
I tried to measure when my machine is as idle
as possible (no web browser running, etc.).
I waited for my machine to be idle for ~ 1 min
in all cases to try to rule out CPU throttling
due to CPU temperature. All measurements are done
3 times (to assess stability) with clang-12 -O2
with a i7-7700T CPU @ 2.90GHz CPU.
version        3 measurements of vim9 speed in sec.
------------   ----------------------------
Vim-8.2.3204   0.149043  0.145434  0.145422
Vim-8.2.3202   0.144110  0.144017  0.144112
Vim-8.2.3200   0.143610  0.144038  0.143227
Vim-8.2.3199   0.151458  0.151073  0.150976
Vim-8.2.3198   0.133861  0.134268  0.133766

These are strange results:

Vim-8.2.3199 was meant to speed up, but it actually
slows down. Looking at the patch, I could not see
why it would speed up. A local variable should be
faster in general and the local variable breakcheck_count
was reset more often, hence calling line_breakcheck()
less often.  At least that can explain why Vim-8.2.3199
is slower than Vim-8.2.3198
I also don't understand why a small speed improvement
happened between Vim-8.2.3199 and Vim-8.2.3200.  I could
not believe it, but rebuilding and remeasuring shows
consistent results.  It looks like random changes that
can make the optimizer take different decisions.

That is one of the problems with using a small piece of code to
benchmark with.  It would be much better to have much more code, so that
changes in one specific sequence are averaged.
Years ago I had a reliable line-by-line profiler on MS-Windows.  It
shows the exact number of times each line of code is executed, not an
estimate like many profilers do.  That was a fantastic tool.
Unfortunately, I'm not aware of such a tool available right now.

Then I built Vim-8.2.3204 (latest) after:

(a) reverting patch 8.2.3199 as it looks wrong
(b) same as (a) + moving got_int check to check
it less often. I'm not 100% sure it's correct,
but I think it is OK to not check got_it in each iteration.
(c) same as (b) + use the unlikely(...) macro to help
branch prediction (which can move cold branch code
improving instruction cache hit and improve branch
prediction when there are too many branches for the
dynamic prediction to work well.
I only used unlikely(...) in a fee places but if adopted
in Vim, it would most certainly have other valid uses
We should not abuse it because programmers can
notoriously get it wrong. Only use it for things
that are clearly rare condition (e.g. error paths
such as alloc errors).
This is the fastest version so far, which is
propose change in this PR.

(a)  0.134506  0.134516  0.134490 (perf regression is fixed)
(b)  0.129192  0.129184  0.129165 (even better)
(c)  0.124428  0.124558  0.124313 (even better)

Your mileage may vary, but the improvement makes sense to
me at least. Independent perf measurement with -O2 is welcome
to confirm the speed up with the Vim9 sum benchmark.

I'm afraid that not checking got_int every time might cause subtle
problems.  E.g. when there is a hit-entry prompt and the user hits
CTRL-C, we should not continue executing commands.
Perhaps you can see how much impact using unlikely() has when still
changing got_int every time.
Anyway, thanks for taking the time to investigate.
--
hundred-and-one symptoms of being an internet addict:
215. Your mouse-clicking forearm rivals Popeye's.
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \
///                                                                      \
\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

@brammool wrote:

Years ago I had a reliable line-by-line profiler on MS-Windows.  It
shows the exact number of times each line of code is executed, not an
estimate like many profilers do.

You can do that with callgrind, which is a tool of valgrind:
$ cd sb/vim/src
$ valgrind --tool=callgrind ./vim --clean

Then do something like run a benchmark then exit vim
It will create file like callgrind.out.21479 which can be
viewed with the GUI (sudo apt-get install kcachegrind):
$ kcachegrind callgrind.out.21479.

Order function by self time. Choose an expensive function
such as exec_instructions() and in the tab "Source file" you
can see the cost estimation of each line of code.
Alternatively, gprof can do line-by-line profiling which
shows the number of times a line is executed:
https://ftp.gnu.org/old-gnu/Manuals/gprof-2.9.1/html_node/gprof_17.html
https://ftp.gnu.org/old-gnu/Manuals/gprof-2.9.1/html_node/gprof_18.html

@brammool wrote:

Perhaps you can see how much impact using unlikely() has when still
changing got_int every time.

Done. I reverted all changes except that I kept (and added more)
likely and unlikely macros.
Measurement with -O2 show an improvement on my CPU but I'm
curious whether other users also see an improvement.

Another way to quantify the improvement
running only the vim9 sum benchmark (I commented
out other benchmarks) with Linux perf:
before change:
$ perf stat ./vim --clean -S sum.vim

 Performance counter stats for './vim --clean -S sum.vim':

        157,521372      task-clock (msec)         #    0,995 CPUs utilized
                40      context-switches          #    0,254 K/sec
                 0      cpu-migrations            #    0,000 K/sec
              1099      page-faults               #    0,007 M/sec
         455607848      cycles                    #    2,892 GHz
        1184569263      instructions              #    2,60  insn per cycle
         293454405      branches                  # 1862,950 M/sec
            451811      branch-misses             #    0,15% of all branches

       0,158294766 seconds time elapsed

After change:
$ perf stat ./vim --clean -S sum.vim

 Performance counter stats for './vim --clean -S sum.vim':

        141,646945      task-clock (msec)         #    0,994 CPUs utilized
                39      context-switches          #    0,275 K/sec
                 0      cpu-migrations            #    0,000 K/sec
              1099      page-faults               #    0,008 M/sec
         409684366      cycles                    #    2,892 GHz
        1184378595      instructions              #    2,89  insn per cycle
         293423499      branches                  # 2071,513 M/sec
            451445      branch-misses             #    0,15% of all branches

       0,142532072 seconds time elapsed

The number of instructions is about the same, but
the instructions per cycle is better and the time elapsed
is improved as a result.

authors: brammool dpelle


text:
description does't work

images = [
      { thumb: './thumbs/img1.jpg', img: './gallery/img1.jpg', description: 'My test 1' },
      { thumb: './thumbs/img2.jpg', img: './gallery/img2.jpg', description: 'My test 2' },
    ];

but in view "Image 1" and "Image 2"

Fixed in my fork https://www.npmjs.com/package/angular-modal-gallery (version 2.0.2)

Hi,
       Thanks for the update. Go ahead.

Thanks,
Vimala

From: Stefano Cappa notifications@github.com
Sent: Tuesday, January 31, 2017 5:54:19 AM
To: vimalavinisha/angular2-image-popup
Cc: Subscribed
Subject: Re: [vimalavinisha/angular2-image-popup] description does't work (#12)
Fixed in my fork https://www.npmjs.com/package/angular-modal-gallery (version 2.0.2)

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com/vimalavinisha/angular2-image-popup/issues/12#issuecomment-276235974, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AKh98EbyHXUgX6jRWI13FiXxKxSZhk4xks5rXn8zgaJpZM4LTvnB.

source: gharchive/issue

authors: Ks89 pozdnyakovasp vimalavinisha

license: mit

license_source: bigquery


text:
json tocsv on my file throws back errors at me

Hi Vinay,
My json file is 1GB and when i run this code on it, these are the following errors below. How can i fix this error, It is very crucial that i decode this json to csv, anyhelp to resolve this and get a good output will be really appreciated. thanks!
Traceback (most recent call last):
File "/Users/pv197/json-to-csv/json_to_csv.py", line 72, in
raw_data = json.loads(json_value)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/init.py", line 310, in loads
return _default_decoder.decode(s)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 346, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 364, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Looking forward to your reply.
sincerely,
PV

Hey, I'm traveling and hence couldn't write to you earlier... Have you
resolved the issue yet?
I don't think the issue here is your file size. Some common causes for
this, when thrown, are...

Invalid JSON (trailing commas, un escaped quotes, et. al.)
Invalid String Encoding

Hope it helps... Let me know
On Monday, November 27, 2017, piyuveng1 notifications@github.com wrote:

Hi Vinay,
My json file is 1GB and when i run this code on it, these are the
following errors below. How can i fix this error, It is very crucial that i
decode this json to csv, anyhelp to resolve this and get a good output will
be really appreciated. thanks!
Traceback (most recent call last):
File "/Users/pv197/json-to-csv/json_to_csv.py", line 72, in
raw_data = json.loads(json_value)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/json/init.py", line 310, in loads
return _default_decoder.decode(s)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py",
line 346, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py",
line 364, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Looking forward to your reply.
sincerely,
PV
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/vinay20045/json-to-csv/issues/15, or mute the thread
https://github.com/notifications/unsubscribe-auth/ACijGMk369NwfG9AXm1EhIfD9-FaWGdrks5s6uJjgaJpZM4Qr572
.

--
Thanks & Regards
Vinay NP
vinay@askVinay.com vinay@askvinay.com
www.askVinay.com http://www.askvinay.com

Thank u vinay I ll try again and let you know...
Sent from my iPhone

On Nov 29, 2017, at 3:04 PM, Vinay NP notifications@github.com wrote:
Hey, I'm traveling and hence couldn't write to you earlier... Have you
resolved the issue yet?
I don't think the issue here is your file size. Some common causes for
this, when thrown, are...

Invalid JSON (trailing commas, un escaped quotes, et. al.)
Invalid String Encoding

Hope it helps... Let me know
On Monday, November 27, 2017, piyuveng1 notifications@github.com wrote:

Hi Vinay,
My json file is 1GB and when i run this code on it, these are the
following errors below. How can i fix this error, It is very crucial that i
decode this json to csv, anyhelp to resolve this and get a good output will
be really appreciated. thanks!
Traceback (most recent call last):
File "/Users/pv197/json-to-csv/json_to_csv.py", line 72, in
raw_data = json.loads(json_value)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/
python2.7/json/init.py", line 310, in loads
return _default_decoder.decode(s)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py",
line 346, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py",
line 364, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Looking forward to your reply.
sincerely,
PV
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/vinay20045/json-to-csv/issues/15, or mute the thread
https://github.com/notifications/unsubscribe-auth/ACijGMk369NwfG9AXm1EhIfD9-FaWGdrks5s6uJjgaJpZM4Qr572
.

--
Thanks & Regards
Vinay NP
vinay@askVinay.com vinay@askvinay.com
www.askVinay.com http://www.askvinay.com
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Hope you had some luck.
I'm closing the issue for now. Please re open it if you want more help.

license: MIT


text:
some acf-extended-specific settings (acfe_*) have no effect

ACF Extended adds some settings to existing fields (prefixed with acfe_). It seems that they have no effect when added to a field via the withSettings() methods. When configuring this setting in the ACF UI, I can confirm that it has the desired effect.
I saw #105 but it seems like I'm running into something else, as I'm running a current version of extended-acf.
The simplest example I found that doesn't require the premium version of that plugin is the "Instruction Placement" addition of a tooltip option to the instruction_placement field setting:
Text::make('Title')
	->instructions('Write an instruction.')
    ->withSettings([
        'instruction_placement' => 'acfe_instructions_tooltip',
    ])

The issue isn't just localised to instruction_placement. I haven't been able to get the Display Title setting working either (though it's possible I'm misunderstanding its intended usage):
Text::make('Title')
    ->withSettings([
        'acfe_display_title' => 'Not a Title',
    ])

However, the issue doesn't affect all ACFE settings. The "stylised button" setting added to Repeater works for me:
Repeater::make('Items')
    ->instructions('Select up to three.')
    ->withSettings([
        'acfe_display_title' => 'The Items', // doesn't work
        'acfe_repeater_stylised_button' => 1, // works!
        'instruction_placement' => 'acfe_instructions_tooltip', // doesn't work
    ])

What is the output when generating PHP from the dashboard using the same settings?

authors: montchr vinkla

repo: vinkla/extended-acf


text:
Move root/tests to example/tests

Modify the template to store the tests related to a module within that module's package directory.

Example: https://github.com/viperior/aequus/tree/main/calc/tests

repo: viperior/python-project-template


text:
[Feature Request] zz to center the current line.

We can use zz to center the current line in Vim.

Unfortunately, This is not supported by Logseq API.

authors: Immortal-Sty vipzhicheng

repo: vipzhicheng/logseq-plugin-vim-shortcuts


text:
Added SEARCHY - search webpage

Issue: #329

Another great work :)


text:
Winfsp tests

Several fixes to bugs found during winfsp-tests execution (and more to come!).

There are some HLK failures. Please check them out.

I know. This was just a PR meant to trigger and check the HLK CI.

repo: virtio-win/kvm-guest-drivers-windows


text:
fix: Change to regexp for certificate-identity URL

Use a backward-compatible regexp for the cert_identity.

Fix #23

repo: virtualroot/asdf-opentofu


text:
add .note.GNU-stack section to remove linker warning

If I build the library with the following command:
md build
cd build
cmake .. -DUSE_AVX512=ON -DENABLE_TEST=ON
make -j

Then, the following warning is printed.
/usr/bin/ld: warning: spqlios-ifft-avx512.s.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker

I make a patch to prevent the warning.
The modification can be applied to the other asm files.

I noticed this PR now......
Since it seems to be not a catastrophic one, I ignored this but your solution seems to be easy. I'll apply it to other asm files.
Thank you for your contribution.

authors: herumi nindanaoto

repo: virtualsecureplatform/TFHEpp


text:
fix: don't convert null arrays to empty array

When you pass a null array,  don't convert it to empty array.  For example:
[Command]
public void CmdTest(int [] data, int [] data2,  int [] data3)
{
     // data should be null,    mirror was giving []
     // data2 should be []
     // data 3 should be [3]
}

public void OnClientStart()
{
    CmdTest(
        null,
        new int[] {},
        new int [] {3});
}

@paulpach did you test this in cubica or ummorpg or similar?

I have not tested it yet with ummorpg,   will do shortly.

Works fine with uMMORPG

:tada: This PR is included in version 3.10.9 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


text:
fix(video-export-panel-container): abort video on unmount, properly unsubscribe mapbox

move this.onStop({abort: true}) to componentWillUnmount
release mapbox map in componentWillUnmount

Pull Request Test Coverage Report for Build 1694949338

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 25.9%

Totals

Change from base Build 1690095582:
0.0%

Covered Lines:
231

Relevant Lines:
776

💛  - Coveralls

authors: coveralls igorDykhta


text:
Fixes the issues raised in  FAQ's section

Now form empty submission issue is resolved.
Hover effect on the social media icon resolved.
Issue Number : #1172
@vishanurag pls review the code and merge it.
pls add label gssoc-ext, hactoberfest-accepted.

@vishanurag sir pls merge my PR

sir pls tell them to merge that @MastanSayyad

Please resolve merge conflicts.

There are lot of errors in this PR.

@vishanurag can i create PR again

this happens due to github bot

repo: vishanurag/Canvas-Editor


text:
superagent global 401 handler

I am using superagent to do my ajax data fetching job.
request
	.get('/some/end/point')
	.end(function(err, res) {

		if (err && res.status === 401) {
			// redirect to login
		}

		// do something with res.body

	});

many of my request need authentication check,
but is that possible to config if (err && res.status === 401) {} globally?
or I should repeat the code in every request I make ?

You can use like this:
var unauthorizedRedirect = function(req) {
  req.on('response', function (res) {
    if (res.status === 401) {
      console.dir('redirects')
      // redirect to login
    }
  });
};

request
  .get('/some/end/point')
  .use(unauthorizedRedirect)
  .end(function(err, res) {
    // do something with res.body
  });

still need add repeat code(use....) in every request

@allces
function authorizedGet(url) {
return request.get(url)
.use(unauthorizedRedirect);
}

thanks for replying,
But I got an question:
how do you know there is a 'response' event on req
and there is a use method?
seems they do not exist on the doc :pig:

@littlee
use method is used in superagent Plugins. I learnt response event from source code, so response event may be changed without notice.

great, learning from source code. :+1:

Since #1302 you can set a plugin for all requests from an agent.

@littlee since you want to avoid repetitive code, here you go:

Define this somewhere in a module file

import superagent from "superagent";
export const request = superagent.agent()
    .use(function(req) {
        req.on('response', function (res) {
            if (res.status === 401) {
                console.dir('redirects')
            }
        });
    });

2, import it to use request,  instead of importing from superagent
import {request} from '../your/local/module';
request.get('/some/end/point')
           .end(function(err, res) {
              // do something with res.body
           });

authors: allces didxga littlee pornel vicanso

repo: visionmedia/superagent


text:
How to set up

Is this still maintained ? Is there any more documentation incoming ?
I'm having troubles using it, first what to use in the template because we find several versions depending on where we look at :
Should we use this directive :
<vis-timeline data="r.timeLineData" options="r.timeLineOptions"></vis-timeline>

Or this one :
<vis-graph2d data="r.timeLineData" options="r.timeLineOptions"></vis-graph2d>

This is the data in my controller :
    this.dataItems = new VisDataSet([
      {start: new Date(2010, 4, 2), end: new Date(2010, 4, 8), content: 'Trajectory A'},
      {start: new Date(2010, 4, 10), end: new Date(2010, 4, 14), content: 'Trajectory B'},
      {start: new Date(2010, 4, 16), end: new Date(2010, 4, 25), content: 'Trajectory C'}
    ]);

    this.dataGroups = new VisDataSet([
      {id: 1, content: 'Group 1'}
    ]);

    this.timeLineData = {items: this.dataItems, groups: this.dataGroups};

    this.timeLineOptions = {"start": '2010-04-01', "end": '2010-04-30'};

The options is set properly since I'm initially seeing the proper range (2010 April) but there is no boxes inside the timeline, no date and no content. So how should I use it ?
Also, if I don't intend to use groups, can we directly do this :
<vis-timeline data="r.dataItems" options="r.timeLineOptions"></vis-timeline>

Yes, this is maintained, but note that this is just a directive that is a wrapper around the main visjs library, so it is just passing your configuration into visjs.

Should we use this directive :

Or this one :

I guess that depends on what you’re trying to do. One is for timeline, and one is for graph2d!!

Well, I want to make a timeline, but shouldn't the above code be working ?
Because I'm only getting an empty timeline and this JS Warning :

mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create

I’m not sure - I don’t currently have time to analyse your code, but have you tried the examples since this is working on github.

The example from vis are working fine, but the indexes from angular-visjs don't.
I'm just gonna use vis natively I guess

Well I just looked at the angular-visas examples on git, and the timeline was working fine!
http://visjs.github.io/angular-visjs/#/timeline http://visjs.github.io/angular-visjs/#/timeline

authors: Seiifer cdjackson

repo: visjs/angular-visjs


text:
[BUG] Hierarchical layout bug with vis-network v9.1.7

I am using vis-network v9.1.7.
This is the options that I am using.
const options = {
    interaction: {
      zoomView: true,
      dragView: true,
    },
    layout: {
      improvedLayout: true,
      hierarchical: {
        enabled: true,
        levelSeparation: 200,
        nodeSpacing: 300,
        treeSpacing: 300,
        blockShifting: true,
        edgeMinimization: true,
        parentCentralization: true,
        direction: 'UD', // UD, DU, LR, RL
        sortMethod: 'hubsize', // hubsize, directed
        shakeTowards: 'leaves', // roots, leaves
      },
    },
  };

When i change direction from UD to LR , the graph breaks with error :
Error in /turbo_modules/vis-network@9.1.7/peer/umd/vis-network.min.js (33:306522) t is not a function
The same can be reproduced with the following online editor:
https://stackblitz.com/edit/react-wp8ct3?file=package.json,src%2FGraph.js
Any idea when will this bug be resolved?
Thanks

Hi, thanks for reporting it. I think that this should be fixed by #2024. Feel free to reopen if I'm wrong.

authors: Thomaash ksrrock

repo: visjs/vis-network


text:
🛑 Element Life is down

In 1f9746c, Element Life (https://elemntlife.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Element Life is back up in 774280f.

repo: vistaardigital/uptime


text:
fix(varnish-cache-preload): Do not completely fail if a chart cannot be loaded

We do not want to fail if a chart takes a long time to load. It could be
due to factors that we do not control like the availability of the database.
Here, we put a limit of 40s for a chart to load, and if it does not we
issue an error in the console, but the script does not crash.

Should fix #1683

repo: visualize-admin/visualization-tool


text:
offline mode: when I navigate to another route, it shows nothing, but when I refresh then it shows the page from cache

Help needed!
Am facing some issues,
when I switched to offline via network tab
(1) when I navigate to another route, initially it shows the blank page, it works only on refresh
(2) Images are not showing, they are not from assets but hosted on another domain, like for ex - https://images.delta.com/name_of_image.jpg
and my configurations looks like this
pwa: {
   strategies: 'generateSW',
   injectRegister: 'auto',
   registerType: 'autoUpdate',
   manifest: {
     name: "Testing app",
     short_name: "Testing app",
     start_url: "/?pwa",
     scope: "/",
     icons: [
         {
             src: "maskable_icon.png",
             sizes: "384x384",
             type: "image/png",
             purpose: "maskable"
         },
         {
             src: "android-chrome-192x192.png",
             sizes: "192x192",
             type: "image/png",
             purpose: "any"
         },
         {
             src: "android-chrome-256x256.png",
             sizes: "256x256",
             type: "image/png"
         },
         {
             src: "icon.png",
             sizes: "512x512",
             type: "image/png"
         }
     ],
     theme_color: "#245BA7",
     background_color: "#000000",
     display: "standalone"
   },
   workbox: {
     navigateFallback: '/',
     globPatterns: ['**/*.{js,css,html,png,PNG,svg,jpg,JPG,jpeg}']
   },
   devOptions: {
     enabled: true,
     type: "module",
     navigateFallback: '/',
   }
 }

also I pre-rendered the nitro routes
// pre-render the routes
async 'nitro:config'(nitroConfig) {
   if (nitroConfig.dev) { return }
   const getMenuItem = useMenuNavigation()
   const response = await fetch(`${process.env.INTERNAL_API_URL}/api/globalMenuItems`)
   const { main_menu } = await response.json()
   if (nitroConfig.prerender && nitroConfig.prerender.routes) {
     nitroConfig.prerender.routes?.push(...main_menu.map((item) => getMenuItem(item).link))
   }
   console.log(nitroConfig.prerender, 'nitroConfig.prerender')
 }

Sorry, if something I missed or wrong, Can anybody please help ?

Sorry wrong repo, it was related to vite-pwa-nuxt3

repo: vite-pwa/docs


text:
PWA in subdirectory tries to load /@vite-plugin-pwa/pwa-entry-point-loaded from incorrect path and therefore fails with 404

Hi,
I am building a PWA that is served from a subdirectory /my/app.
So far, the production build is working fine and also serving the PWA from the root directory via vite and the options
devOptions: {
          enabled: true,
          type: "module",
          navigateFallback: "index.html",
        },

works.
However, if the PWA is served from the subdirectory /my/pwa, the following request fails with 404 as its url is incorrect:
https://machine-name/@vite-plugin-pwa/pwa-entry-point-loaded

If I manually put the url to the browser address and add the subdirectory so that the url is https://machine-name/my/app/@vite-plugin-pwa/pwa-entry-point-loaded, the contents are served correctly. So it is missing the /my/app/ subdirectory part.
This script is trying to be loaded by this injected code to the index.html:
  <script id="vite-plugin-pwa:register-dev-sw" type="module">
import registerDevSW from '/@vite-plugin-pwa/pwa-entry-point-loaded';
registerDevSW();
</script>

It seems this does not respect the vite base as the base in vite.config.ts is set to /my/app/ so the import should be import registerDevSW from '/my/app/@vite-plugin-pwa/pwa-entry-point-loaded';
The result is that the manifest/service worker is not loaded correctly.
I am using the following config:
VitePWA({
        strategies: "generateSW",
        registerType: "autoUpdate",
        workbox: {
          globPatterns: ["**/*.{js,css}"],
          navigateFallback: null,
        },
        manifest: {
          name: "myapp",
          short_name: "myapp",
          start_url: "./",
         ....
        },
        devOptions: {
          enabled: true,
          type: "module",
          navigateFallback: "index.html",
        },
})

I already tried setting base in the VitePWA config additionally to the vite config base but it did not help.
Is there anything else I might be missing to make this work?

@ceisele-r you I'll try to fix it using another name for that virtual, try to test dev without base, or if using base disable dev options for the sw.

@userquin thank you for looking into this.
Both of your mentioned possibilities work:

Dev without base works correctly and the SW is available
As well as using a subdirectory base with disabled Dev options for VitePWA (of course then the SW is not available which is a workaround but not ideal).

It would be great if this virtual respects the base, though. Thank you!

@ceisele-r fixed on https://github.com/vite-pwa/vite-plugin-pwa/releases/tag/v0.14.7

@userquin thank you very much!

authors: ceisele-r userquin

repo: vite-pwa/vite-plugin-pwa


text:
    docs: update algolia appId and key

New updates on head repo.
https://github.com/vitejs/vite/commit/b26b84b568388790c78577e09868aadddad9799d

対応します

authors: jay-es kiaking

repo: vitejs/docs-ja


text:
Vite dynamic import is not available on android5/chrome 39

Describe the bug
router/index.js
import Vue from 'vue'
import Router from 'vue-router'

import IndexPage from '@/views/Index/index.vue'

const ListPage = () => import('@/views/List/index.vue')

Vue.use(Router)

const router = new Router({
  routes: [
    {
      path: '/',
      redirect: 'index',
      component: IndexPage,
      children: [
        {
          path: 'index',
          component: IndexPage,
          name: 'Index',
          meta: {
            title: 'index'
          }
        }
      ]
    },
    {
      path: '/list',
      name: 'List',
      component: ListPage,
      meta: {
        title: 'list'
      }
    }
  ]
})

router.afterEach(function (transition) {
  document.title = transition.meta.title || transition.meta.name || ''
})

export default router

vite.config.js
import path from 'path'
import { defineConfig } from 'vite'
import legacy from '@vitejs/plugin-legacy'
import { injectHtml, minifyHtml } from 'vite-plugin-html'
import externalGlobals from 'rollup-plugin-external-globals'
import ip from 'ip'
const { createVuePlugin } = require('vite-plugin-vue2')

export default ({ mode }) => {
  return defineConfig({
    base: './',
    server: {
      host: '0.0.0.0',
      port: 8080
    },
    plugins: [
      createVuePlugin(),
      injectHtml(),
      legacy({
        targets: ['Android >= 4.4', 'iOS >= 9', 'ie >= 11', 'Chrome>=30'],
        additionalLegacyPolyfills: ['regenerator-runtime/runtime.js']
      })
    ],
    build: {
      rollupOptions: {
        external: ['vue', 'axios', 'vuex', 'vue-router'],
        plugins: [
          externalGlobals({
            vue: 'Vue',
            axios: 'axios',
            'vue-router': 'VueRouter',
            vuex: 'Vuex'
          })
        ]
      }
    }
  })
}

when I use vite dynamic import component，the component dont show on chrome39，I added the compatibility setting in vite.config.js，when I visit the page ,the component legacy js is loaded ，but show nothing, and no error infomation.
render in android5/chrome 39

Reproduction
https://stackblitz.com/edit/vitejs-vite-rxhpjr?file=views/Index/index.vue
System Info
System:
    OS: macOS 12.0.1
    CPU: (4) x64 Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
    Memory: 429.48 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.13.0 - ~/.nvm/versions/node/v12.13.0/bin/node
    npm: 6.12.0 - ~/.nvm/versions/node/v12.13.0/bin/npm
  npmPackages:
    @vitejs/plugin-legacy: ^1.7.1 => 1.7.1
    vite: ^2.8.6 => 2.8.6

Used Package Manager
npm
Logs
No response
Validations

[X] Follow our Code of Conduct
[X] Read the Contributing Guidelines.
[X] Read the docs.
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
[X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
[X] The provided reproduction is a minimal reproducible example of the bug.

I also have this problem, could you please help me find some solution?

@webaddkevin
i also have this problem ,but  when i didn't use the cdn module and remove the vite external configs, it works fine.
and i also debug  the project，dynamic import modules does'nt have the renderer callback function, it render nothing on chrome39. this problem might be the vite-plugin-legacy

The reproduction app was broken (error: Uncaught ReferenceError: store is not defined).
After applying the following changes, I was able to fix it.
// 1. install vuex@3
// -----
// 2. change main.js
import Vue from 'vue';
import App from './App.vue';
import { sync } from 'vuex-router-sync';
import router from './router';
import store from './store';

sync(store, router);
new Vue({
  store,
  router,
  render: (h) => h(App),
}).$mount('#app');

// -----
// 3. add store.js
import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

export default new Vuex.Store({});

But it was not able to reproduce with windows 10 + chrome 39. Is this an android specific problem? Please provide a reproduction which is not broken.

The reproduction app was broken (error: Uncaught ReferenceError: store is not defined).
After applying the following changes, I was able to fix it.
// 1. install vuex@3
// -----
// 2. change main.js
import Vue from 'vue';
import App from './App.vue';
import { sync } from 'vuex-router-sync';
import router from './router';
import store from './store';

sync(store, router);
new Vue({
  store,
  router,
  render: (h) => h(App),
}).$mount('#app');

// -----
// 3. add store.js
import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

export default new Vuex.Store({});

But it was not able to reproduce with windows 10 + chrome 39. Is this an android specific problem? Please provide a reproduction which is not broken.

yes,the problem happend on android5 webview ,the version is chrome 39.And I found that without using CDN there is no problem,only after using CDN and using externalGlobals

Could you paste the config file here? I feel that CDN does not support chrome 39.

Could you paste the config file here? I feel that CDN does not support chrome 39.

vite.config.js
import path from 'path'
import { defineConfig } from 'vite'
import legacy from '@vitejs/plugin-legacy'
import { injectHtml, minifyHtml } from 'vite-plugin-html'
import externalGlobals from 'rollup-plugin-external-globals'
import ip from 'ip'
const { createVuePlugin } = require('vite-plugin-vue2')

export default ({ mode }) => {
  return defineConfig({
    base: './',
    server: {
      host: '0.0.0.0',
      port: 8080
    },
    plugins: [
      createVuePlugin(),
      injectHtml(),
      legacy({
        targets: ['Android >= 4.4', 'iOS >= 9', 'ie >= 11', 'Chrome>=30'],
        additionalLegacyPolyfills: ['regenerator-runtime/runtime.js']
      })
    ],
    build: {
      rollupOptions: {
        external: ['vue', 'vuex', 'vue-router'],
        plugins: [
          externalGlobals({
            vue: 'Vue',
            'vue-router': 'VueRouter',
            vuex: 'Vuex'
          })
        ]
      }
    }
  })
}

index.html
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vuex@3.6.2/dist/vuex.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-router@3.5.2/dist/vue-router.min.js"></script>

when I remove the vue-router.min.js cdn and the vue-router from the externalGlobals configuration， there is no problem

It was because when you use CDN, you don't get Symbol.toStringTag polyfilled which leads this line not to be executed.
https://github.com/vuejs/vue-router/blob/9a3c7ec00d7761d75038042de31258a08a1744bd/src/util/resolve-components.js#L24-L26
Closing as this is not a bug.

authors: felran sapphi-red webaddkevin wzz0720

repo: vitejs/vite


text:
No loader is configured for ".html" files

Describe the bug
During dependency pre-bundling, if there is a dependency which imports html files, esbuild would report an error:
No loader is configured for ".html" files: xxx.html

Reproduction
https://stackblitz.com/edit/vitejs-vite-b7dx3h?file=vite.config.js,test.html,index.html,public%2Fmain.js&terminal=dev
System Info
System:
    OS: macOS 11.3.1
    CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
    Memory: 211.95 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.20.0 - ~/.nvm/versions/node/v14.20.0/bin/node
    npm: 6.14.17 - ~/.nvm/versions/node/v14.20.0/bin/npm
  Browsers:
    Chrome: 104.0.5112.101
    Edge: 92.0.902.84
    Firefox: 103.0.2
    Safari: 14.1
  npmPackages:
    @vitejs/plugin-legacy: ^2.0.0 => 2.0.0
    vite: ^3.0.9 => 3.0.9

Used Package Manager
npm
Logs
No response
Validations

[X] Follow our Code of Conduct
[X] Read the Contributing Guidelines.
[X] Read the docs.
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
[X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
[X] The provided reproduction is a minimal reproducible example of the bug.

anyone?👀

I think this is working as intended – dependencies should be shipped as valid JS code and JS doesn't allow HTML imports. So this needs to be fixed on the side of the dependency by removing the HTML import or bundling it into valid JavaScript before shipping to npm.
Which dependency is causing this? (in the repro you're adding main.js to optimizeDeps, which is not necessary)

I think this is working as intended – dependencies should be shipped as valid JS code and JS doesn't allow HTML imports. So this needs to be fixed on the side of the dependency by removing the HTML import or bundling it into valid JavaScript before shipping to npm.
Which dependency is causing this? (in the repro you're adding main.js to optimizeDeps, which is not necessary)

It's not an open source package, so it may not be standard enough. Since I couldn't import it in the repro, I used optimizeDeps to simulate this error.

Yeah this is working as intended per @jonaskuske. Vite doesn't support importing HTML in dependency prebundling, adding the library to optimizeDeps.exclude might work if you have a plugin that handles importing HTML.

authors: bluwy jayzun jonaskuske


text:
fix: revert import config module as data

Description
Fixes https://github.com/vitejs/vite/issues/13730. See issue for description. If we want to move forward with using data:text/javascript, we would need to consider more edge cases. I think reverting is the best move right now.

What is the purpose of this pull request?

[x] Bug fix
[ ] New Feature
[ ] Documentation update
[ ] Other

Done, thanks @silverwind!

Thanks, could you also unlock the discussions in them?

I'm sorry for the situation, let's find a better way

Dont worry @s10y10, it was good we tried the approach.

TBH, I think the revert was premature, the issue should have been analyzed at least. I think it's likely that the URL has hit some kind of length limit.

@silverwind I think the revert was valid here, we weren't sure this approach was safe and it failed as soon as we released it, and seems the issue is on our side. We can try with more time again. I hope @cpojer could provide a minimal reproduction to help you test a new take at it.

authors: patak-dev s10y10 silverwind


text:
fix: fix sourcemap when using object as define value

Description

Closes https://github.com/vitejs/vite/issues/15771

I wrote my findings in https://github.com/vitejs/vite/issues/15771#issuecomment-1926021038. The issue seems to be esbuild including multiple sources in source map when it cannot replace "define" value with primitive (esbuild example) while later pipeline for source map collapsing/remapping doesn't expect such extra sources entries.
Since it doesn't look possible to control how esbuild output source entries, I think one way to "fix" this issue is to simply remove all extra source map entries which doesn't correspond to the original source. In this PR, I attempted this approach by using utilities from @jridgewell/trace-mapping (which is mostly re-exports of @jridgewell/sourcemap-codec).
todo

[x] test

[x] rollup build
[x] ssr dev

What is the purpose of this pull request?

[x] Bug fix
[ ] New Feature
[ ] Documentation update
[ ] Other

Before submitting the PR, please make sure you do the following

[x] Read the Contributing Guidelines, especially the Pull Request Guidelines.
[x] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
[x] Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
[ ] Update the corresponding documentation if needed.
[x] Ideally, include relevant tests that fail without this PR but pass with it.

/ecosystem-ci run

authors: hi-ogawa sapphi-red


text:
feat(css): support sass modern api

Description
closes https://github.com/vitejs/vite/issues/7116
(supersedes) closes https://github.com/vitejs/vite/pull/7170
This PR adds preprocessorOptions.scss.api: "modern" option to switch using sass.compileStringAsync API instead of legacy sass.render API.
I enabled api: "modern" in playground/css and existing tests are passing.
questions

should there be separate tests for "modern" and "legacy"?

I thought of adding a separate one for "modern", but probably what we want is to simply check playground/css tests pass, so I just flip the switch. maybe we should add a smaller playground for "legacy"?

any plan to switch modern as default? (in v6?)

In this PR, I only tackled the issue https://github.com/vitejs/vite/issues/7116, but I think there are somewhat related requests for overall sass integration experience. I'm wondering if these should be also considered for "modern" api integration, or they can be addressed separately later:

should we try integrating Compiler API? (cf. https://github.com/vitejs/vite/issues/14689)

webpack supports this by api: "modern-compiler" https://github.com/webpack-contrib/sass-loader?tab=readme-ov-file#api

allow switching sass implementation? (cf. https://github.com/vitejs/vite/issues/6734)

it looks like webpack checks package.json to automatically pick sass, node-sass, sass-embedded or allow explicitly choosing from implementation option https://github.com/webpack-contrib/sass-loader?tab=readme-ov-file#implementation

should there be separate tests for "modern" and "legacy"?

I think like you suggested, we can try re-running the css playground while flipping the switch to modern/legacy so we don't have to rewrite the test.

any plan to switch modern as default? (in v6?)

I think we should migrate to modern in v6 for sure, even better to modern-compiler if it's stabilizes then.

I'm wondering if these should be also considered for "modern" api integration, or they can be addressed separately later:

I think we can tackle them later 👍

should we try integrating Compiler API?

We should!

allow switching sass implementation?

I think we can follow webpack by checking sass-embedded first, then sass. I don't think Vite ever supported node-sass. We can hold off exposing a new option to choose until there's a feature request.

should there be separate tests for "modern" and "legacy"?

I think like you suggested, we can try re-running the css playground while flipping the switch to modern/legacy so we don't have to rewrite the test.

This is possible for local manual testing by USE_LEGACY_SCSS=1 pnpm test-serve playground/css, but I'm actually not sure how to do that for CI.
So, maybe the simplest way would be to create something like playground/css-legacy-scss and copy some code from playground/css. What do you think?

I think we should try to avoid copying if possible. Maybe we can have a setup like this?

In playground/css, create vite.config-scss-modern.js that imports the baseConfig from vite.config.js and sets api: 'modern'.
Create __tests__/scss-modern/scss-modern.spec.ts which has import "../css.spec.ts"?

I think we should try to avoid copying if possible. Maybe we can have a setup like this?

In playground/css, create vite.config-scss-modern.js that imports the baseConfig from vite.config.js and sets api: 'modern'.
Create __tests__/scss-modern/scss-modern.spec.ts which has import "../css.spec.ts"?

Wow, I wasn't aware test runner automatically picks up vite config. This looks almost working, but file edit is probably affecting each other and hmr related tests are failing.

This looks almost working, but file edit is probably affecting each other and hmr related tests are failing.

I updated playground/vitestSetup.ts and vitestGlobalSetup.ts to allow having a dedicated testDir for variant tests. This doesn't look so elegant, but I guess this works?

It doesn't seem to slow down the test, and does make the test more isolated, so fine by me 👍

Feedback from @nex3:

For the best performance it's ideal to use the Compiler API via sass-embedded. The API is stable and will be much more performant (and probably also doesn't need Vite to manage workers?)

The downside is that sass-embedded's platform support is limited to the range that Dart VM supports (also not sure if it works on e.g. StackBlitz), so it is recommended to still be able to fallback to the JS version.

Maybe Compiler API support can be a separate PR as an opt-in feature.

One option would be to list sass-embedded under optionalDependencies, so it'll get installed if it's available. Then you can check if it's loadable and use modern-compiler if it is and not if it's not. (I think there's some discussion of doing something similar by default in sass-loader as well.)

Thanks everyone for the review!
Regarding compiler API integration, I have another (draft) PR ready https://github.com/vitejs/vite/pull/17754. I didn't use Vite's own WorkerWithFallback system, assuming that wouldn't benefit if sass can already off loads work out of main process. I plan to compare performance like what @sapphi-red did in https://github.com/vitejs/vite/pull/13584#issuecomment-1678827918 so we can decide on what to do after that.

One option would be to list sass-embedded under optionalDependencies, so it'll get installed if it's available. Then you can check if it's loadable and use modern-compiler if it is and not if it's not. (I think there's some discussion of doing something similar by default in sass-loader as well.)

@nex3 I think this matches with my expectation, but just to confirm, if Vite would have some heuristics to automatically pick the API, would you suggest something like this?

both sass and sass-embeeded is installed  (for whatever reason)  -->  use modern-compiler with sass-embedded
only sass-embedded is installed  -->  use modern-compiler with sass-embedded
only sass is installed  -->  use compiler with sass
none is installed  -->  suggest installing sass-embedded

Conclusion from today's team meeting:

API usage heuristics based on presence of sass-embedded and sass (precedence described by @hi-ogawa here)
The imports API surface is different between legacy and modern, so it is technically a breaking change

We are going to land modern API support in a 5.x minor behind an opt-in option, so users on Vite 5.x can still suppress possible deprecation warnings. This will be out in a few weeks.
Vite 6 will default to the modern API but supports users forcing the legacy API (marked deprecated).
Vite 7 will drop legacy API support

I made a performance comparison of 6 patterns (sass, sass-embedded) x (legacy, modern, modern-compiler) using ~100 sass files from https://github.com/vuetifyjs/vuetify. I'm not sure if this artificial usage represents a real use case well, but just having something to start with, let me share here. Btw, I'm using a local build of the next PR https://github.com/vitejs/vite/pull/17754.
code: https://github.com/hi-ogawa/test-vite-sass/tree/main/vuetify

(sass/sass-embedded)
(modern-compiler/modern/legacy)
pnpm build time

sass-embedded
modern-compiler
441ms

sass-embedded
modern
575ms

sass-embedded
legacy
1.38s

sass
modern-compiler
2.78s

sass
modern
2.75s

sass
legacy
3.42s

(baseline without vuetify imports)
(53ms)

@nex3 I think this matches with my expectation, but just to confirm, if Vite would have some heuristics to automatically pick the API, would you suggest something like this?

both sass and sass-embeeded is installed  (for whatever reason)  -->  use modern-compiler with sass-embedded
only sass-embedded is installed  -->  use modern-compiler with sass-embedded
only sass is installed  -->  use compiler with sass
none is installed  -->  suggest installing sass-embedded

You can use modern-compiler no matter what—it won't impose any penalty if you're using it with sass, it just won't provide a particular benefit either. Otherwise this looks right.


text:
vitest errors if there are no in-source tests, even with --passWithNoTests

Describe the bug
With in-source tests, the recommendation is to change the file path glob to something like src/*.{ts,js} as per https://vitest.dev/guide/in-source.html. However, if you do this, you'll get errors for all of your source files that don't have any in-source tests. I would expect to be able to suppress this with --passWithNoTests, but I still get the same error.
My temporary hack to get around this is:
{
	"scripts": {
		"test:unit": "npx vitest run $(grep -lr 'import.meta.vitest' src/ | tr '\\n' ' ')",
		"test:unit:watch": "npx vitest --ui $(grep -lr 'import.meta.vitest' src/ | tr '\\n' ' ')"
	}
}

Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-jtuly9?file=package.json
System Info
System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
    Memory: 3.02 GB / 7.72 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 18.13.0 - ~/.local/share/pnpm/node
    npm: 8.19.3 - ~/.local/share/pnpm/npm
  npmPackages:
    vite: ^4.0.4 => 4.0.4
    vitest: ^0.28.3 => 0.28.3

Used Package Manager
npm
Validations

[X] Follow our Code of Conduct
[X] Read the Contributing Guidelines.
[X] Read the docs.
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
[X] The provided reproduction is a minimal reproducible example of the bug.

include is only for test files. includeSource is for source files with tests.

authors: evanandrewrose sheremet-va

repo: vitest-dev/vitest


text:
When using Workspace - Run in the Context of the Project

Clear and concise description of the problem
Hello everyone! I want to start by saying Vitest is amazing, and I really appreciate everyone's time working on that!
I'm using the Workspace feature - and it feels a little bit clunky. Specifically, when using an internal vitest configuration file. For example, consider the following structure:
/
├── apps
│       ├── app1
│       │   ├── test
│       │   │   ├── unit
│       │   │   │   └── example.test.ts
│       │   │   └── integrations
│       │   │       └── example.test.ts
│       │   ├── vitest.unit.config.ts
│       │   └── vitest.integration.config.ts
│       └── app2
│           ├── test
│           │   ├── unit
│           │   │   └── example.test.ts
│           │   └── integrations
│           │       └── example.test.ts
│           ├── vitest.unit.config.ts
│           └── vitest.integration.config.ts
├── vitest.workspace.ts
├── vitest.shared.unit.ts
├── vitest.shared.integration.ts
└── vitest.config.ts

From this point forward I will refer to app1 and app2 as projects inside the workspace (that's how the official documentation refers them if I understand correctly).
Our unit-tests share some kind of default configuration (for example, we want all our Unit-Tests to have restoreMock: true). The default configuration is defined inside vitest.shared.unit file at the root:
import { defineConfig } from 'vitest/config'

export default defineConfig({
  test: {
    restoreMock: true,
  }
})

It is being  consumed by the internal vitest.config.unit.ts file using defineProject:
import { defineProject, mergeConfig } from 'vitest/config';
import configShared from '../../vitest.shared.unit.ts';

export default mergeConfig(
    configShared,
    defineProject({
        test: {
            name: 'app1-unit`,
            dir: 'test/unit',
        },
    }),
);

This works perfectly when running from within the project itself, but not if you try to run all your workspace unit-tests from the workspace root directory (using vitest --projects='*-unit'). The reason for that, is when running from within the workspace context, the context is the ROOT DIRECTORY of the repository. Vitest will attempt to find test files inside test/unit and not apps/app1/test/unit. That's because while apps/app1 is defined as a project in vitest.workspace.ts, the context of the run is not from the actual project directory.
This can be fixed by multiple of hacks we are tried to use (passing dir externally from the config file, using: dir: '${__dirname}/test/unit' or just having some if/else inside the config file - but all of those feels pretty hacky).
Another example is code-coverage. Code coverage can't be defined on the internal vitest.config file when using workspaces, only at the root vitest.config.ts file. Here's an example:
import { defineConfig } from "vitest/config";

export default defineConfig({
  test: {
    coverage: {
      provider: "v8",
      include: ["apps/*/src/**"],

This is a bit awkward, because instead of just stating I want to include src,  which exists in every project I defined as part of my workspace, I need to specifically and very manually define the structure of my Workspace using wildcards and directories (even though I already defined it in vitest.workspace.ts). What I expect to work is just include: ["src"]. That will verify coverage within the src directory inside each of the projects.
Suggested solution
I think that perhaps it's worth considering perhaps running tests from within the project context (or directory to be precise) when using Workspace. This is somehow what tools like nx or lerna do.
Alternative
No response
Additional context
No response
Validations

[X] Follow our Code of Conduct
[X] Read the Contributing Guidelines.
[X] Read the docs.
[X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

The reason for that, is when running from within the workspace context, the context is the ROOT DIRECTORY of the repository. Vitest will attempt to find test files inside test/unit and not apps/app1/test/unit. That's because while apps/app1 is defined as a project in vitest.workspace.ts, the context of the run is not from the actual project directory.

Is this duplicate of https://github.com/vitest-dev/vitest/issues/5277? We cannot do process.chdir there as node:worker_threads do not support that.
I usually just use absolute paths there with fileURLToPath(new URL('<file>', import.meta.url)). Here's one example: https://stackblitz.com/~/edit/vitest-sonar-reporter-workspaces?file=packages/server/vitest.config.ts:L8-L10&file=packages/client/vitest.config.ts:L7-L11&view=editor

Another example is code-coverage. Code coverage can't be defined on the internal vitest.config file when using workspaces, only at the root vitest.config.ts file.

Yep, that's intentional and documented at https://vitest.dev/guide/workspace.html. You should use defineProject instead of defineConfig in workspace projects. Coverage is configured for the main thread, which runs all your projects. You cannot assign multiple configurations there.

Is this duplicate of https://github.com/vitest-dev/vitest/issues/5277? We cannot do process.chdir there as node:worker_threads do not support that.

Ha, yes! Thank you for referencing it. I agree with what mentioned in there - this indeed leaves Vitest in an odd place compared to other mono-repo executors that support workspaces. Using absolute path is a neat trick, thanks for sharing it!

Yep, that's intentional and documented at https://vitest.dev/guide/workspace.html.

I mean scope-wise. Assuming I want to only scan the src directory in each project (while code-coveraging) -  this won't work:
include: ["src/**"],

Instead - I have to adjust it to be something like:
include: ["apps/*/src/**"],

This is getting complex if your Mono-Repo has a complicated structure. What makes sense to me, is to have the ability to select directories I want to scan based on the root of the project, not the Workspace. But this is exactly like the bug you mentioned above.
I'm closing this one, and will keep tracking the main issue. Thanks for the help @AriPerkkio !

authors: AriPerkkio amitz


text:
Diffifculty in installing

I am having some difficulties in the django-channels and redis step. Can someone explain me stepwise what I need to to for that?

Its hard to follow your need @yogiii363 because is not clear where exactly your are having an issue. If you follow the instructions in the Wiki page you'll be able to use Bootcamp. But you're right on something. Those steps require some basic knowledge on Redis and django-channels, but if you use the docker-compose template, you'll be able to deploy without a hassle.
Please elaborate further your case to see how we can help you.

Closing.

repo: vitorfs/bootcamp


text:
Support for NuShell

Feature details
First off, thank you for setting up this workflow! Great work!
What would make this workflow even better, though, is if it also supported NuShell (https://www.nushell.sh/) in addition to Zsh & Bash.
I'm still new to writing Alfred Workflows, but if there's some way I can contribute to adding NuShell support to this Workflow, please let me know.
Cheers!

Thank you for the request, but that is specifically something I won’t add. Previous versions of the workflow supported more shells and those are a pain to manage, each with their own idiosyncrasies. And because they are not standard, a bunch of trickery is necessary to completely isolate them. Plus, I’m not familiar with NuShell (I heard of it, but never used it) which would make debugging it particularly troublesome, for something used by a tiny percentage of users. It is a conscious decision to only support Bash and Zsh.

authors: diversable vitorgalvao

repo: vitorgalvao/run-command-workflow


text:
Improve commit title

Resending Issue #166 as a PR for convenience

Thank you.

thanks for merging and cleaning up my mess. i'd like to add more stuff to cask-repair, but bash isn't my area of expertise ;/

authors: core-code vitorgalvao

repo: vitorgalvao/tiny-scripts

license: Unlicense


text:
How to declare composite keys in Floor

Hello ! Can you show me how to declare composite primary keys in Floor DAO ?

Hello @eddydn
The primary keys are managed by the @Entity annotation, you can find more information about the primary key declaration here - https://vitusortner.github.io/floor/entities/#primary-keys

I'll assume that this problem was solved, since you did not answer for so long. If you have any updates, feel free to reopen this issue or create a new one :)

authors: dkaera eddydn mqus

repo: vitusortner/floor


text:
fix: [#754] Requester ID fix

The description of the problem is part of the #754 . This is not a breaking change.
Related Issue or Design Document
N/A
Checklist

[x] I have read the contributing guidelines and signed the CLA.
[x] I have referenced an issue containing the design document if my change introduces a new feature.
[x] I have read the security policy.
[x] I confirm that this pull request does not address a security vulnerability.
If this pull request addresses a security vulnerability,
I confirm that I got approval (please contact security@ory.sh) from the maintainers to push the changes.
[ ] I have added tests that prove my fix is effective or that my feature works.
[x] I have added the necessary documentation within the code base (if appropriate).

Further comments
This is a minor change that has no impact to existing flows. It merely serves to be consistent with the auth code flow implementation and caters for cases highlighted in the Github issue.

Fosite PR - https://github.com/ory/fosite/pull/756

repo: vivshankar/fosite


text:
update to 0.4.0

Moved tools subpackage to main package
Moved contents of plugindata to plugin
Fixed error with kutana_error

Types of changes

[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[x] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

[x] My code follows the code style of this project.
[x] My change requires a change to the documentation.
[x] I have updated the documentation accordingly.
[x] I have added tests to cover my changes.
[x] I have read the CONTRIBUTING document.
[x] All new and existing tests passed.

Pull Request Test Coverage Report for Build 126

22 of 23 (95.65%)  changed or added relevant lines in 6 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage increased (+0.07%) to 93.687%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

kutana/controllers/vk/vkcontroller.py
1
2
50.0%

Totals

Change from base Build 121:
0.07%

Covered Lines:
653

Relevant Lines:
697

💛  - Coveralls

authors: coveralls michaelkrukov

repo: vk-brain/kutana


text:
Get textual-web working

https://textual.textualize.io/blog/2023/09/06/what-is-textual-web/
some source: https://github.com/Textualize/textual-web/blob/main/src/textual_web/cli.py

To get this to work we'd pretty much need to saw textual-web in half and just isolate the part that's not managing sessions + multiple application paths etc.

Nevermind, it's a closed source thing (can't run your own server).

repo: vkottler/conntextual


text:
Is there a way to set the z index per event?

Im using eventClassNames and TailwindCSS to set some custom classes for events.  Im trying to use the tailwind classes 'z-10 hover:z-50 hover:min-w-min' to show all the event content when hovered but it seems like the resources are stacked left to right.

On the demo I added a CSS rule min-width: min-content; for the blue event and it seemed to work.

Can you provide an online demo of the problem so I can check?

I'm not sure what was causing the issue but when i started my dev server today the issue was no longer present.
Thank you for all your work.

authors: MaCleodWalker vkurko

repo: vkurko/calendar


text:
Incorrect string to int conversion in asn_strtoimax_lim

While trying to formally prove the correctness of ASN1C code in Coq proof assistant, one of Digamma.ai engineers, @akinanop reported the following problem with this  function:
https://github.com/vlm/asn1c/blob/88ed3b5cf012918bc1084b606b0624c45e0d2191/skeletons/INTEGER.c#L1034
"I found an error in the code in the branch that was problematic to prove. I mean the branch when the input starts with - and we reach a case when value == upper_boundary && d <= last_digit_max. Then we could enter the loop with a negative value and then if there is more digits enter the branch value < upper_boundary. Below are the examples. If we are within the negative limit the output is as expected:"
input: -9223372036854775808
intmax: 9223372036854775807
upper boundary: 922337203685477580
last digit max: 7
output: -9223372036854775808
ASN_STRTOX_OK

But if we are in the case when we reach the upper boundary and there is extra stuff, then the result is not as expected. On some inputs it is ERROR_RANGE:
input: -9223372036854775809
intmax: 9223372036854775807
upper boundary: 922337203685477580
last digit max: 7
ASN_STRTOX_ERROR_RANGE
But on some it is OK:

intmax: 9223372036854775807
upper boundary: 922337203685477580
last digit max: 7
output: 70
ASN_STRTOX_OK

Below is a self-contained test demonstrating the problem:
#include <inttypes.h>
#include <stdio.h>
#include <string.h>

int asn_strtoimax_lim(const char *str, const char **end, intmax_t *intp) {
	int sign = 1;
	intmax_t value;

#define ASN1_INTMAX_MAX ((~(uintmax_t)0) >> 1)
	printf("intmax: %li \n", ASN1_INTMAX_MAX);
	const intmax_t upper_boundary = ASN1_INTMAX_MAX / 10;
	intmax_t last_digit_max = ASN1_INTMAX_MAX % 10;
#undef  ASN1_INTMAX_MAX

	printf("upper boundary: %li \n", upper_boundary);
	printf("last digit max: %li \n",  last_digit_max);

	if(str >= *end)
	  { printf("ASN_STRTOX_ERROR_INVAL \n");
	    return 1; }

	switch(*str) {
	case '-':
		last_digit_max++;
		sign = -1;
		/* FALL THROUGH */
	case '+':
		str++;
		if(str >= *end) {
			*end = str;
			printf("ASN_STRTOX_EXPECT_MORE \n");
			return 2;
		}
	}

	for(value = 0; str < (*end); str++) {
		switch(*str) {
		case 0x30: case 0x31: case 0x32: case 0x33: case 0x34:
		case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: {
			int d = *str - '0';
			if(value < upper_boundary) {
				value = value * 10 + d;
			} else if(value == upper_boundary) {
				if(d <= last_digit_max) {
					if(sign > 0) {
						value = value * 10 + d;
					} else {
						sign = 1;
						value = -value * 10 - d;
					}
				} else {
					*end = str;
					printf("ASN_STRTOX_ERROR_RANGE \n");
					return 3;
				}
			} else {
				*end = str;
				 printf("ASN_STRTOX_ERROR_RANGE \n");
				return 3;
			}
		    }
		    continue;
		default:
		    *end = str;
		    *intp = sign * value;
		    printf("%li \n", *intp);
		    printf("ASN_STRTOX_EXTRA_DATA \n ");
		    return 4;
		}
	}

	*end = str;
	*intp = sign * value;
	 printf("output: %li \n", *intp);
	 printf("ASN_STRTOX_OK \n");
	return 5;
}

int main(void)
{
   char *str = "-92233720368547758010";
   printf("input: %s \n", str);
   const char *end = str + strlen(str) ;
   intmax_t *intp;
   int res = asn_strtoimax_lim(str, &end, intp);
   printf("return code: %i \n", res);
}

I traced this code to 7 years ago. This is for how long this bug was there: https://github.com/vlm/asn1c/blame/5c9c34261cfe0c23434f4ad6f25aee812f9f07fb/skeletons/INTEGER.c

Where exactly is the bug, and do you have any suggestion for a fix?

For input "-92233720368547758010" it returns ASN_STRTOX_OK while I would expect it to return ASN_STRTOX_ERROR_RANGE.
One way to fix is the following patch:
--- asn_strtoimax_lim.c.orig    2019-08-08 20:36:45.835294904 -0700
+++ asn_strtoimax_lim.c    2019-08-08 20:58:02.530276064 -0700
@@ -33,11 +33,17 @@
         }
     }

+    int done = 0;
     for(value = 0; str < (*end); str++) {
         printf("\t%c\t%li\n", *str, value);
         switch(*str) {
         case 0x30: case 0x31: case 0x32: case 0x33: case 0x34:
         case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: {
+            if(done) {
+                *end = str;
+                printf("ASN_STRTOX_ERROR_RANGE \n");
+                return 3;
+            }
             int d = *str - '0';
             if(value < upper_boundary) {
                 value = value * 10 + d;
@@ -48,6 +54,7 @@
                     } else {
                         sign = 1;
                         value = -value * 10 - d;
+                        done = 1;
                     }
                 } else {
                     *end = str;

Thank you! Confirmed the issue; fixed in https://github.com/vlm/asn1c/commit/6495ca558e466c48267b3049b58eaa70c899374b

authors: mouse07410 vlm vzaliva


text:
pkg/client/logs.go: retry watching pods to stream logs from

What this PR does / why we need it:
TODO
Which issue(s) this PR fixes

Fixes #1064

Special notes for your reviewer:
Draft PR, as I want this to go out for initial review, as I have little idea how to fix that "properly". Will improve the description etc tomorrow. Feel free to push additional fixes if needed.
Release note:
Prevent CPU drain when streaming logs from pods, when connection to API server breaks

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@7d04c2f). Click here to learn what that means.
The diff coverage is 0%.

@@            Coverage Diff            @@
##             master    #1068   +/-   ##
=========================================
  Coverage          ?   50.63%
=========================================
  Files             ?       79
  Lines             ?     5765
  Branches          ?        0
=========================================
  Hits              ?     2919
  Misses            ?     2673
  Partials          ?      173

Impacted Files
Coverage Δ

pkg/client/logs.go
32.16% <0%> (ø)

Continue to review full report at Codecov.

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

Now I think, list of pods should be wiped on reconnect, otherwise logs will be showing twice.

Store list of pods, which has already been sent to streaming and don't send duplicates. Perhaps map[string]struct{} with pod.metadata.uid as a key could be used here. This option assumes, that streaming request itself will re-establish the connection after network outage.

After re-reading this, it seems that retry logic in streaming itself + keeping a map of logged pods seems like a good way to go. This way, when log following breaks for a given pod, logger may check if pod disappeared and if not, continue following it. And watching pod list will work independently.
I wonder how logger should restart following the logs. Should we set some buffer there to read last N logs? If so, some log messages may be duplicated. Also reasonable N would depend on the individual pod log rate and how fast we can re-establish following logs. Or should we start from 0? But then some log messages might get lost. Or we could track last log line and start from there then, that shouldn't be too computational intensive I think.

Thanks @zubron for the branch; used that as the base for https://github.com/vmware-tanzu/sonobuoy/pull/1222 . Closing this.

authors: codecov-io invidian johnSchnake

repo: vmware-tanzu/sonobuoy


text:
[main] Upgrade to latest dependencies

Manual run to bring repos dependent on eventing so we can release them. -vaikas
/cc we don't use Prow
/assign we don't use Prow
Produced by: knative-sandbox/knobots/actions/update-deps
Details:
bumping knative.dev/eventing 1bbc013...200e54c:
  > 200e54c Use new label for defining a cluster-local Knative Service (# 5402)
  > dd955b9 Update actions (# 5401)
  > e3dbc74 upgrade to latest dependencies (# 5393)
  > af770af Update actions (# 5392)

/close

Codecov Report

Merging #247 (62980d8) into main (54df76b) will increase coverage by 0.26%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #247      +/-   ##
==========================================
+ Coverage   80.05%   80.32%   +0.26%
==========================================
  Files          20       20
  Lines         747      747
==========================================
+ Hits          598      600       +2
+ Misses        135      133       -2
  Partials       14       14

Impacted Files
Coverage Δ

pkg/vsphere/adapter.go
64.84% <0.00%> (+1.56%)
:arrow_up:

Continue to review full report at Codecov.

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

HOLD. wait until release.

authors: codecov-commenter evankanderson knative-automation n3wscott

repo: vmware-tanzu/sources-for-knative


text:
Pull in updated vcsim.

Update the sample to reflect that you can now use vcsim.
Add an e2e test for the PowerCLI scenario in our sample.

Sweet!

authors: mattmoor vaikas


text:
Practice: IPMs (Iteration Planning Meetings)

Summary
Iteration Planning Meetings (IPMs) are core to our agile development practice and serve as a regular (ideally weekly) opportunity for a development team to get in sync about the vision and effort for the work intended for the next iteration.
This is a well-established practice amongst Labs practitioners, that has not ever been fully published/documented as a practice.
Progress and Publication Status

[ ] Already published on the Tanzu Developer Center.
[ ] Published internally or elsewhere; needs review for Tanzu Developer Center publication
[ ] Partially written and/or draft in progress
[x] Not yet written

Maturity of this Practice

[x] Very Mature: well established and widely used by our organization and others
[ ] Mature: have successfully used many times with many teams / projects
[ ] Immature: have used several or many times but is evolving quite a bit with each usage
[ ] Incubating: have used a few times, still rapidly evolving, has promise but unsure if generally applicable across many teams

Resources

Links to articles and blog posts (TBD if any prove valuable)
Links to presentations, videos, books, etc.

Note: If these resources are not public (i.e. an internal document), provide publicly safe information about how someone with the proper access would find these resources. Do not post insecure links or non-public information here.

🙋🏻♂ I'm interested in working on this

https://docs.google.com/document/d/1X_NZzTP7dUVO9ycRXAQ37DUPWXwstjDQqkZGqCpZCbA/edit

authors: chliuPivotal darryl-snow

repo: vmware-tanzu/tanzu-dev-portal


text:
[UI] the warning message should not pop up after leave the page.

Wrong snapshot.

The message alert is more like a notification. Although you have left the page, the triggered backend job is still running and we should notify the user the result when response returned.
Currently, the later is becoming fixed as notification. No matter what pages you're staying. Focusing on job response notifications.

Upgrade the message alert as global box on top of all components.
Fixed in master.

Use a top fixed alert as notification.

repo: vmware/harbor


text:
Use random icon generating algorithm to generate icons for the images when harbor working in standalone mode

I don't think we should be putting in random graphic images as icons for objects. as stated by another designer in the group:
"icons should be used to provide quick recognition when there is meaning associated. For example, an icon used to represent an object such as “VM” is useful when scanning a group of objects or universally recognized such as a logo. [In this example], it appears as if each icon holds no meaning on its own and is merely used as decoration; this adds to visual clutter and the space can be better utilized to display the full title.

authors: lweitzman steven-zou


text:
swagger config not compatible with 1.5.0

Many of the API objects are not working.  For example the project create isn't working.  I've noticed the version for swagger at https://raw.githubusercontent.com/vmware/harbor/master/docs/swagger.yaml has not been updated from 1.4.0 to 1.5.0.  Without this update fully configuring this application is not possible in an automated way.
When will there be an update to this file that fixes this broken swagger file?  Using the python harborclient isn't an option because it does not have the ability to modify members of a project.  Only view members.
If you are reporting a problem, please make sure the following information are provided:
1)Version of docker engine and docker-compose.
latest version
2)Config files of harbor, you can get them by packaging "harbor.cfg" and files in the same directory, including subdirectory.
3)Log files, you can get them by package the /var/log/harbor/ .

@ywk253100 Plese confirm if the swagger file is outdated. If yes, let's make a plan to update it. Thanks

authors: drduker steven-zou


text:
Implement repository service interface

Implement repository service interface

Coverage decreased (-0.04%) to 55.66% when pulling 3044a154b1d65b7a6057b3de04e2f8bd3b8155bc on steven-zou:master into 68cc911373d1c13a8812b7e5c7fbbce849d69627 on vmware:master.

authors: coveralls steven-zou


text:
Return the logger.Interface instead of the pointer of logger to avoid nil checking issue

An interface value is nil only if the inner value and type are both unset, (nil, nil). In particular, a nil interface will always hold a nil type. If we store a nil pointer of type *int inside an interface value, the inner type will be *int regardless of the value of the pointer: (*int, nil). Such an interface value will therefore be non-nil even when the pointer inside is nil.

Coverage increased (+0.02%) to 64.431% when pulling 1edd53ff9f5e82002440c210a75c70b544f7e5de on steven-zou:fix_nil_job_logger_issue_1.5.0 into 4081b52494c4071c51dff391defda38c3ec1e611 on vmware:release-1.5.0.


text:
Revisit init thread registration

The init thread has special registration that saves a malloc I guess. It feels like an unnecessary optimization and we should revisit this decision and probably have it register itself the normal way.

Fixed by Rob's check-in of PR
20a926d Rob Johnson 5 days ago Thu, 05-Jan-2023, 05:19:10 PM (Authored: Thu, 05-Jan-2023, 05:19:10 PM)
 Robj/task system config (#497)

authors: ajhconway gapisback

repo: vmware/splinterdb


text:
GraphQL API - add execution duration

What is the feature request? What problem does it solve?
Currently there is no way to filter or sort executions by duration. As a Data Job owner I would like to have an option to filter and sort by duration so I can identify the delayed executions.
Use cases
As a Data Job owner I want to identify the most delayed executions.
Suggested solution

Add new database column called duration to data_job_execution table. The column should be populated at the end of the execution.
The column should be exposed through GraphQL API. As well as it should be possible to sort and filter by it.

Additional context
Sample GraphQL query:
{{ baseUrl  }}/data-jobs/for-team/no-team-specified/jobs?query={
  jobs(pageNumber: 1, pageSize: 100, filter: [{property: "jobName", sort: ASC}]) {
    content {
      jobName
      config {
        team
        description
        schedule {
          scheduleCron
        }
      }
      deployments {
        enabled
        status
        executions(pageNumber: 1, pageSize: 100, filter: [{property: "duration", sort: DESC}]) {
          id
          duration
        }
      }
    }
  }
}

Sample GraphQL response:
{
  "errors": [],
  "data": {
    "content": [
      {
        "jobName": "tms-staging-vdk-1633680894",
        "config": {
          "team": "taurus",
          "description": "",
          "schedule": {
            "scheduleCron": "* * * * *"
          }
        },
        "deployments": [
          {
            "enabled": true,
            "status": null,
            "executionsSucceeded": 100,
            "executionsFailed": 10,
            "executions": [
              {
                "id": "tms-staging-vdk-1633680894-1634638440",
                 "duration": 122134
              },
              {
                "id": "tms-staging-vdk-1633680894-1634638500",
                "duration": 432523
              },
              {
                "id": "tms-staging-vdk-1633680894-1634638560",
                "duration": 213123
              }
            ]
          }
        ]
      }
    ],
    "totalItems": 0,
    "totalPages": 0
  }
}

Acceptance Criteria
The new column should be added to the database and GraphQL API should provide an ability to retrieve it.

Our internal customer no longer needs this feature.

repo: vmware/versatile-data-kit


text:
vdk-control-service: add secrets API

Add Secrets endpoint to the API.
Add "empty" controller.

This PR description does not provide much information as for why the change is necessary.

Fixed.


text:
Can't reorder gateway firewall rule using apiClient (nsx-t)

[O] I am using the latest SDK version 2.4.1
[O] This API is compatible with my vCenter version (You can get this info from the API documentation )
[O] I have searched existing issues

Description
Hi! I am developing automation tool which create gateway firewall rule.
I don't know if I can post a question here but I have no place to post.
I developed using java sdk (2.4.1) But I could not use revise method.
I filled out parameter but it doesn't work.
Environment

SDK version: 2.4.1

Java version: 1.8

vSphere version:

Steps or code snippet to reproduce
ApiClient apiClient = getApiClient(firewallInfo);
Rules ruleService = apiClient.createStub(Rules.class);
String ruleId = fwRuleInfo.getAssignedRuleId();
String location = fwRuleInfo.getOrderLocation();
Rule rule = ruleService.get(DEFAULT_DOMAIN_ID, DEFAULT_POLICY_ID, ruleId);
// bottom
ruleService.revise(DEFAULT_DOMAIN_ID, DEFAULT_POLICY_ID, ruleId, rule, null, RulesTypes.REVISE_OPERATION_BOTTOM);
// after
ruleService.revise(DEFAULT_DOMAIN_ID, DEFAULT_POLICY_ID, ruleId, rule, location, RulesTypes.REVISE_OPERATION_AFTER);
// before
ruleService.revise(DEFAULT_DOMAIN_ID, DEFAULT_POLICY_ID, ruleId, rule, location, RulesTypes.REVISE_OPERATION_BEFORE);
Actual behavior
ErrorMessage is below.
com.vmware.vapi.std.errors.InvalidRequest: InvalidRequest (com.vmware.vapi.std.errors.invalid_request) => {
messages = [],
data = struct => {error_message=Method is not allowed, error_code=282, module_name=common-services},
errorType = INVALID_REQUEST
}
at com.vmware.vapi.std.errors.InvalidRequest._newInstance2(InvalidRequest.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.vmware.vapi.internal.bindings.convert.impl.JavaClassStructConverter.createStructBinding(JavaClassStructConverter.java:220)
at com.vmware.vapi.internal.bindings.convert.impl.JavaClassStructConverter.fromValue(JavaClassStructConverter.java:78)
at com.vmware.vapi.internal.bindings.convert.impl.JavaClassStructConverter.fromValue(JavaClassStructConverter.java:32)
at com.vmware.vapi.internal.bindings.TypeConverterImpl$ValueToJavaVisitor.visit(TypeConverterImpl.java:346)
at com.vmware.vapi.bindings.type.ErrorType.accept(ErrorType.java:31)
at com.vmware.vapi.internal.bindings.TypeConverterImpl.convertToJava(TypeConverterImpl.java:688)
at com.vmware.vapi.internal.bindings.Stub.convert(Stub.java:417)
at com.vmware.vapi.internal.bindings.Stub.convertError(Stub.java:434)
at com.vmware.vapi.internal.bindings.Stub.access$300(Stub.java:57)
at com.vmware.vapi.internal.bindings.Stub$2.setResult(Stub.java:239)
at com.vmware.vapi.internal.bindings.Stub$2.setResult(Stub.java:230)
at com.vmware.vapi.internal.protocol.client.rest.DefaultRequestExecutorFactory$DefaultHttpResponseHandler.onResult(DefaultRequestExecutorFactory.java:86)
at com.vmware.vapi.vmc.client.authz.AuthzRefreshingRequestExecutorFactory$AuthzRefreshingRequestExecutor$AuthzRefreshingHttpResponseHandler.onResult(AuthzRefreshingRequestExecutorFactory.java:160)
at com.vmware.vapi.internal.protocol.client.rpc.http.ApacheClientRestTransport.execute(ApacheClientRestTransport.java:79)
at com.vmware.vapi.vmc.client.authz.AuthzRefreshingRequestExecutorFactory$AuthzRefreshingRequestExecutor.authorizeAndExecute(AuthzRefreshingRequestExecutorFactory.java:112)
at com.vmware.vapi.vmc.client.authz.AuthzRefreshingRequestExecutorFactory$AuthzRefreshingRequestExecutor.access$100(AuthzRefreshingRequestExecutorFactory.java:58)
at com.vmware.vapi.vmc.client.authz.AuthzRefreshingRequestExecutorFactory$AuthzRefreshingRequestExecutor$1.onComplete(AuthzRefreshingRequestExecutorFactory.java:98)
at com.vmware.vapi.vmc.client.authz.AuthzRefreshingRequestExecutorFactory$AuthzRefreshingRequestExecutor.refreshContext(AuthzRefreshingRequestExecutorFactory.java:188)
at com.vmware.vapi.vmc.client.authz.AuthzRefreshingRequestExecutorFactory$AuthzRefreshingRequestExecutor.refreshContextIfNeeded(AuthzRefreshingRequestExecutorFactory.java:171)
at com.vmware.vapi.vmc.client.authz.AuthzRefreshingRequestExecutorFactory$AuthzRefreshingRequestExecutor.execute(AuthzRefreshingRequestExecutorFactory.java:105)
at com.vmware.vapi.internal.protocol.client.rest.RestClientApiProvider.invoke(RestClientApiProvider.java:70)
at com.vmware.vapi.internal.bindings.Stub.invoke(Stub.java:225)
at com.vmware.vapi.internal.bindings.Stub.invoke(Stub.java:206)
at com.vmware.vapi.internal.bindings.Stub.invokeMethodAsync(Stub.java:170)
at com.vmware.vapi.internal.bindings.Stub.invokeMethod(Stub.java:138)
at com.vmware.nsx_policy.infra.domains.gateway_policies.RulesStub.revise(RulesStub.java:226)
at com.vmware.nsx_policy.infra.domains.gateway_policies.RulesStub.revise(RulesStub.java:213)
Expected behavior
reorder firewall rule.
other methods(list, get, update, delete) are fine. only revise method doesn't work.

https://github.com/vmware/vsphere-automation-sdk-java/issues/86

Thank  you for the reply . @ggoodvmw  @jobingeo

authors: jayyyyyyy jobingeo

repo: vmware/vsphere-automation-sdk-java


text:
Add .NET 5.0 Target

Hi,
This is a suggestive PR that adds back .NET 5.0 as a target and also keeps .NET 6.0.
It also simplify dependencies, leaving this package to be only dependent to the dependencies explicitly defined within the csproj file.
Thank you,
David

Sorry, but I won't merge this in. >NET file is only being supported for a couple more months anyway. Maybe/hopefully this will incentivize people to move to .NET 6 a bit quicker

Hello,
We'd very like to move to .NET 5, but since Episerver.Find  isn't ported yet on .NET 6, we can't move forward. Hopefully you will reconsider.
Thank you,
David

.NET 5 actually went out of support yesterday. Can't imagine it will take much longer for Optimizely to release a .NET 6 compatible Find version.
Sorry, but I really don't have time to support multiple versions. I don't work at/with` Optimizely anymore.

authors: ddprince-yaksa vnbaaij


text:
x86_64 target machinize start_sp_from_bp_offset

I think I am hitting a bug with the hard coded start_sp_from_bp_offset=8 in target_machinize.
You can have a function that won't generate a prologue/epilogue, doesn't touch stack, but has args passed on the stack. start_sp_from_bp_offset shold be 0 in that case right?
My test function is (e will be passed on stack on WIN64):
int foo(int a, float b, int c, float d, int e) { return a+c+e; }

A portable example function:
int square(int a, int b, int c, int d, int e, int f, int g) {return g;}
ret_type = MIR_T_I32;
func = MIR_new_func (ctx, "test", 1, &ret_type, 7,  MIR_T_I32, "a", MIR_T_I32, "b", MIR_T_I32, "c", MIR_T_I32, "d", MIR_T_I32, "e", MIR_T_I32, "f", MIR_T_I32, "g");
MIR_reg_t g = MIR_reg (ctx, "g", func->u.func);
MIR_reg_t r = MIR_new_func_reg (ctx, func->u.func, MIR_T_I64, "r");
MIR_append_insn (ctx, func, MIR_new_insn (ctx, MIR_MOV, MIR_new_reg_op (ctx, r), MIR_new_reg_op (ctx, g)));
MIR_append_insn (ctx, func, MIR_new_ret_insn (ctx, 1, MIR_new_reg_op (ctx, r)));
Actually the issue is even worse as the ptr used for stack arg access is rbp:
mov    0x10(%rbp),%rax
movslq %eax,%rax
movslq %eax,%rax
retq
A simple fix would be to set bp whenever func has stack args I guess. Although its extra needless instructions.

Thank you for reporting this bug.
Yes, the problem is even worse.  I'll fix it tomorrow.

I've fixed and the fix is in the repository.

Thanks, for completeness I will link the commits here:
Fix: https://github.com/vnmakarov/mir/commit/bfa5da4b9b1c2f2b2053e1ec46def8ceafe1aa1f
Test: https://github.com/vnmakarov/mir/commit/254bfcd8c12fa268249f06e171a74c6b22094106

authors: kalvdans logzero vnmakarov

repo: vnmakarov/mir


text:
自动更新数据库里的持仓数据更新

  尝试了一下模拟盘交易，目前委托报单成交后，持仓数据并不会自动更新同步到数据库里的持仓表，需要手动点击按钮”保存持仓“才会更新同步到数据库里的持仓表；
 假如vnpy系统中途意外退出或者操作系统意外重启，就会导致数据库里的持仓数据不是最新的，下一次重启vnpy系统后，只会导入旧的持仓数据，因为策略里的买卖行为依赖于self.pos，这样可能会造成重复买卖或者错过平仓机会，不知道这样的理解是否正确？

  如果可以的话，建议在processTradeEvent里面，除了更新持仓缓存数据后，也同时去更新数据库里的持仓数据，代码如下：

def processTradeEvent(self, event):
    """处理成交推送"""
    trade = event.dict_['data']

    if trade.vtOrderID in self.orderStrategyDict:
        strategy = self.orderStrategyDict[trade.vtOrderID]

        # 计算策略持仓
        if trade.direction == DIRECTION_LONG:
            strategy.pos += trade.volume
        else:
            strategy.pos -= trade.volume

        self.callStrategyFunc(strategy, strategy.onTrade, trade)

        # 更新数据库里的持仓数据
        flt = {'name': strategy.name,
               'vtSymbol': strategy.vtSymbol}

        d = {'name': strategy.name,
             'vtSymbol': strategy.vtSymbol,
             'pos': strategy.pos}

        self.mainEngine.dbUpdate(POSITION_DB_NAME, strategy.className,
                                 d, flt, True)

        content = '自动同步更新策略%s的持仓' %strategy.name
        self.writeCtaLog(content)

这个可能设计为一个CTA模块的配置会更好？有些情景并不希望实时保存数据到数据库中，因为某个时间点后可能手动去处理，我再考虑下

已完成，增加了关闭窗口时的询问

authors: akeyong vnpy

repo: vnpy/vnpy


text:
实盘模拟中，夜盘未成交挂单无法在日盘被策略自动撤销

环境

操作系统: Windows 7
Anaconda版本: Anaconda 4.0.0 Python 2.7 32位
vn.py版本: 如v1.7.3dev

Issue类型
Bug
程序行为
在SIMNOW的实盘模拟中，夜盘的未成交挂单在交易时间内没撤销，第二天日盘策略内的cancel all 不能撤掉这个挂单，必须通过UI界面的全撤按钮才能撤销。
基本是如果关闭UI前有挂单未成交并且为撤单，再次运行UI时策略无法取消掉之前的挂单，必须手动取消，或者下一个交易日才会取消。

策略的cancelAll只能撤销由该策略发出的委托，UI上的全撤是撤销整个系统内所有的活动委托
检查你是否夜盘收盘后关闭了系统，日盘开盘前才启动的，这样必然策略就不知道之前的委托了

对的，因为不收盘后到下次开盘需要重新启动系统，所以是否可以设置日盘开启后撤销之前的系统挂单？或者可以限制最后几分钟不挂单？

第一个方法，可以写个小的定制化模块，每次日盘启动后自动全撤所有系统内委托。
第二个方法，可以直接在策略里写，比如夜盘倒数3分钟不允许交易，并全撤委托

authors: huxunya vnpy


text:
docker 相关修改

主要变更：
1、将原代码和文档中与新版本 vnpy 不兼容的部分进行了调整修复；
2、集成了 VNC 服务，可以直接通过 VNC 程序运行图形界面程序；
3、在制作镜像时自动编译和更新 ctp 接口程序库（其他接口也可做类似修改）。

提交错了分支，关闭


text:
🛑 Chat (element) is down

In 69417cb, Chat (element) ($URL_ELEMENT) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Chat (element) is back up in 2d06a0e after 10 minutes.

repo: vojeroen/uptime


text:
How to add more Database fields

How to add more Database fields to import

It is not variable for now. If you want to do that quickly, just update https://github.com/vojtasvoboda/oc-userimportexport-plugin/blob/master/models/userimport/columns.yaml file.

@vojtasvoboda
I tried this already but somehow its not updating in database. do I need any code to be added in model
this is what ive done:
# ===================================
#  Column Definitions
# ===================================

columns:

    username:
        label: rainlab.user::lang.user.username
        searchable: true
        invisible: true

    name:
        label: rainlab.user::lang.user.name
        searchable: true

    surname:
        label: rainlab.user::lang.user.surname
        searchable: true
        invisible: true

    email:
        label: rainlab.user::lang.user.email
        searchable: true

    mobilef:
          label: Fathers Mobile
          searchable: true

    mobilem:
          label: Mothers Mobile
          searchable: true

    rollno:
          label: Roll No
          searchable: true

    # street_addr:
    #     label: Street
    #     searchable: true

    # city:
    #     label: City

    # zip:
    #     label: ZIP

Ive these mobilef, mobilem and rollno columns in db already.

Yes, this is right moves. Last step is to extend RainLab User model and add new fillable fields:
// extend RainLab.User model
UserModel::extend(function($model) {
    $model->addFillable(['mobilef', 'mobilem', 'rollno']);
});

See http://octobercms.com/docs/database/model#extending-models

hey @vojtasvoboda , thanks a lot. I forgot that.
added it in plugin.php boot method and it worked like charm!
Thanks.. nice simple plugin! I'll definitely contribute if i get time to work on it.!

I would appreciate more translations if you want to contribute :-) https://github.com/vojtasvoboda/oc-userimportexport-plugin/tree/master/lang

authors: bkrajendra vojtasvoboda

repo: vojtasvoboda/oc-userimportexport-plugin