Error in webpack Build

I am followed the steps as per the readme file and Got the same issue as the issue-5 ( https://github.com/peerigon/modernizr-loader/issues/5 )
As mentioned by @flootr, I have updated the code but No Luck
Webpack: v2.1.0-beta.20
Let me know if you need any more information

Hey @vivekgs2007! Thanks for reporting this issue. Would you be so kind and provide us with the following information?

Your webpack configuration file
The name of your modernizrrc file and if its written in JSON or JavaScript

Here is a part webpack conf file where all the modernizrrc configuration is added:
    loaders: [
      {
        test: /.json$/,
        loaders: [
          'json'
        ]
      },
      {
        test: /\.css$/,
        loader: 'style!css!postcss'
      },
      {
        test: /\.(eot|woff|woff2|svg|svgz|ico|ttf|png)([\?]?.*)$/,
        loader: 'file-loader'
      },
      {
        test: /\.modernizrrc.js$/,
        loader: "modernizr"
      },
      {
        test: /\.modernizrrc(\.json)?$/,
        loader: "modernizr!json"
      },
      // {
      //   test: /\.js$/,
      //   exclude: /node_modules/,
      //   loaders: [
      //     'ng-annotate'
      //   ]
      // },
      {
        test: /.html$/,
        loaders: [
          'html'
        ]
      }
    ]
  },
  resolve: {
    alias: {
      modernizr$: path.resolve(__dirname, ".modernizrrc")
    }
  }

Here is modernizrrc file and saved has ".modernizrrc"
{
  "minify": true,
  "options": [
    "domPrefixes",
    "hasEvent",
    "testAllProps",
    "testProp",
    "html5shiv",
    "setClasses"
  ],
  "feature-detects": [
    "test/history",
    "test/postmessage",
    "test/svg",
    "test/a/download",
    "test/css/transitions",
    "test/file/api",
    "test/storage/localstorage",
    "test/svg/inline"
  ]
}

Ok, if you're using webpack 2 I think you always have to provide -loader suffix (like modernizr-loader!json-loader).
I'm not sure if you want this, but here you are not escaping the dot (which you have to, if you only want to match the regex on a . here): test: /\.modernizrrc\.js$/,
You may have some misconfiguration (there are a load of tests which apply to either modernizrrc or json file extensions). Could you please comment out any loader configuration which apply to them except for
{
  test: /\.modernizrrc(\.json)?$/,
  loader: "modernizr-loader!json-loader"
},

and try if that helps?

Tried with above and other possible ways, But No Luck.
Here are the Loaders
loaders: [
      {
        test: /.json$/,
        loaders: [
          'json'
        ]
      },
      {
        test: /\.css$/,
        loader: 'style!css!postcss'
      },
      {
        test: /\.(eot|woff|woff2|svg|svgz|ico|ttf|png)([\?]?.*)$/,
        loader: 'file-loader'
      },
      {
        test: /\.modernizrrc\.js$/,
        loader: "modernizr-loader"
      },
      {
        test: /\.modernizrrc(\.json)?$/,
        loader: "modernizr-loader!json-loader"
      },
      {
        test: /.html$/,
        loaders: [
          'html'
        ]
      }
    ]

In the entry js file I have included
require('modernizr');

Error on Build:
ERROR in ./~/modernizr/lib/build.js
Module not found: Error: Can't resolve 'generate' in '/home/vshadaka/personal_html/archer/node_modules/modernizr/lib'
 @ ./~/modernizr/lib/build.js 149:2-72
 @ ./~/modernizr/lib/cli.js
 @ ./src/index.js

ERROR in ./~/modernizr/lib/build.js
Module not found: Error: Can't resolve 'package' in '/home/vshadaka/personal_html/archer/node_modules/modernizr/lib'
 @ ./~/modernizr/lib/build.js 149:2-72
 @ ./~/modernizr/lib/cli.js
 @ ./src/index.js

ERROR in ./~/modernizr/lib/metadata.js
Module not found: Error: Can't resolve 'fs' in '/home/vshadaka/personal_html/archer/node_modules/modernizr/lib'
 @ ./~/modernizr/lib/metadata.js 1:9-22
 @ ./~/modernizr/lib/cli.js
 @ ./src/index.js

ERROR in ./~/modernizr/lib/options.js
Module not found: Error: Can't resolve 'fs' in '/home/vshadaka/personal_html/archer/node_modules/modernizr/lib'
 @ ./~/modernizr/lib/options.js 1:9-22
 @ ./~/modernizr/lib/cli.js
 @ ./src/index.js

ERROR in ./~/modernizr/lib/build.js
Module not found: Error: Can't resolve 'lib/generate-banner' in '/home/vshadaka/personal_html/archer/node_modules/modernizr/lib'
 @ ./~/modernizr/lib/build.js 149:2-72
 @ ./~/modernizr/lib/cli.js
 @ ./src/index.js

ERROR in ./~/requirejs/bin/r.js
Module parse failed: /home/vshadaka/personal_html/archer/node_modules/requirejs/bin/r.js Unexpected character '#' (1:0)
You may need an appropriate loader to handle this file type.
| #!/usr/bin/env node
| /**
|  * @license r.js 2.1.22 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved.
 @ ./~/modernizr/lib/build.js 131:18-38
 @ ./~/modernizr/lib/cli.js
 @ ./src/index.js

ERROR in ./~/file/lib/file.js
Module not found: Error: Can't resolve 'fs' in '/home/vshadaka/personal_html/archer/node_modules/file/lib'
 @ ./~/file/lib/file.js 2:9-22
 @ ./~/modernizr/lib/metadata.js
 @ ./~/modernizr/lib/cli.js
 @ ./src/index.js

Could you provide a small sample repository? I'm not sure if this is related to to the modernizr-loader itself, but a misconfiguration with webpack, somehow. Maybe @jhnns can provide us with a usefil hint here.

You are requiring the modernizr module. You should require your .modernizrrc.js, which is the configuration file that customizes the modernizr build.

@jhnns I have changed the mine .modernizrrc to .modernizrrc.js
But Still no luck
resolve: {
    alias: {
      modernizr$: path.resolve(__dirname, ".modernizrrc.js")
    }
  }

Let me know any other way.
Does this plugin is compatible with webpack 2

Tried requiring the .modernizrrc.js in entry file, No Luck

@vivekgs2007 do you think you can set up a small example repository which reproduces your error? I think this would be helpful so that we can finally solve your problem :)

I tried other plugins "modernizr-webpack-plugin" and "webpack-modernizr-loader"
Got the same errors.
Need to find the other solution.

Yeah, I think you might have some misconfiguration with your webpack config. If you could set up a sample project which reproduces the error, we can help you. Otherwise it would be like trying to find a needle in a haystack, unfortunately

So I had the same issue with webpack 2. Instead of aliasing the .modernizrrc file, I required it directly (require('../../../.modernizrrc') and it worked. It looks like the issue is with it being able to resolve the aliased modernizrrc and load it properly... Not entirely sure why.

@vivekgs2007 could you resolve your issue with @rhagigi suggestion?

I had to change this to the following to get it working:
module: {
  rules: [
    {
      test: /\.modernizrrc$/,
      loader: "modernizr-loader!json-loader"
    }
  ]
},
resolve: {
  alias: {
    modernizr$: path.resolve(__dirname, ".modernizrrc")
  }
}

I am struggling with the same problem though still not managed to get it working. @mikeyalder-bw, please can you confirm how you are loading modernizr in your scripts? Is it with require or import from. I have everything else exactly as your config from your last comment. Thanks.

I am requiring it using code below:
window.Modernizr = require('modernizr');

Thanks. That helped me realise my mistake. My file structure is slightly different and I needed to set my alias as follows:
alias: {
  modernizr$: path.resolve(__dirname, "../.modernizrrc")
}

Incidentally. Both of these seem to work for me:
import Modernizr from 'modernizr'

and
require('modernizr')

All is now working as it should.

I'm having the same problems, I'm using the configuration as mentioned in the readme of modernizr-loader.
My console outputs:

ERROR in ../~/modernizr/lib/build.js
Module not found: Error: Can't resolve 'generate' in 'D:\samples\webpack-modernizr\node_modules\modernizr\lib'
@ ../~/modernizr/lib/build.js 149:2-72
@ ../~/modernizr/lib/cli.js
@ ./index.ts

ERROR in ../~/modernizr/lib/build.js
Module not found: Error: Can't resolve 'package' in 'D:\samples\webpack-modernizr\node_modules\modernizr\lib'
@ ../~/modernizr/lib/build.js 149:2-72
@ ../~/modernizr/lib/cli.js
@ ./index.ts

ERROR in ../~/modernizr/lib/build.js
Module not found: Error: Can't resolve 'lib/generate-banner' in 'D:\samples\webpack-modernizr\node_modules\mode
rnizr\lib'
@ ../~/modernizr/lib/build.js 149:2-72
@ ../~/modernizr/lib/cli.js
@ ./index.ts

ERROR in ../~/requirejs/bin/r.js
Module parse failed: D:\samples\webpack-modernizr\node_modules\requirejs\bin\r.js Unexpected character '#' (1:0
)
You may need an appropriate loader to handle this file type.
| #!/usr/bin/env node
| /**
|  * @license r.js 2.1.22 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved.
@ ../~/modernizr/lib/build.js 131:18-38
@ ../~/modernizr/lib/cli.js
@ ./index.ts

I've attached a minimal reproduction sample, any guidance into what I'm missing ?
Repro steps:

npm install
npm run build

webpack-modernizr.zip

You have a different modernizrrc test to me. You could try changing:
test: /\.modernizrrc(\.json)?$/,

to…
test: /\.modernizrrc$/,

Also try removing resolveLoader and add your alias to the resolve object instead:
resolve: {
  extensions: ['.ts', '.js'],
    alias: {
      'modernizr$': path.resolve(__dirname, ".modernizrrc")
    }
 }

@trafiq I've must have missed something, it appears to work. Note, the sample I added seems to miss the json-loader. Removing the resolveLoader and using resolve.alias did the trick after updating my loaders for .modernizerrc:
{
    test: /\.modernizrrc(\.json)?$/,
    use: ["modernizr-loader", "json-loader"]
},

Making these changes does succeed the build, however Modernizr logs undefined.
import Modernizr from 'modernizr';

console.log(Modernizr);
console.log(Modernizr.touch);

Anything I'm missing here ? I've reattached the reproduction sample, which should not be missing dependencies this time 🙈 .
webpack-modernizr.zip
You can run npm start after running npm run build in order to start the http server en see the console.log:

@flootr, sorry for mentioning u directly. Any idea why it's giving me undefined ?
I did some debugging inside modernirz-loader:
module.exports = function (config) {
    if (typeof this.cacheable === 'function') {
        this.cacheable();
    }

    var cb = this.async();
    console.log("buidling webpack");
    console.log(config);
    modernizr.build(this.exec(config, this.resource), function (output) {
        console.log(wrapOutput(output));
        cb(null, wrapOutput(output));
    });
};

Results in
buidling webpack

module.exports = {
        "minify": true,
        "options": [
                "setClasses"
        ],
        "feature-detects": [
                "history"
        ]
};

D:\tfs\sa-themes-work\Work\SA.Themes\.modernizrrc
;(function(window){
var hadGlobal = 'Modernizr' in window;
var oldGlobal = window.Modernizr;
/*! modernizr 3.5.0 (Custom Build) | MIT *
 * https://modernizr.com/download/?-history-setclasses !*/
!function(n,e,o){function s(n,e){return typeof n===e}function i(){var n,e,o,i,a,r,l;for(var c in t)if(t.hasOwnProperty(c)){if(n=[],e=t[c],e.name&&(n.push(e.name.toLowerCase()),e.options&&e.options.aliases&&e.options.aliases.length))for(o=0;o<e.options.aliases.length;o++)n.push(e.options.aliases[o].toLowerCase());for(i=s(e.fn,"function")?e.fn():e.fn,a=0;a<n.length;a++)r=n[a],l=r.split("."),1===l.length?Modernizr[l[0]]=i:(!Modernizr[l[0]]||Modernizr[l[0]]instanceof Boolean||(Modernizr[l[0]]=new Boolean(Modernizr[l[0]])),Modernizr[l[0]][l[1]]=i),f.push((i?"":"no-")+l.join("-"))}}function a(n){var e=l.className,o=Modernizr._config.classPrefix||"";if(c&&(e=e.baseVal),Modernizr._config.enableJSClass){var s=new RegExp("(^|\\s)"+o+"no-js(\\s|$)");e=e.replace(s,"$1"+o+"js$2")}Modernizr._config.enableClasses&&(e+=" "+o+n.join(" "+o),c?l.className.baseVal=e:l.className=e)}var t=[],r={_version:"3.5.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(n,e){var o=this;setTimeout(function(){e(o[n])},0)},addTest:function(n,e,o){t.push({name:n,fn:e,options:o})},addAsyncTest:function(n){t.push({name:null,fn:n})}},Modernizr=function(){};Modernizr.prototype=r,Modernizr=new Modernizr;var f=[],l=e.documentElement,c="svg"===l.nodeName.toLowerCase();Modernizr.addTest("history",function(){var e=navigator.userAgent;return-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone")||"file:"===location.protocol?n.history&&"pushState"in n.history:!1}),i(),a(f),delete r.addTest,delete r.addAsyncTest;for(var d=0;d<Modernizr._q.length;d++)Modernizr._q[d]();n.Modernizr=Modernizr}(window,document);
module.exports = window.Modernizr;
if (hadGlobal) { window.Modernizr = oldGlobal; }
else { delete window.Modernizr; }
})(window);

Apparantly I need to use import * as Modernizr from 'modernizr, might this be because I'm using TypeScript ?

I used a modernizr-config.json file for config, like advised for for the cli.
With webpack 2, here is the conf that works for me:
(the json loader is a bit tricky so I thought I would share it)
module.exports = {
  ...
  module: {
    rules: [
      {
        test: /modernizr-config(\.json)?$/,
        use: [
          {
            loader: 'modernizr-loader',
            options: require('./conf/modernizr-config.json'),
          },
          {
            loader: 'json-loader',
          },
        ]
      },
    ]
  },
  resolve: {
    alias: {
      modernizr$: path.resolve(__dirname, 'conf/modernizr-config.json')
    }
  },
};

(npm install json-loader might be needed)

@stephane-tessier's solution worked for Webpack3 as well

For anyone struggling to get this working on Rails 6 -- I did the following:
# config/webpack/environment.js

const { environment } = require('@rails/webpacker')
const customConfig = require('./custom')

environment.config.merge(customConfig)

module.exports = environment

# config/webpack/custom.js

const path = require('path');

module.exports = {
  module: {

    rules: [
    {
      test: /\.modernizrrc$/,
      loader: "modernizr-loader!json-loader"
    }
  ]
  },
  resolve: {
    alias: {
      $: 'jquery/src/jquery',
    	jQuery: 'jquery/src/jquery',
    	Masonry: 'masonry-layout',
    	modernizr$: path.resolve(__dirname, './.modernizrrc')
    }
  }
}

# config/webpack/.modernizrrc
{
  "minify": true,
  "options": [
    "setClasses"
  ],
  "feature-detects": [
  	"css/transitions"
  ]
}

# app/javascript/packs/applications.js
require("@rails/ujs").start()
require("turbolinks").start()
require("@rails/activestorage").start()
require("channels")

const $ = require('jquery');
const Masonry = require('masonry-layout');
const Modernizr = require('modernizr');


[api] method POST is used when synchronization of data should be done by PUT with explicitly indicated ID.

I have a question to

https://crickapi.docs.apiary.io/#reference/crick-api-for-watson/frames/push-(not-yet-synchronized)-user's-frames

To synchronization is proposed POST. When POST is dedicated to creating resources.
For both updating and creating resources PUT should be used.
Full synchronization requires also answer for the following questions:
Lets A be a client (for example Watson CLI)
Lets B be a server (for example app.crick.io api)
Question 1. Which participant of synchronization contains a source of truth?
a) both have the same level
b) client
c) server
if a - both have equal value
Question 2. Which behavior should be considered as correct when two resources have other values but the same id. The data model of time frame does not contain last modification time. Even if, to do correct synchronization we need also background - previous common version. This is an open question. Related with lacking docs about synchronization.
Question 3. Should be allowed data deletion? If A has resource but B has not then synchronization means that resource should be added to B, or deleted from A? If we select adding strategy on how to remove the resource, is deleting strategy, how to add?
These not all questions but I do not have infinite time, so go to next possibility.
if b - client (Watson cli is master)
Question 4. Then it should start synchronization by get data from the server, process it by comparison with data in Watson, then send POST only to them that are not created on the server (not synchronized yet)
and it is a source of this question because we have an endpoint for both get all frames

https://crickapi.docs.apiary.io/#reference/crick-api-for-watson/frames/retrieve-all-user's-frames

and POST lacking frames

https://crickapi.docs.apiary.io/#reference/crick-api-for-watson/frames/push-(not-yet-synchronized)-user's-frames

but it is an incomplete approach. What about update frames that change PUT / PATCH and remove frames that were removed DELETE. And what is a relation among taking the logic of synchronization in Watson CLI in relation to recommendation of @SpotlightKid from

https://github.com/TailorDev/Watson/issues/40

that in 2015 typed

To not bloat the Watson distribution with too many sync backends (and their dependencies), I propose to use a plugin framework to load backend implementations and to specify the API that they have to support.

Question 5. What is a scenario when in one backend it connected two clients? O one with data second without. Should synchronization with first create data on the server, and on the second remove? Taking into account that only GET and POST are implemented I suspect that rather, first synchronization creates data on the server, second move them to the second client, but when I remove the frame from the first client and synchronize again this frame rather will occur on the client that will be removed from the server. Should be it considered as a bug?
Actually "Watson deleted frames do not sync with crick"

https://github.com/TailorDev/crick/issues/111

if c - the server is master, and cli slave
It is rather not probably because of synchronization means in this case that you can create data only on the server. But when I had seen issue

https://github.com/TailorDev/Watson/issues/171

I decided to add the next question
Question 6. Who is a person that has to decide voice on this topic? @jmaupetit typed

We must re-consider our synchronization strategy which —at the time of writing— overrides local changes between two sync events.

It is related with my question about integration with external sources of data that uses his own identifiers.

https://github.com/TailorDev/Watson/issues/190

It is related with not finished discussion about logic of synchronization there

Syncing with server overrides local changes #171

And lacking documentation there.

https://github.com/TailorDev/Watson/issues/165

I can send my propositions. What should I do?

Do research about synchronization protocols [today]
Propose protocol [today]
Wait for an answer for question [1 month]
Wrap everything together and publish a draft of the specification of synchronization [1 week]
Wait for fixes and opinions from community [1 month]
Learn Go + react, I know c, c++, python, vue, so it will be easy [1 month]
Implement this specification [1 month]
Wait for accepting pull request [1 month]

When everything will go great we will have working synchronization in half of 2019 and many issues connected with it will be closed.
So let's start.

Research on synchronization:

https://en.wikipedia.org/wiki/Data_synchronization

We have

file synchronization
version control
distributed filesystems
mirroring

I propose version control.
set reconciliation problem can be solved by

Wholesale transfer
Timestamp synchronization
Mathematical synchronization

I poropose matchematical synchronization
In Error handling paragraph there is a sentence

The simplest approach is to have a single master instance that is the sole source of truth.

But I propose another approach - accept any modification and store list of modifications. When two modifications overlapping, then merge them with "mathematical synchronization" that I will describe later.
Proposed tools

Paxos https://en.wikipedia.org/wiki/Paxos_(computer_science) - in my opinion too complicated "solving consensus in a network of unreliable processors" - is is not our case.
Raft https://en.wikipedia.org/wiki/Raft_(computer_science) - looks nice, it requires to understood concepts of "Leader Election" and "Log Replication", but there is a nice tutorial. I recommend to see it after reading an article on the wiki

http://thesecretlivesofdata.com/raft/

There is PDF
raft.pdf
and finally a list of implementations

https://raft.github.io/#implementations

So props:

has many implementations, are widelly known
works in a distributed network of nodes,

Questions:
should we consider Watson cli like rarf node or client?
Answer:
It could be node only if have a public address, but it is to send a request to them, but this is hard to achieve.
So Watson cli should be a client in this model.
Cons:

it seems to be overengineered.
it needs cluster of servers to works efficiently
we rather looking for simple sollutin like "storage everywhere", "server -> serverless"

I reseatrched some solutions and finally finised on stackoverflow asking this question

https://stackoverflow.com/questions/54385016/simple-synchronization-protocol-for-array-of-objects

This is instantly draft of my proposition how to solve problem of synchronization. It this model Serverless lambda + text file stored anywhere can be replaced by crick backend and postgress, but vision of serverless (that are free today for small number of requests) and static file storage (that is also free for personal users) for me is more attractive than backend that must be served.

Update proposition 2 (simplified):
I adjusted my vision to shape of the current solution.

Replace lambda and flat file storage by crick server.
Replace local logs with a collection of requests to do to mirror local changes.
Introduce flag of full and shallow synchronization sync means shallow, sync --full
means synchronization with changes introduced before the last synchronization. Any client should remember when was synced last time. Synchronization means:
a) send any requests from local logs to current crick server (POST / PUT / DELETE)
b) get all time frames from the last sync to now (shallow), get all time frames from beginning to now (full), it can be paginated, and pagination should be supported by a client (hal+json / similar format or Link header like in GitHub v3 api https://developer.github.com/v3/guides/traversing-with-pagination/)
after get the client should update his last sync date and compare local collection with obtained collection, in this process client should replace all his frames from considered period by frames from server, because of if he sends a time frame before, it should be on server too, if any modifications on this frame was done by another client then it should override this client state.

Bidirectional synchronization with flat file storages / external services

crick server should expose endpoints for webhooks from services like Toggl / Google Calendar ...
crick server should have built-in cron or endpoints for external cron to send data to these services / flat file storages

Drawbacks:

a central point of failure - crick server
we need to maintain VPS server
possible invalid (or rather non intuitive) behavior if synchronization not enough frequently
Consider client A create timeframe and synchronize it,
Then client B synchronize and get this timeframe, edit it,
Client A edits this timeframe too
Now this timeframe will be saved which was updated last time,
additionally, if only shallow synchronization will be applied, any client can
operate on his own unsynchronized data. We should describe it in the draft specification that is planned for next month.

Advantages:

more elastic possibilities than serverless (build in cron, speed communication with postgress)
number of users is small, so scaling does not matter
an approach based on what was build
easy to learn for new supporters (blockchain architecture / complicated versioning not needed)

Summary
I can implement this concept. I probably understand what works wrong from issues of other users. We need to replace POST / DELETE interface by POST / PUT / DELETE with well-documented logic of synchronization.
So logic has three ingredients,

any client should storage his requests to send,
the first step of synchronization is sending create/update/delete requests that change state on server
second step is get time frames and replace local state by state from server.

Any additional integrations like flat file storages / Toggl / Google Calendar / Zapier ...
should be realized by endpoints that forcing sending requests by Crick and endpoints for receiving webhooks.
Next step after fixing synchronization could be scoping tokens. For example tokens with scope only get, or only create.
Questions
What about questions from issue content? I will try to answer them below:
Question 1. Which participant of synchronization contains a source of truth?
Answer: Crick Server
Always client should have one or zero Crick Servers that are synchronized with them. We should be able to export all data from the server and move them to another server.
I typed that it is not probable. It was my mistake. The server contains one source of truth, but it can be modified by requests from clients. Then if it is possible any change of state on the client should be instantly mirrored on the server, and a local stack of requests to send should be created only if a connection is impossible.

Question 2. The data model of time frame does not contain last modification time.
Answer: We can assume that the last modification time is not necessary. The valid version is this one which one was sent to the server as last.
We can assume also that last modification time can fix the problem with shallow and full synchronization. I propose to add last modification time to data model on server and client, because of it allows synchronizing selected frames in a more intelligent way than selecting all or selecting all from the last synchronization to now.
Proposition: add last modification time property to frame

Question 3. What about deletion?
Answer: By second step of synchronization I now mean replacing all data from client local database by server version. So if any element is deleted then all client time frames that can't be found on server should be deleted too.

Question 4. Why only POST / GET in API?
Answer: I treat it as a result of not predicted problems with synchronization. We should add PUT and DELETE. That's all.

Question 5. What is a scenario when in one backend it connected two clients, one has a time frame, the second doe's not?
Answer: It does not matter. The only log of requests to send is important, during full synchronization state of both clients should be replaced by the version from server.

Question 5. Who is a person that has to decide voice on this topic?
Answer: I understood that @jmaupetit.
What now?
You can treat it as a draft of the specification.
Now I think we can go to the fourth point of agenda: "Wait for fixes and opinions from community".
I hope any fixes or propositions, improvement, and questions will be obtained from @jmaupetit and the rest of the community. I think in March I will learn Go language and React, and in Aprill find a moment to modify, Crick API, Watson and fix synchronization.

Not only frames but also projects should be synchronized. So projects also should have last modified time. Probably other resources too if exists or will be created in the future.


Stops working with reCAPTCHA on

Hi
I have just installed and setup this service. Have it working however when I turn on reCAPTCHA, I just keep getting the error.
"There was an error changing your password
Error Information: An error occurred while sending the request."
if i turn off reCAPTCHA it works again.

Please try with the latest version and let us know if this is still a problem. Reopen the issue if necessary.


Only 10 Life Categories display correctly in the legend

Legibility of legend doesn't scale past 10 categories.  #11 is half-legible in the legend and #12 and up  is invisible.

With the switch to a vertical orientation, this issue basically goes away.

Well, technically I just his this bug. The size of the window should be related to the max of either the years or the number of events. A chart with two events, each of one months, demonstrates this bug.

Should now be fixed.

It's pretty cool to be part of this with you.  Gonna plug the site on FB once I start using it again tomorrow.
Mark Goadrich<EMAIL_ADDRESS>wrote:
“Closed #1.”
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.


How to make React directive disappear from the DOM?

Hi,
More than likely this is me not fully understanding how the bridge works but is there a way to remove the React component (e.g. hello tag in the examples) from the DOM?
Why do I need that? I have a component that uses Bootstrap 3 grid and some of the Bootstrap classes use % for widths. This doesn't work when the immediate parent of an element is no the real parent, eg. ul -> my-react-component->li

You should be able to change the configuration of the generated angular directive, see https://github.com/ngReact/ngReact#the-reactdirective-service (last paragraph).
Then I guess you can set the replace option

Unfortunately not much to be done around this. In order for replace: true to kick in, which is on by default, you need to provide a template or templateUrl value. However, all that will do is change that <hello> tag with all those attributes into a different element you specify in your template.
To achieve that dream of killing that fairly unnecessary container will require a bit more thought, and I'm not entirely sure how to achieve this through angular.


Ed25519 to X25519 Conversion algorithm

Hi,
I am building a typescript application and wanted it to be compatible with your did method key library
However, I am struggling to use the generated X25519 KeyAgreement keys, and I can't get to understand how you are deriving them.
As far as I understand, the transportation from Ed25519 to X25519 is possible, but one would need to translate the point coordinates, as explained  in this thread
Other implementations, like the one from Noble:noble-ed25519#x25519-and-curve25519 which you already checked on Issue #7  do in fact use that approach:
See line 573 https://github.com/paulmillr/noble-ed25519/blob/main/index.ts
The thing is that your approach in:
https://github.com/digitalbazaar/x25519-key-agreement-key-2020/blob/main/lib/crypto-nacl.js
seems to generate X25519 private keys that can be used for a DH exchange.
Regarding your implementation, I have tried to test it and can't replicate it within my application because I can't identify which hash algorithm does nacl.lowlevel.crypto_hash use. Reading the documentation, I understood it should be a SHA-512; but testing it against the own nacl hash function (which is in fact SHA-512) it doesn't produce the same result.
 const utf8Encode = new TextEncoder(); const encoded = utf8Encode.encode("Test message"); const hash2 = new Uint8Array(64); nacl.lowlevel.crypto_hash(hash2, encoded, 32); let hashed = nacl.hash(encoded); console.log("HASH TEST", hashed, toHexString(hashed), hash2, toHexString(hash2))
Could you help me with that?

In your test, you need to pass encoded.length instead of 32 (to use the proper length of the encoded "Test message" string you chose). Once you do this, you'll get the same hash value.
Note that you can see that nacl.hash just reuses the "lowlevel" crypto_hash hash function here:
https://github.com/dchest/tweetnacl-js/blob/master/nacl.js#L1129-L1134
https://github.com/dchest/tweetnacl-js/blob/master/nacl.js#L897 (exported as "nacl.lowlevel")

Thanks for the answer. That was indeed the issue. I was confused because the hash effectively is computed only for the first half of the private key (which maps to the d coordinate).
Regarding the algorithm for key derivation, is it possible either that the noble library or yours uses the algorithm to derive the public key instead of the private key? Would you know which is wrong?

Closing as it appears this is resolved. Regarding derivation of keys, the X25519 public key is translated from the Ed25519 public key. The private key in these cases is the random seed for Ed25519 and the clamped SHA-512 hash of the secret key for X25519. The public key would be a scalar point multiplication of the base point by the private key.
One thing that does need to get sorted amongst private key representations is whether the public key should be concatenated onto the end of the private key as it commonly is with Ed25519 (including in implementations like libsodium) but where it is not for X25519 (including in implementations like libsodium). Having these two be different sizes also helps prevent confusion between the two.
For further rationale, see: https://crypto.stackexchange.com/questions/54353/why-are-nacl-secret-keys-64-bytes-for-signing-but-32-bytes-for-box


docs: Add link to latest when viewing old changelog.

This will help prevent a common confusion that we've seen -- where a
user visits our /stable/ ReadTheDocs (since that's where we link for
the installer), and then sees that we haven't released in a while and
worries that the project is dead.
We may want to do further changes to clarify the situation on these
/stable/ pages, but this at least will get them to the current
changelog.md file.
Here's a screenshot; note that the version would be e.g. 3.4 in reality:

See https://chat.zulip.org/#narrow/stream/31-production-help/topic/Upgrade.20to.204.2E0/near/1162431 for motivation.

OK, so one thing that's a bit awkward about trying to display the version number is that commits like 34fbfe88ed14604eb9cc48ed5190805fabdbe1dd will disrupt it.  And in fact they may sabotage my +git test for whether to show the notice, hmm.
So I don't think this will be effective until we can figure out a better way to detect whether we're on a stable release series.  Possibly that just means we need to add a value in version.py for whether we're forked off a stable release series, and check that?

Since the czo link is referencing a topics of user who wasn't aware 4.0 is not released yet - with the warning saying "as of <X-dev+git> release" will this actually be clear to readers? One can realize it's unreleased from the "-dev+git" piece, but then it still says "release" which I could imagine confusing folks who aren't aware of the implications of the former.

Well, the CZO link is mainly about a different problem -- this PR is designed to solve the opposite problem "Oh, Zulip hasn't done anything since X", which I was reminded of.
It's possible the implementation we want here is (1) to not include the current version in the banner and (2) to have it display unless we're building from master/latest, however we're supposed to detect that.

I'm not sure I understand the problem this is intended to solve. I think it's about users who look at https://zulip.readthedocs.io/en/stable/overview/changelog.html , which currently looks like this:

and conclude that the project hasn't released in a while and is dead?
If someone was looking at that just before 3.4, the most recent date mentioned would have been about 5 months in the past; and that's the longest that interval has gotten in several years. For someone who gets concerned seeing that, I think this changelog isn't the thing that will most effectively reassure them -- I think they're interpreting the date through being accustomed to seeing the last commit at the top of a GitHub repo page:

and the thing that will very solidly reassure them is to take a quick look at our commit log at https://github.com/zulip/zulip/commits/master .
So perhaps at the top of the "Unreleased" section say something like "This section is an incomplete draft of the notes for the next release. See also the commit log for an up-to-date raw list of changes."
(That's similar to the existing "updated in bursts" language, but I think is more explicit that you should expect this to be not at all complete unless a release is imminent.)

Yeah, that seems like a good solution.

I also added the following commit to the 3.x documentation; I will also update our "new major release" checklist to recommend adding a commit of this form when we fork a stable release branch:


Added main method to create csv

Implemented main method to clean up data to a csv file

We'll need to continue updating main in future sprints

I agree


[FLINK-23340] add more dev setup instructions

Add some tips on the project setup for developing exercises and solutions and some useful Gradle commands.

Hehe, thanks - the credit for the IDE setup though goes entirely to apache/flink where I got this part from :)


Improve documentation for pointblank YAML

YAML can now be produced from a pointblank agent or informant. However the documentation around this feature is very minimal.
There needs to be function documentation for the two exported functions. Also, a vignette/article would be useful here.

There is suitable documentation for all of the yaml_*() functions but articles still need to be written.


Login with jwt

Closes #19
Completed jwt setup on backend, created login & registration API
Contains many fixes in database

Great! Let's merge it


Add a default model for the Google Analytics tap

Migrated from GitLab: https://gitlab.com/meltano/meltano/-/issues/672
Originally created by @iroussos on 2019-05-31 16:22:22

Add the default model and designs to be used with tap-google-analytics when it runs with the default Meltano Settings.

View 4 previous comments from the original issue on GitLab


Three node RKE2 Cluster on SLES fails on startup

Describe the bug
When launching a three node RKE2 cluster from Rancher onto Harvester, only two out of the three nodes will successfully join the cluster.
To Reproduce
Steps to reproduce the behavior:

Using Rancher 2.6.1 and Harvester 0.3.0, go to Rancher and provision an RKE2 cluster on Harvester.
Use the JeOS SLES15-SP3-JeOS.x86_64-15.3-OpenStack-Cloud-GM.qcow2 image
Add user data to install needed packages:

#cloud-config
runcmd:
- zypper ar -cfG 'https://mirrors.tuna.tsinghua.edu.cn/opensuse/tumbleweed/repo/oss/' tuna-oss
- zypper ar -cfG 'https://mirrors.tuna.tsinghua.edu.cn/opensuse/tumbleweed/repo/non-oss/' tuna-non-oss
- zypper ref
- zypper -n in glibc-2.34-2.1.x86_64 glibc-locale-base-2.34-2.1.x86_64 filesystem-84.87-3.1.x86_64 apparmor-parser

one out of three nodes will fail to boot

Expected behavior
All three nodes should boot
Environment:

Harvester ISO version: v0.3.0
SLES version: SLES15-SP3-JeOS.x86_64-15.3

Additional context
Add any other context about the problem here.

To Test:

Provisioning the RKE2 cluster on Harvester with Rancher v2.6.3-rc1.
Use the JeOS SLES15-SP3-JeOS.x86_64-15.3-OpenStack-Cloud-GM.qcow2 image
Add user data to install needed packages:

#cloud-config
runcmd:
- zypper ar -cfG 'https://mirrors.tuna.tsinghua.edu.cn/opensuse/tumbleweed/repo/oss/' tuna-oss
- zypper ar -cfG 'https://mirrors.tuna.tsinghua.edu.cn/opensuse/tumbleweed/repo/non-oss/' tuna-non-oss
- zypper ref
- zypper -n in glibc-2.34-2.1.x86_64 glibc-locale-base-2.34-2.1.x86_64 filesystem-84.87-3.1.x86_64 apparmor-parser

all nodes and the cluster should

RKE2 cluster can be created with Rancher v2.6.3-rc1 and JeOS SLES15-SP3-JeOS.x86_64-15.3-OpenStack-Cloud-GM.qcow2.


ovirt-aaa-jdbc: allow setting attributes via this role

@mwperina
@machacekondra
I would like to have the ability to set some attributes from:
--attribute=[=]
Available names:
department
description
displayName
email
firstName
lastName
title
the command should be something like
"/usr/bin/ovirt-aaa-jdbc-tool user {{ (item.state is undefined or item.state == 'present') | ternary('add','delete') }} {{ item.name }} --attribute=firstName={{ item.name }} --attribute=department='My department'"
I am thinking to add an extra_ops parameter:
users:
- name: user1
authz_name: internal-authz
password: 1234568
valid_to: "2018-01-01 00:00:00Z"
extra_ops: --attribute=firstName=bob --attribute=department='My department'"
- name: user2
authz_name: internal-authz
password: 1234568
valid_to: "2018-01-01 00:00:00Z"
would this be fine by you?
or do you have another suggestion?

why not just have attributes dicitnary?
users:
     - name: user1
       authz_name: internal-authz
       password: 1234568
       valid_to: "2018-01-01 00:00:00Z"
       attributes:
         firstname: 'bob'
         department: 'My department'


Biorand re2 crash report

Version
3.1.8 (2f583cd)
Seed
R720-VC2Z-ZXQQA0N5K9Y0007JZZZRZZZ7ZZZZZZZZZZZZZZZZZZZZZZZZZ
Scenario
RE 2 (Leon A)
Player Character
carlos re3r
What happened?
when leaving the rpd car park after pushing the van, the next room containing moths causes the game to crash after a few seconds.

I think moth crashes are fixed in dev. builds now


how to finetune LLaMAX3

I tried llamax3 and it worked great.  I want to fine-tune this model using domain data. Can you share your training code?
Thanks.

I tried llamax3 and it worked great. I want to fine-tune this model using domain data. Can you share your training code?
Thanks.

Thank you for your interest in our work. LLaMAX is trained based on the LLaMA model, so any training framework that supports LLaMA can be directly used to fine-tune LLaMAX. For example, you can refer to the following Hugging Face training code: https://github.com/huggingface/transformers/blob/main/examples/pytorch/language-modeling/run_clm.py to fine-tune LLaMAX on your own data.

Thank you for your reply. I will close this issue.

I tried llamax3 and it worked great. I want to fine-tune this model using domain data. Can you share your training code?
Thanks.

Thank you for your interest in our work. LLaMAX is trained based on the LLaMA model, so any training framework that supports LLaMA can be directly used to fine-tune LLaMAX. For example, you can refer to the following Hugging Face training code: https://github.com/huggingface/transformers/blob/main/examples/pytorch/language-modeling/run_clm.py to continue pretrain LLaMAX on your own data. If you want to perform supervised fine-tuning on your own data based on LLaMAX, the following code will be useful: https://github.com/tatsu-lab/stanford_alpaca/blob/main/train.py Note that you may need to adjust the special tokens in lines 27-30 of the alpaca code to be compatible with LLaMA3-based models.


Use more idiomatic angular when parsing opts, and add a provider to allow setting of defaults

The provider allows default options to be set globally, along with an option to import Hammer's own presets if you defined them there. It merges those options in to any provided where appropriate.
In addition I strip down code duplication by normalizing opts to an array, takingcare (hopefully correctly!) to cater for custo mdirective and applying defaults eg doubletap.
Nice work! I hope this helps a little.

I'm going to need to make some small changes to authorship and such before publishing this. Going to make a contributor list and change the copyright to be the group of us. Thanks for taking the time to do pretty much everything I wanted to do 6 months ago but haven't had time for.

The bower version of the repo doesn't consist of the changes in https://github.com/jsdw/angular-hammer/commit/4562fc4e261a339abc8f6bc7e8d9010f3343289b. Is there any plan to merge it to bower version of the repo? Because for now I am referring the commit directly in my bower.json file

I will do this eventually, but I haven't been working on touch stuff much recently and therefore haven't had a chance to test it. If you find that this is pretty stable then I will tag a release and push to NPM and Bower.

I use this at work quite a lot with multiple hammer events (and others) soetimes attached to single elements, and everything has been ok thus far, but frankly I found HammerJS a bit of a pain working with - it doesnt feel very developer friendly for this sort of thing - and so I wouldn't be surprised if there were edge cases specifically regarding passing options through and using custom events.
One thing I noticed, iirc, is that click duration is ignored when you combine a hm-tap with a hm-pan. I believe the issue was with hammer rather than this plugin but didn't take the investigation very far as it wasn't too important at work.

Well that last bit is fascinating. I will say that last I heard Hammer.js was going on the original author's back burner. Not sure what the current status is though, maybe someone took over.

@RyanMullins I haven't found any issues till now. But, a new issue has popped up for iOS 9. I have opened a separate issue for that (https://github.com/hammerjs/hammerjs.github.io/issues/28). But I guess for now you can published the above mentioned changes to npm and bower.

One thing I noticed, iirc, is that click duration is ignored when you combine a hm-tap with a hm-pan. I believe the issue was with hammer rather than this plugin but didn't take the investigation very far as it wasn't too important at work.

This should be fixed by the patch release we're working on.  There was a leaky config issue, the buggy behavior of which apparently most of our tests relied upon.

But, a new issue has popped up for iOS 9

We haven't begun looking at iOS9 yet, but if there is actually an iOS9 specific issue I'll take a gander it's related to the new force-touch API.


Ignore named encoding for non-embedded symbol fonts (issue 16464)

The affected font is non-embedded ZapfDingbats, however the PDF document for some inexplicable reason specifies the encoding as "WinAnsiEncoding" (which is obviously wrong).
To work-around this bug in the PDF generator, we'll simply ignore any explicitly specified named encoding for non-embedded symbol fonts.

/botio makeref


Hi I face error when I run firebase deploy --only functions.

Hey @chewszeqi, do you mean the json schema in firebase.json? Here you can specify the settings for deploying services such as Firebase functions. The google-services.json contains all your important private Firebase API settings and credentials.
You can replace the testing phone number and country prefix +46 with your own prefix and number. Returning to the activity_main.xml page sounds like the intended behaviour after registering. If you have a specific error or function to look at related to the phone number registration you can create a new issue here or in the original repository. I will see if I can help out with questions but there might be more people who can help you there:)


Failed to Build the Pipeline?

##[section]Starting: Run code quality tests
Task         : Command line
Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version      : 2.151.2
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
Generating script.
Script contents:
flake8 --output-file=/__w/1/b/lint-testresults.xml --format junit-xml
========================== Starting Command Output ===========================
##[error]Bash exited with code '1'.
##[section]Finishing: Run code quality tests

Look at the Test tab of your build.


Implement participant indicator for sessions

Description
Adds cursor display for other users in the same session and fixed related bugs.
This PR is associated with https://github.com/source-academy/sharedb-ace-backend/pull/26 and https://github.com/source-academy/sharedb-ace/pull/26/
Type of change

[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update
[ ] Code quality improvements

How to test
Multiple users join the same session. Upon entering, cursors of other users should automatically show. Each cursor whenever updated will move to its new position and show a label containing the name of the user associated with it ("undefined" if no name is detected).
To test the sharedb-ace package locally, run yarn build then yarn link on the sharedb-ace repository, then run yarn link @sourceacademy/sharedb-ace on the frontend repository.
Checklist

[x] I have tested this code
[ ] I have updated the documentation

Pull Request Test Coverage Report for Build<PHONE_NUMBER>
Details

4 of 98 (4.08%)  changed or added relevant lines in 4 files are covered.
1 unchanged line in 1 file lost coverage.
Overall coverage decreased (-0.2%) to 32.913%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

src/commons/editor/UseShareAce.tsx
3
6
50.0%

src/commons/editor/AceMultiCursorManager.tsx
0
22
0.0%

src/commons/editor/AceCursorMarker.tsx
0
69
0.0%

Files with Coverage Reduction
New Missed Lines
%

src/commons/editor/UseShareAce.tsx
1
22.64%

Totals

Change from base Build<PHONE_NUMBER>:
-0.2%

Covered Lines:
5281

Relevant Lines:
14939

💛  - Coveralls


Enables dynamic support for http and https OPENAI_API_HOSTs

In order to use local tools that offer an Open AI compatible API (I'm using litellm) without messing around with certificates, I needed to add http support to this plugin.
I've done this without breaking any existing behavior. The change detects if the OPENAI_API_HOST value starts with either http:// or https://, if it starts with neither, it will automatically add https:// to the beginning of the URL as before. Otherwise it leaves the URL as is.
I took this approach for two reasons:

No breaking change; if this change doesn't concern you, you won't notice it.
Security - if the url doesn't have the protocol specified, defaulting to https will ensure there are no accidental unsecured connections.

Thanks for all the work on this project and thanks for your consideration.

Thanks a lot! it looks good to me


To create a exit span with one statement, not two statement

Describe the solution you'd like
I'd like to create a exit span with one statement like:
spanStartTime = time.Now()
// do same stuff
CreateExitSpan(spanStartTime)

not two statement like:
span = CreateExitSpan()
// do same stuff
span.End()

Because when your program panic after CreateExitSpan(), you never have change to call span.End(), then this trace can not be sent. this is a demo to show this.
package main

import (
	"context"
	"github.com/SkyAPM/go2sky"
	"github.com/SkyAPM/go2sky/reporter"
	"log"
	"time"
)

func doSameStuff(ctx context.Context, tracer *go2sky.Tracer) {
	subSpan, _ := tracer.CreateExitSpan(ctx, "/database/query", "db", func(k string, v string) error {
		return nil
	})
	subSpan.SetComponent(5200)

	// something wrong and panic
	var a interface{}
	println(a.(int))

	subSpan.End()
}

func run(ctx context.Context, tracer *go2sky.Tracer) {
	// create root span
	rootSpan, ctx, _ := tracer.CreateEntrySpan(ctx, "/test", func(k string) (string, error) {
		return "", nil
	})
	rootSpan.SetComponent(5200)
	rootSpan.Tag(go2sky.TagHTTPMethod, "GET")
	defer func() {
		if err := recover(); err != nil {
			log.Println(err)
		}
		rootSpan.End()
	}()

	// do same stuff
	doSameStuff(ctx, tracer)
}

func main() {
	r, err := reporter.NewLogReporter()
	tracer, err := go2sky.NewTracer("op", go2sky.WithReporter(r), go2sky.WithInstance("RTS_Test_1"))
	if err != nil {
		log.Fatal(err)
		return
	}
	run(context.Background(), tracer)
	time.Sleep(time.Second)
}

Please update the issue in English, as this SDK has global users.
Also, I am not sure what you are proposing for clearing tracing context. Could you submit a pull request or demo codes to show how to do this?

Hi @xing393939, I think you can use recover() to catch the panic and call span.End() to report it in defer function, it may solve your problem

Hi @xing393939, I think you can use recover() to catch the panic and call span.End() to report it in defer function, it may solve your problem

If I do so, I need to get the span in the recover logic, the span can not got by the root span directly, so I need to do same extra work to pass the span, I do not think it is a good idea.


To support HTTP Basic authentication for docker/swarm provider's endpoint

Welcome!

[x] Yes, I've searched similar issues on GitHub and didn't find any.
[X] Yes, I've searched similar issues on the Traefik community forum and didn't find any.

What did you expect to see?
Traafic config example:
providers:
  swarm:
    endpoint: http://username:password@docker-socket-proxy:2375

This is a legit URL to the service, but Traefik does not parse this correctly, not taking username/password from the URL and trying to resolve everything as a single hostname.
May 24 09:08:36 utils01 dc7052128204[861]: 2024-05-24T09:08:36Z ERR Failed to retrieve information of the docker client and server host error="error during connect: Get \"http://username:password%40docker-socket-proxy:2375/v1.24/version\": dial tcp: lookup username:password@docker-socket-proxy: no such host" providerName=swarm
May 24 09:08:36 utils01 dc7052128204[861]: 2024-05-24T09:08:36Z ERR Provider error, retrying in 319.082513ms error="error during connect: Get \"http://username:password%40docker-socket-proxy:2375/v1.24/version\": dial tcp: lookup username:password@docker-socket-proxy: no such host" providerName=swarm

--
I am trying to replace http to tcp, the host's address is parsed correctly, but authentication is lost:
providers:
  swarm:
    endpoint: tcp://username:password@docker-socket-proxy:2375

Errors:
May 24 09:39:34 utils01 d353b15e7944[861]: 2024-05-24T09:39:34Z ERR Failed to retrieve information of the docker client and server host error="Error response from daemon: \r\n<title>401 Authorization
 Required</title>\r\n\r\n
401 Authorization Required
\r\n
nginx/1.25.5\r\n\r\n" providerName=swarm
May 24 09:39:34 utils01 d353b15e7944[861]: 2024-05-24T09:39:34Z ERR Provider error, retrying in 703.423221ms error="Error response from daemon: \r\n<title>401 Authorization Required</title>\r\
n\r\n
401 Authorization Required
\r\n
nginx/1.25.5\r\n\r\n" providerName=swarm

Hey @ba1dr,
Thanks for reaching out.
If any community member can help us find verified steps to reproduce and fix the issue if possible, we would love the help.


Implicit dependency on node-gyp

Using Yarn 2, I get the following warning:
fsevents@npm:2.1.2: Implicit dependencies on node-gyp are discouraged

Yarn's advice is to add an explicit dependency on node-gyp

We don’t use gyp

Maybe tell yarn to screw itself for being overly clever

Nvm i told em

I think there is an implicit dependency. From package.json:
"clean": "node-gyp clean && rm -f fsevents.node",
"build": "node-gyp clean && rm -f fsevents.node && node-gyp rebuild && node-gyp clean",

Linking the yarn issue for visibility yarnpkg/yarn#8052

Yes, but doesn't that mean it should be in devDependencies if it's required to build fsevents?

You are correct. Could you open a pr?

For the record, the dev dependency on node-gyp was added here: https://github.com/fsevents/fsevents/commit/59366e75171156ab2284f25668375a53656ae7ef

In my case I had installed yarn 2.0.0-rc.27 and managed to get it running
npm install -g yarn
that globally returned to 1.22.4

We don’t use gyp
Maybe tell yarn to screw itself for being overly clever
Nvm i told em

@paulmillr You're wrong and Yarn is correct here, fsevents is using node-gyp in the install script declared in its package.json. See the result from the registry here https://registry.yarnpkg.com/fsevents/2.2.0, also see the npm documentation on binding.gyp https://docs.npmjs.com/cli/v6/using-npm/scripts#default-values

@merceyz show me where the install script is
https://github.com/fsevents/fsevents/blob/master/package.json#L18

Please look at the two links I included, the first one shows the script and the second shows why its there.

Any update on this?


catch rvalue overloads with const rvalues instead of non-const rvalues

Prerequisite Checklist

[X] I searched for existing issues to prevent duplicates
[X] I searched for existing discussions on the forum to prevent duplicates
[X] I understand SFML's scope and believe the feature fits it

Describe your feature request here
in Graphics/Sprite.hpp there is deleted overloads for rvalue textures
Sprite(Texture&& texture, const IntRect& rectangle) = delete;

now this covers majority of rvalues but there is an issue in highly templated code const-rvalues can be made and it will bind to a const-lvalue or the user accidently tried to move a const object.
The standard library already does this with ref,cref with as_const.
to fix this make the signature like this
Sprite(const Texture&& texture,const IntRect& rect) = delete;

Use Cases
Notifies users who accidently moved a const variable
API Example
No response

See #3126

Oh sorry I did not see this issue.
also offtopic but I gave a reason for passing sf::Vector2 by value. in my previous issue sorry for late reply.

Oh sorry I did not see this issue.

What do you mean? I opened this PR ~5 minutes after your issue because it was a really easy fix. This was a good issue to open!

Oh okay I thought I had duplicated an issue.
sorry for being offtopic but I gave an example for why passing by value would improve performance.
https://github.com/SFML/SFML/issues/3047

Oh okay I thought I had duplicated an issue.

No worries. Just check the timestamps.

sorry for being offtopic but I gave an example for why passing by value would improve performance.

Please don't plug unrelated issues on GitHub. If you would like to get the team's attention about another issue then please join our Discord server where you speak with us.

okay thank you very much.

Thank you for bringing this to our attention! 🙂


Examples pub_sub and webgl are missing features = ["std_web"]

Problem
The examples pub_sub and std_web both don't compile since they are missing the features flag for the yew dependency.
Steps To Reproduce
Try compiling either of them
Expected behavior
Both examples should compile with either
cargo web start
or
cargo web start --features std_web
(Only the former in fact since they depend on std_web)
Environment:

Yew version 0.13.2 / master
Rust version 1.41.0
stdweb as specified in the toml
OS: Linux
Browser N/A

Questionnaire

[ ] I'm interested in fixing this myself but don't know where to start
[x] I would like to fix and I have a solution
[ ] I don't have time to fix this right now, but maybe later
~I can do a pull request but for two lines of code that seems overkill~

Nevermind did a pull request anyways :D

FYI there's already a PR for fixing pubsub
On Thu., Mar. 12, 2020, 12:40 a.m. Mathis<EMAIL_ADDRESS>wrote:

Problem
The examples pub_sub and std_web both don't compile since they are missing
the features flag for the yew dependency.
Steps To Reproduce
Try compiling either of them
Expected behavior
Both examples should compile with either
cargo web start
or
cargo web start --features std_web
(Only the former in fact since they depend on std_web)
Environment:

Yew version 0.13.2 / master
Rust version 1.41.0
stdweb as specified
OS: Linux
Browser N/A

Questionnaire

I'm interested in fixing this myself but don't know where to start
I would like to fix and I have a solution
I don't have time to fix this right now, but maybe later
I can do a pull request but for two lines of code that seems overkill
:D

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/yewstack/yew/issues/1021, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAIGXMO6272UTZEHZOGM743RG65ITANCNFSM4LFZ7YIQ
.

Oh yea should have checked that ^^


Setup Kanban Board of space-travelers-hub-react-redux project

https://github.com/aristides1000/space-travelers-hub-react-redux/projects/1
Our team is made up of 2 people:

Aristides Molina
Laylo Khodjaeva

STATUS: APPROVED 🟢 🥳
Hi @aristides1000 and @Laylo309   🥇 ,
Congratulations!!! 🥳 🎉
You have successfully completed all the expectations for this project, there is nothing more to do here, now you can go on your way and keep improving your skills.
Cheers and Happy coding!👏👏👏

If anything is not 100% clear please leave your questions or comments in the PR thread, we will be glad to help you 😄.

As described in the Code reviews limits policy  you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.


System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=<IP_ADDRESS> when running a Test Adapter Visual Studio Extension on VS 17.7.x or above.

Description
System.Runtime.CompilerServices.Unsafe assembly fails to load the correct version when creating an test adapter extension and this only happens on projects running on VS version 17.7.x and beyond. Works fine when running on 17.6.x or previous versions.
Note that adding a listener to AppDomain.CurrentDomain.AssemblyResolve and manually handle which Assembly to load kinda solves the issue but it seems to be an ugly workaround. Also, Visual Studio extensions can not leverage App.config for assembly version rebindings.
This issue seems similar to https://github.com/microsoft/vstest/issues/4673 but GenerateBindingRedirectsOutputType does not work in this case.
The zipped solution is attached to this issue.
BindingIssue.zip
Steps to reproduce
1 - Set the VSTEST_HOST_DEBUG environment variable to 1. This is needed so the testhost.exe can be attached to the debugger.
2 - Run the BindingIssue extension project in a visual studio version 17.7.x or greater.
3 - When running the BindingIssue via VS, it should create a new instance of the VS so the extension can be tested.
4 - On the new instance, open a solution that outputs an .dll library.
5 - Open the VS test explorer window.
6 - Attach the testhost.exe process in the debugging BindingIssue project.
7 - Notice that when calling Task.Wait or Task.WaitAll or yield return the process tries to load the assembly System.Runtime.CompilerServices.Unsafe Version=<IP_ADDRESS> instead of the one installed in the nuget package.
Note: There's a menu item button in VS under "Extensions/BindingIssue/Run Binding Issue Command" this command tries to emulate how the test adapter is called, and seems to work fine without trying to load the wrong version of the Unsafe assembly.
Expected behavior
The correct assembly should be loaded
Actual behavior
It should not throw:
System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
The correct version of the Unsafe assembly must be loaded.
Environment
Windows 10 and 11
Visual Studio version 17.7.x or above.

I'm seeing this too.
Ended up having to revert the library (CLIWrap[https://github.com/Tyrrrz/CliWrap]) to v3.6.1. Because it has a nested reference to System.Runtime.CompilerServices.Unsafe. Anything beyond that breaks the adapter completly. Not even test discovery works.
See nanoframework/nanoFramework.TestFramework#248

I don't think I follow the original repro. @josesimoes do you please have a simple repro for this? Do you still experience this problem on some of the later releases?

Following a migration from MVVM Light to CommunityToolkit.Mvvm nanoframework/nf-debugger#379 (using v8.3.2) .NET nanoFramework debugger which is used in our test framework, caused a failure to run test because of this.
Follows the log with the fusion log messages (apologies for part of it being in Portuguese):
[2024-11-26 6:29:30.995 ]  [nanoTestAdapter]: Exception raised in the process: System.AggregateException: One or more errors occurred. ---> System.IO.FileNotFoundException: Não foi possível carregar o ficheiro ou assemblagem 'System.Runtime.CompilerServices.Unsafe, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ou uma das respectivas dependências. O sistema não conseguiu localizar o ficheiro especificado.
   at System.Threading.Tasks.ValueTask.get_IsCompleted()
   at CliWrap.Command.<ExecuteAsync>d__49.MoveNext() in /_/CliWrap/Command.Execution.cs:line 294
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CliWrap.Buffered.BufferedCommandExtensions.<>c__DisplayClass0_0.<<ExecuteBufferedAsync>b__0>d.MoveNext() in /_/CliWrap/Buffered/BufferedCommandExtensions.cs:line 53
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at nanoFramework.TestAdapter.NanoCLRHelper.InstallNanoClr(LogMessenger logger) in E:\GitHub\nf-nanoFramework.TestFramework\source\TestAdapter\NanoCLRHelper.cs:line 41
   at nanoFramework.TestPlatform.TestAdapter.Executor.<RunTestOnEmulatorAsync>d__19.MoveNext() in E:\GitHub\nf-nanoFramework.TestFramework\source\TestAdapter\Executor.cs:line 659
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at nanoFramework.TestPlatform.TestAdapter.Executor.RunTests(IEnumerable`1 tests, IRunContext runContext, IFrameworkHandle frameworkHandle) in E:\GitHub\nf-nanoFramework.TestFramework\source\TestAdapter\Executor.cs:line 128
---> (Inner Exception #0) System.IO.FileNotFoundException: Não foi possível carregar o ficheiro ou assemblagem 'System.Runtime.CompilerServices.Unsafe, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ou uma das respectivas dependências. O sistema não conseguiu localizar o ficheiro especificado.
File name: 'System.Runtime.CompilerServices.Unsafe, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at System.Threading.Tasks.ValueTask.get_IsCompleted()
   at CliWrap.Command.<ExecuteAsync>d__49.MoveNext() in /_/CliWrap/Command.Execution.cs:line 294
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CliWrap.Buffered.BufferedCommandExtensions.<>c__DisplayClass0_0.<<ExecuteBufferedAsync>b__0>d.MoveNext() in /_/CliWrap/Buffered/BufferedCommandExtensions.cs:line 53

=== Informações de estado anteriores ao enlace ===
REG: DisplayName = System.Runtime.CompilerServices.Unsafe, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
 (Fully-specified)
REG: Appbase = file:///C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/Extensions/TestPlatform/
REG: PrivatePath inicial = NULL
A chamar assemblagem: System.Threading.Tasks.Extensions, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51.
===
REG: Este enlace tem início no contexto de carregamento LoadFrom.
AVI: A imagem nativa não será pesquisada no contexto LoadFrom. A imagem nativa só será pesquisada no contexto de carregamento predefinido, tal como Assembly.Load().
REG: A utilizar ficheiro de configuração da aplicação: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\TestPlatform\testhost.net48.exe.Config
REG: A utilizar ficheiro de configuração de anfitrião:
REG: A utilizar ficheiro de configuração do computador a partir de C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
REG: Referência pós-política: System.Runtime.CompilerServices.Unsafe, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
REG: O mesmo enlace foi verificado antes e falhou com hr = 0x80070002.
<---

Only after moving CommunityToolkit.Mvvm to v7.1.2, this issue is gone.
I've tried all the possible options that I could think of related with this: app.config, , . Nothing worked.
This is kind of easy to reproduce.

Clone https://github.com/nanoframework/nf-debugger
Clone https://github.com/nanoframework/nanoFramework.TestFramework/tree/vstest-4775
Load nanoFramework.TestFramework\poc\NFUnit Test DemoByReference.sln
Adjust path to nf-debugger project in nanoFramework.TestAdapter.csproj
Adjust path of test adapters in nanoFramework.TestFramework\poc\TestOfTestFrameworkByReference\nano.runsettings
Build, run tests in test explorer, all good.
Go to nd-debugger project update CommunityToolkit.Mvvm to v8.n.n
Clean, rebuild solution
Run tests again -> error message -> look into test output pane and the error is there.


Adds Makefile for publishing purposes

What does this PR do:

Adds a Makefile to allow us to just do make release VERSION=minor and it takes care of publishing and transpiling the code.
Removes the prepublish task from the package.json for 2 reasons:

It's already in the Makefile.
The relying on pre* and post* hooks is not good. As an example, for npm 4 will split the prepublish task into 2 - prepublishOnly and prepare - check more here: http://iamakulov.com/notes/all/npm-4-prepublish/

Adds the MAINTAINERS.md file with documentation on how to publish new versions.

Where should the reviewer start:

Diffs

Coverage remained the same at 100.0% when pulling 6ec0795f4f19eda7b6600fbce375a2cea6f6a59a on add-make-file into ca339914d8430916d682304a181172e2826b3a6d on master.

Coverage remained the same at 100.0% when pulling c65f7153a41f07b472c0700017827d1e05d2a9f8 on add-make-file into ca339914d8430916d682304a181172e2826b3a6d on master.

Coverage remained the same at 100.0% when pulling c65f7153a41f07b472c0700017827d1e05d2a9f8 on add-make-file into ca339914d8430916d682304a181172e2826b3a6d on master.

Coverage remained the same at 100.0% when pulling 64a86a7fb24ebdbb15df7a3d134d9f771aae0d17 on add-make-file into ca339914d8430916d682304a181172e2826b3a6d on master.

Why not use CONTRIBUTING.md file? Or at least delete it

@asci my bad, should've been deleted. Will do now.
The MAINTAINERS.md is the standard file to be used for people within the organizations that maintain the repos (admins, technical reviewers from the company).
The CONTRIBUTING.md is used normally for third-party contributors and/or users from within the company that don't have admin rights or direct responsibility to maintain the repo.

Coverage remained the same at 100.0% when pulling<PHONE_NUMBER>5006ba073e013da08c02684708969b on add-make-file into ca339914d8430916d682304a181172e2826b3a6d on master.


Create shared js file

How about if you created a shared 'core.js' file where you defined your delivery client, app and other shared code?

This would require modules, which would require running the files through a local web server. While that's realistically easy enough, I wanted the app to be so simple as to not require anything other than the files. I can add a note to the tutorial about it applying for larger projects.

@CollierCZ You can create the core.js and link it on your html pages before your other script files. You could initialize client, classes, app or other stuff there and store in a global var or you could think of it as a class which only provides functions, but does nothing at all on its own. For example, you could have a method there such as:
function getDeliveryClient()

which you would call on your other script pages. And similarly you could have other 'helper' method for other stuff (handling errors, adding elements to DOM ..)


Feature request: support for dialog-polyfill?

What
Add support for https://github.com/GoogleChrome/dialog-polyfill
This would be nice to have to help us start using the <dialog> element with more confidence.
Details
I see that this was requested back in 2017 and at the time the response was

We would need to ensure that the polyfill is filling for a standard feature of the web platform, which we're not sure is the case here.

Has the opinion of the maintainers changed in 2023 now that <dialog> is more widely supported?
https://caniuse.com/?search=dialog
https://www.scottohara.me/blog/2023/01/26/use-the-dialog-element.html
https://webkit.org/blog/12209/introducing-the-dialog-element/

Biggest issue I could see with this is it isn't a "set it and forgot" thing. You have many limitations when using the Dialog polyfill. For instance, when using the polyfill, you have to register each dialog element with the polyfill, as well as additional limitations

Of course this could be surfaced this to users, however the polyfill also doesn't handle focus management which needs to be explained as well.


Integrated typescript typings

Hi José.
Here's a pull request that integrates Typescript typings for both the spotify-web-api-js library and the entire spotify web api into the library.
This is a big improvement over the Typescript typings I contributed in january. The typings are updated to include all new endpoints in the Spotify Web API and adds typings for the new methods in the library. Also, by including typings in the library, the user always has the correct typings and doesn't need to browse the typings repositories (DefinitelyTyped, et.al.)
Also, the README.md is updated with an animated GIF as example as well as instructions on how to import the library in Typescript globally or as a module.
I run a project for sports music in Denmark, https://idraetsmusik.dk and use the Spotify Web Api a lot. I find the typings help me a lot during development and I would like to continue keeping them updated in this library.
I hope you can use this contribution and that you have time to review the pull request. Please send me any suggestions for modifications.
Regards,
Niels K.H. Skovmand.

Coverage remained the same at 97.973% when pulling 9c5423def92c0d239da30221d53205d355bf2a44 on skovmand:integrated-typescript-typings into c1e17c6524453effc032e1325cdd4d5e03f7f0f8 on JMPerez:master.

Coverage remained the same at 97.973% when pulling 9ff6bc3f44074f99c71d92445f55a0c6d71b7e15 on skovmand:integrated-typescript-typings into c1e17c6524453effc032e1325cdd4d5e03f7f0f8 on JMPerez:master.

Coverage remained the same at 97.973% when pulling 3955e3b1f24336649ea9502faa2502316e6f6f21 on skovmand:integrated-typescript-typings into c1e17c6524453effc032e1325cdd4d5e03f7f0f8 on JMPerez:master.

This is the most awesome PR I have seen in a long time. Thank you so much @skovmand!!
https://media.giphy.com/media/4Z3DdOZRTcXPa/giphy.gif

Thanks! And thanks for the Chuck Norris approval :-)

@skovmand Maybe I'm being dense, but is there anyway to access these types external to the SpotifyWebApiJs namespace?
For example I'd like to store certain things in React state e.g. something like:
import * as SpotifyWebApi from 'spotify-web-api-js';

interface AppState {
  spotify: SpotifyWebApi.SpotifyApi;
  playlist: SpotifyWebApi.PlaylistBaseObject;
}

However these interfaces are not exported from this namespace, was this intentional?

D'oh totally figured this out. It's just
import * as SpotifyWebApi from 'spotify-web-api-js';

interface AppState {
  spotify: SpotifyApi.ListOfUsersPlaylistsResponse;
  playlist: SpotifyApi.PlaylistObjectSimplified;
}

Still getting used to how Typescript does namespaces.

Great to hear that. I was just about to investigate your problem.

The SpotifyApi.* types work for me. But I can't use the type of the SpotifyWebApi object itself.
I'm trying something like:
function authorize(api: SpotifyWebApiJs.SpotifyWebApiJs): void {
    const token = "...";
    api.setAccessToken(token);
}

@skovmand, is there anything I need to import first?

@rshkv I am unable to use that type as well.


Add extraVerticalOffset value to VerticalLine

Hi. First of all thanks for the amazing library, it's really awesome!
I have a use-case where I need VerticalLine elements to draw outside of the container that the chart is rendered in, all the way to the top of the screen. The best way I thought to achieve this was to add extra property to the VerticalLine and use this when drawing the vertical line.
So now we can draw from y location 0 - 300 which will draw a vertical line from 300 pixels above the chart container until the bottom of the container.
What do you think about this idea? Also, please suggest alternative naming for the variable, if you think there is a better name.

Hi @imaNNeoFighT , do you have some time to look at this PR and give your thoughts? If you approve of the approach I will do my best to add tests, update changelog and documentations, and anything else what is necessary for it to be approved and merged.
I'll try to explain the reasoning a bit more. We have a chart and I have drawn a rectangle around the container in which it is rendered. So the vertical line ends at the boundary of the container. But we want it to extend all the way to the top instead. For different reasons it is not easy to refactor the layout of the widgets into a Stack (for example) where the container has full height.

Hi @jseminck.
First of all, excuse me for the late reply.
I was busy as a bee.
I think this is a particular use-case. Also, it is a little weird that widgets draw something out of their boundaries.
I suggest you fork the repository and maintain this feature and use it in your project.


Master nodes not discovered

In a redis-cluster with 3 master and 3 slave (one for each) I have that some master could become a slave because of a master fault or simply a restart.
Now, how I can discover which are the current master nodes?
I've to delete a key which starts with a particupar pattern (let's say cache:aaa*) on all the nodes.
This is what I currently do:
  public function keys_clustered($pattern) {
    $allkeys = [];
    $client = $this->get_redis(); //return the predis client
    $cmdKeys = $client->createCommand('keys', [$pattern]);

    $connections = $client->getConnection();
    if (!$connections) {
      throw new Exception("Cannot get REDIS connections in " . get_class($this));
    }
    if (count($connections) > 1) {
      foreach ($client->getConnection() as $nodeConnection) {
        $nodeKeys = $nodeConnection->executeCommand($cmdKeys);
        $allkeys = array_merge($allkeys, $nodeKeys);
      }
    } else {
      $cmdKeys = $client->createCommand('keys', [$pattern]);
      $allkeys = $client->executeCommand($cmdKeys);
    }
    return $allkeys;
  }

But this code doesn't search for actual masters. It simply uses the configured list of node in the predis constructor.
How I can get all these keys?

Hi @danieleteti,
Indeed iterating over Predis\Connection\Aggregate\RedisCluster usually doesn't return all the connections to the master nodes of a redis-managed cluster, instead you get the connection instances currently initialized by Predis (not only the ones supplied to Predis\Client::__construct() but also the ones that the client discovered and connected to).
That said, trying to delete a subset of the keys spread over the keyspace is a bit tricky with redis-cluster but still not impossible. First of all I suggest avoiding KEYS because it's a resource-intensive command, it can "block" redis when the single instance holds millions of keys and can potentially return an humongous-sized response which could even end up killing PHP due to the memory_limit directive, instead you should use SCAN which iterates the keyspace incrementally with a cursor-based approach (we have a nice abstraction in Predis for that).
This is a quick function that fetches the current slots map from redis-cluster in order to extract the list of master nodes from it, then it creates a new connection for each master node and uses it to create a new client (for convenience instead of using ConnectionInterface::executeCommand()) and invokes a callback supplied by the users:
function cluster_iterate(\Predis\ClientInterface $client, $callback)
{
    $clientClass = get_class($client);
    $clientOptions = $client->getOptions();

    $cluster = $client->getConnection();
    $connector = $cluster->getConnectionFactory();
    $slotsmap = $cluster->getSlotsMap() ?: $cluster->askSlotsMap();

    foreach (array_unique($slotsmap) as $node) {
        $nodeConnection = $connector->create($node);
        $nodeClient = new $clientClass($nodeConnection, $clientOptions);

        $callback($nodeClient);
    }
}

Then a script that deletes the keys marching a certain pattern on each node of the cluster would look like this:
$clusterClient = new Predis\Client(['tcp://<IP_ADDRESS>:7000'], ['cluster' => 'redis']);

cluster_iterate($clusterClient, function ($nodeClient) {
    $keyspace = new \Predis\Collection\Iterator\Keyspace($nodeClient, "cache:*");

    foreach ($keyspace as $key) {
        $nodeClient->del($key);
    }
});

Everything considered I think this is the best possible compromise, but this approach still requires a few considerations:

One could think of implementing a chunked iterator (an iterator that returns multiple values at once from the inner iterator) and wrap Predis\Collection\Iterator\Keyspace in order to use the variadic property of DEL, unfortunately it is not possible to a single DEL with multiple keys as they would most likely end up raising a -CROSSSLOT error even when all of the specified keys live on the same node. That's how redis-cluster work.
It is still possible that a migration in the cluster occurs during the iteration, this will almost certainly result in -MOVED or -ASK responses being returned by Redis and the client will throw an exception. How to handle this exception is up to the implementer, one could even try to reissue the same command using $clusterClient instead of $nodeClient so that the client will discover the correct node by itself, but in this specific case with DEL you might end up with keys migrated from a node ahead of iteration to one past the current position of the iteration.

Thank you for your example. Currently I finished to ask a CLUSTER NODES to redis and then create a specific predis instance with only the master nodes. I'll change KEYS to SCAN ASAP, but still I need a way to be sure that predis is talking only with master nodes.
Somehting like:
$config =
$client = new PRedis($config);
...here I've to be sure that $client is connected only to master nodes...
With my solution I've to reimplement a microredisclient to issue a CLUSTER NODES to understand how the cluster is and the crete predis. Is there a way to let predis understand itself and let it connects only to master nodes?
Still thank you.

Why putting slaves at all in $config? The parameters array for Predis\Client must point only to master nodes in the cluster (actually you don't even strictly need to specify all of them). Moreover, when Predis requests the updated slots map from the cluster, the current implementation of askSlotsMap() discards any detail about slaves. Slaves, after all, are not really that useful to the client in this context unless you want to spread read-only operations to reduce the load on the master nodes (a feature which is currently not supported by Predis). When a master node fails, redis-cluster automatically promotes one of the slaves and this change is reflected in the output of the cluster-related commands when asking for the new configuration. Basically we don't care about slaves.
By the way if you want to get these info "manually" from a node of the cluster, I think it's easier to use CLUSTER SLOTS (even if you don't care about the slots map configuration) as the response format is way more friendly compared to that of CLUSTER NODES.

Just a quick update: after commit 922e56b (which means starting with Predis v1.1.0 when it will be released) the function cluster_iterate() from my previous comment can be reduced to the following:
function cluster_iterate(\Predis\ClientInterface $client, $callback)
{
    foreach ($client->getConnection() as $nodeConnection) {
        $nodeClient = new $clientClass($nodeConnection, $client->getOptions());
        $callback($nodeClient);
    }
}

Basically Predis\Connection\Aggregate\RedisCluster::getIterator() now returns all the connections to the master nodes in the cluster (even the ones not yet registered in the pool) by fetching the slots map from one of the servers.

Improvements have been made for v1.1.0 so I'm closing this issue, anyway feel free to post further comments on the matter if you need more clarifications.


What is the difference with GetX?

subj

Hi @bubnenkoff !
So, there are a few differences:

Cube uses ChangeNotifier instead of Stream. This makes things much simpler and changes are reflected immediately.
Cubes use dependency injection using get_It;
Cubes provider a way to communication with View chamado CubeAction. That way you can delegate View inherent actions that depend on the BuildContext such as navigation animations, etc.
Cubes uses extensions to create Widget listening aObservableValue in simple way.
Cubes have widgets that facilitate reactive use with ObservableValue like CFeedBackManager, CTextFormField .

I think that's it. ☺
I hope I helped you.


Unable to assign to Option<String> and Option<Cow<'static, str>>

Problem
In Yew 0.17 the following code worked:

#[cfg(test)]
mod test {
    use super::*;
    use crate::{html, ComponentLink, Html};
    use crate::html::Properties;

    #[derive(Properties, Clone)]
    pub struct MockProps {
        #[prop_or_default]
        string: String,
        string_opt: Option<String>,
    }

    pub struct MockComponent;

    impl Component for MockComponent {
        type Message = ();
        type Properties = MockProps;

        fn create(_props: Self::Properties, _link: ComponentLink<Self>) -> Self {
            unimplemented!()
        }

        fn update(&mut self, _msg: Self::Message) -> bool {
            unimplemented!()
        }

        fn change(&mut self, _props: Self::Properties) -> bool {
            unimplemented!()
        }

        fn view(&self) -> Html {
            unimplemented!()
        }
    }

    #[test]
    fn test_str() {
        html!{
            <MockComponent
                string="foo"
                string_opt="foo"
                />
        };
    }
}

With Yew 0.18, this fails with:
error[E0277]: the trait bound `&str: conversion::IntoPropValue<std::option::Option<std::string::String>>` is not satisfied
   --> packages/yew/src/html/conversion.rs:138:28
    |
138 |                 string_opt="foo"
    |                            ^^^^^ the trait `conversion::IntoPropValue<std::option::Option<std::string::String>>` is not implemented for `&str`
    |
    = help: the following implementations were found:
              <&'static str as conversion::IntoPropValue<std::borrow::Cow<'static, str>>>
              <&'static str as conversion::IntoPropValue<std::string::String>>

Steps To Reproduce
Steps to reproduce the behavior:

Compile the code above

Expected behavior
I would expect to have a simple way to assign T to Option using the macro.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment:

Yew version: 0.18, master
Rust version: 0.51.0

Questionnaire

[X] I'm interested in fixing this myself but don't know where to start
[ ] I would like to fix and I have a solution
[ ] I don't have time to fix this right now, but maybe later

I have the same issue when switching from String to Cow<'static, str>.

@ctron, same issue when assign value to properties like (input) 'max', I just use 'value.to_string()', and it works now. Hope that can help.

Yea, that works. But also clones. And doesn't work with Cow.
I played around a little bit with the Yew code, and it looks to me the problem is the concept of IntoOptPropValue<T>. That doesn't work properly.
Removing this in favor of IntoPropValue<Option<T>> seems to bring the same functionality, but removes the problem. So you can properly assign &str to Option<Cow<static, str>>and&strtoOption` too.

I created a PR (#1895) which works fine for me, and doesn't seem to have any negative effects.

I'm also experiencing this issue updating from yew 0.17 to 0.18.
Would be amazing if the fix from #1895 could be ported to 0.18 and released on crates.io :angel:

Yea, I was hoping for a release of this too. Either 0.18 or 0.19.


support to specify os disk size

WIP, need find out a public Shared Image Gallery to test.

Not sure about how the requirements work, will this allow us to specify requirement: min_disk_size_gb=50 or something similar? I am so glad we are getting this feature, thank you @LiliDeng for working on it!!

by default mariner image is 2 GB, it will be out of space when install the frist package, this is the main reason I created the PR.


test coverage

test, please ignore

Codecov Report

Merging #54 into master will decrease coverage by 14.3%.
The diff coverage is 84.21%.

@@             Coverage Diff             @@
##           master      #54       +/-   ##
===========================================
- Coverage   46.27%   31.96%   -14.31%
===========================================
  Files         219      168       -51
  Lines       25548    16546     -9002
  Branches     5904     2546     -3358
===========================================
- Hits        11822     5289     -6533
+ Misses      13596    11155     -2441
+ Partials      130      102       -28

Impacted Files
Coverage Δ

boards/posix/native_posix/main.c
100% <ø> (ø)
:arrow_up:

boards/posix/native_posix/timer_model.c
92.5% <100%> (-7.5%)
:arrow_down:

boards/posix/native_posix/hw_models_top.c
84.31% <83.33%> (+6.53%)
:arrow_up:

include/net/buf.h
0% <0%> (-100%)
:arrow_down:

include/net/net_mgmt.h
0% <0%> (-100%)
:arrow_down:

subsys/net/ip/nbr.c
0% <0%> (-93.75%)
:arrow_down:

subsys/net/ip/utils.c
0% <0%> (-93.27%)
:arrow_down:

subsys/net/ip/net_core.c
0% <0%> (-91.14%)
:arrow_down:

subsys/net/ip/net_context.c
0% <0%> (-88.55%)
:arrow_down:

subsys/net/ip/connection.c
0% <0%> (-88.43%)
:arrow_down:

... and 128 more

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 afe5056...0ddd1f9. Read the comment docs.


error calling Paginate: 'pager size' must be a positive integer

with hugo version Hugo Static Site Generator v0.16 BuildDate: 2016-06-06T05:31:27-07:00 a fresh new site just created with hugo new site
ERROR: 2016/08/21 13:27:05 general.go:222: Error while rendering homepage: template:
theme/index.html:27:29: executing "theme/index.html" at <.Paginate>:
error calling Paginate: 'pager size' must be a positive integer

Sorry, I had no time to test the theme with v0.16 yet. I will look through this bug during next month. Please let me know if you fix it by yourself :)

I couldn't reproduce your error.
The theme seems to be working fine with v0.16 of gohugo

Reproduced and fixed with #9

#9


Support non-QName's in XmlStructuralPlanner

Fixes #1642

@jsantos17 Can you assign this PR to someone?  Also it needs a version: label.

@jsantos17 Did you rebase the commits?

@djspiewak indeed. I needed to get some changes from 2286.

@jsantos17 You should try to merge in that case, instead of rebasing.  Or at least, rebasing the commits that are already pushed.  Once you've pushed commits to your fork (on a non-wip/ branch), and especially once you've opened a pull request, those commits are no longer something that you should consider mutable.  Someone else may have merged your branch locally to facilitate their own work, and rebasing breaks that, which is why we don't do it.
tl;dr: Don't rebase unless the affected commits only exist locally or on wip/ branches.

@djspiewak Cool, I'll use merge from now on. I make really sure nobody else is using my branch before I rebase/make any destructive changes. Didn't know about the wip/ convention. I'll use it on my next issue. Thanks for telling me!

I make really sure nobody else is using my branch before I rebase/make any destructive changes

This is basically the motivation for the wip/ convention (and more notably, for not rebasing on non-wip/): you really have no way of knowing for absolutely sure.  I may have grabbed the changes locally, but without telling anyone.  I wouldn't discover the issue until I hit merge conflicts trying to PR my changes to master.

@djspiewak sounds like a good convention. Maybe it's worth mentioning in the "SlamData Development Process" document? The workflow in the document suggests using rebase too, so it probably needs updating to reflect the conventions we actually use.

Yeah, that document is incredibly out of date.  We should definitely update it.

@jsantos17 arg yeah sorry about that document :( I just updated it, modifying the sections on rebasing and merging PRs, so it should be correct now. But if anything still looks wrong, let me know (or just fix it :) )

This is almost done. Only missing is a test for keys not known statically. Would you mind checking again @wemrysi?

@jsantos17 Does the projectFieldWithFlatten regression test pass now (the comment in #1948) seems to indicate it should.

@wemrysi projectFieldWithFlatten is working. It was fixed in my previous PR right here. Looks like I forgot to remove it from #1948.

@wemrysi not sure if the other message sent a notification, but this is ready for another look.

@wemrysi this is ready for another look.


Create migrator table interface and add tests for the migrations

The migrate functionality currently has no tests. This makes it harder to refactor and add further functionality.
This PR implements an abstraction for the migrations table to be used while testing and adds some basic tests.
It also adds two minor behavioral changes:

Providing feedback if no migration files were found (or directory was not valid)
Providing feedback if no CQL statements were found in a migration file.

The behavioral changes could also be split into a separate MR if desired.
I'd also like to thank you for this library and hope you accept contributions. :)

@bilias23 @annismckenzie thank you for the patch. As it's a big change I'll need some time to evaluate it.

Sorry for being unresponsive. Sad that you don't like, though. I agree on the integration test part and will prepare something. As we already have another feature in our fork (adding the ability to read the migration files from an embedded http.FileSystem) and because that is based on this work, I'm gonna have to maintain our fork for a longer time.
I'll send those two commits in a separate PR later this week.

Sorry for being unresponsive

No worries.

As we already have another feature in our fork (adding the ability to read the migration files from an embedded http.FileSystem)

What could be an interesting contribution is adding
func Migrate(ctx context.Context, session *gocql.Session, p Provider) error

based on abstract migrate.Provider
type Provider interface {
List() ([]string, error)
Open(name string) (os.ReadCloser, error)
}

WDYT?

Well, both dir string (via http.Dir) as well as any other virtual file system implement http.FileSystem, making the current method signature backwards-compatible (dir string is just wrapped in http.Dir()). I currently have a fork-only PR open for a colleague and me to collaborate and comment on here. The migrate.Provider interface would just be another layer of abstraction for what we're doing over there, you'd still end up with NewNativeFileSystemProvider(dir string) *osFileProvider that would wrap http.Dir and coax the return values to your interface methods. I mean, yeah, http.FileSystem is heavy… now I'm right back at the beginning.

Using http interfaces introduces dependency to http that is hard to justify. The package shall define it's own interfaces that are convenient to use and reflect the domain...
Unit testing this must be strange as http.File inherits from so many interfaces that are irrelevant.

I'm closing this as #49 implements testing for migrations and #48 adds capability to execute custom code around migrations.


ci: linkage-monitor-artifacts.txt generation

Linkage Monitor by default searches for pom.xml files to get list of the artifacts that are generated by a repository. However certain repositories (such as gax-java) use Gradle and have no pom.xml files. Therefore Linkage Monitor has a functionality to let the repositories tell the list of artifacts. It reads linkage-monitor-artifacts.txt in the root of a repository.

@elharo I wish there is. I didn't think of a better way to read values in build.gradle than coding within it in Groovy.

It successfully detected linkage error in an example PR.
https://github.com/googleapis/gax-java/pull/1321/checks?check_run_id=2005535142