Re: [Wikitech-l] Issue loading JS with ResourceLoader but not with addScript

2017-04-18 Thread Krinkle
The error string "Module "jquery" is not loaded" actually comes from
mw.loader.require,
unlike the "Unknown dependency: jquery" error which can come from
mw.loader.load.

It looks like the "masonry.pkgd.js" script is detecting a
CommonJS-compatible environment
and therefore assumes jQuery must also be available through require().

ResourceLoader in MediaWiki only recently added support for module.exports
and require.
While it is available, it is not yet the default for most modules,
including jQuery.
However, this assumption is reasonable and actually fairly common in
libraries so we should
definitely add support for it. Either that, or we need a way for registered
modules to opt-out
of having require/module.exports available, so that libraries such as these
can be loaded
without problem.

-- Timo


On Tue, Apr 18, 2017 at 4:04 PM, James Montalvo 
wrote:

> No jquery dependency specified. I put together a minimal extension to
> demonstrate the issue. Below is a link to the comparison of the first
> commit (using ResourceLoader) and the second (using OutputPage::addScript).
>
> https://github.com/jamesmontalvo3/JustMasonry/compare/ResourceLoader...
> addScript
>
> On the `ResourceLoader` branch I get the 'Module "jquery" is not loaded'
> error. On the `addScript` branch I do not, and I'm able to use the library
> like:
>
> var test = new Masonry("#bodyContent");
>
> OS:
> CentOS Linux release 7.3.1611
>
> Installed software:
> MediaWiki 1.27.2 (1c409c5)
> PHP 5.6.30 (apache2handler)
> MariaDB 5.5.52-MariaDB
> ICU 50.1.2
>
> Skins:
> Vector – (d11a80a) 12:02, 19 May 2016
>
> Extensions:
> JustMasonry 2017.4.18 (68bcd0a) 17:47, 18 April 2017
> I removed all other extensions and confirmed this is still an issue.
>
> Thanks,
> James
>
> On Tue, Apr 18, 2017 at 1:51 PM, Legoktm 
> wrote:
>
> > Hi,
> >
> > On 04/17/2017 02:17 PM, James Montalvo wrote:
> > > Uncaught Error: Module "jquery" is not loaded.
> >
> > Does your module definition have a dependency on 'jquery'? You should
> > remove that as it will cause errors like this. jQuery is always loaded
> > before any other RL modules are.
> >
> > -- Legoktm
> >
> > ___
> > Wikitech-l mailing list
> > Wikitech-l@lists.wikimedia.org
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Issue loading JS with ResourceLoader but not with addScript

2017-04-18 Thread James Montalvo
No jquery dependency specified. I put together a minimal extension to
demonstrate the issue. Below is a link to the comparison of the first
commit (using ResourceLoader) and the second (using OutputPage::addScript).

https://github.com/jamesmontalvo3/JustMasonry/compare/ResourceLoader...addScript

On the `ResourceLoader` branch I get the 'Module "jquery" is not loaded'
error. On the `addScript` branch I do not, and I'm able to use the library
like:

var test = new Masonry("#bodyContent");

OS:
CentOS Linux release 7.3.1611

Installed software:
MediaWiki 1.27.2 (1c409c5)
PHP 5.6.30 (apache2handler)
MariaDB 5.5.52-MariaDB
ICU 50.1.2

Skins:
Vector – (d11a80a) 12:02, 19 May 2016

Extensions:
JustMasonry 2017.4.18 (68bcd0a) 17:47, 18 April 2017
I removed all other extensions and confirmed this is still an issue.

Thanks,
James

On Tue, Apr 18, 2017 at 1:51 PM, Legoktm 
wrote:

> Hi,
>
> On 04/17/2017 02:17 PM, James Montalvo wrote:
> > Uncaught Error: Module "jquery" is not loaded.
>
> Does your module definition have a dependency on 'jquery'? You should
> remove that as it will cause errors like this. jQuery is always loaded
> before any other RL modules are.
>
> -- Legoktm
>
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] "must be of type int, int given"

2017-04-18 Thread Stas Malyshev
Hi!

> Exception handler threw an object exception: TypeError: Argument 2 passed
> to stream_set_blocking() must be an instance of int, bool given in
> /vagrant/mediawiki/includes/libs/redis/RedisConnectionPool.php:233

This one is weird - second arg of stream_set_blocking should be boolean,
e.g.: http://php.net/stream_set_blocking

But looking into hhvm source, I find this:
https://github.com/facebook/hhvm/pull/7084

Looks like hhvm had a wrong definition of the function.

-- 
Stas Malyshev
smalys...@wikimedia.org

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] CREDIT next week, and a survey

2017-04-18 Thread Adam Baso
Hi all - just wanted to let you know the outcomes of the survey. Based on
the feedback, we're now:

* Going forward, after meetings and some post-processing, copying meeting
notes and linking to specific videos in a per-event page.
* Setting the channel topic consistently in #wikimedia-office (thanks to
others who have done this in the past).

We received a limited number of responses but I mainly wanted to
acknowledge that we continue to think about what other options might be
appropriate for better targeted presentations and times, group size, or
audience. On the one hand it would be nice to have separate sessions for
different time zones, and my impression is that a smaller group setting
would be more comfortable for some presenters (you may recall this sprang
from the original mobile showcase, a smaller group). On the other hand,
each event requires a fair amount of work and one hope is that different
stakeholders can get access to a broader set of topics without too much in
the way of formality.

As part of the follow up on this in line with the privacy statement, I'll
now be removing the survey responses from the backend.

Thanks to all who responded, and as always thanks to our great presenters
and interested viewers.

-Adam



On Fri, Jan 27, 2017 at 12:33 PM, Adam Baso  wrote:

> Hi everybody!
>
> As a reminder the CREDIT Showcase is next week on Wednesday,
> 1-February-2017 (see https://www.mediawiki.org/wiki/CREDIT_showcase for
> details). Also, as I mentioned previously we're conducting a survey about
> CREDIT. We'd appreciate your feedback! Here is a link to the survey (which
> is hosted on a third-party service), and, for information about privacy and
> data handling, the survey privacy statement.
>
> https://docs.google.com/a/wikimedia.org/forms/d/e/
> 1FAIpQLSedAtyPfcEhT6OVd26Y-3v_jm3yM3ShvMqgAWBUPxb24u_Y9g/viewform
>
> https://wikimediafoundation.org/wiki/CREDIT_Feedback_
> Survey_Privacy_Statement.
>
> This email is being sent to several mailing lists in order to reach
> multiple audiences. As always, please follow the list link at the very
> bottom of this email in case you want to manage your list subscription
> options such as digest, unsubscribe, and so on.
>
> And, as usual, if you'd like to share the news about the upcoming CREDIT,
> here's some suggested verbiage.
>
> *Hi *
>
> *I hope all is well with you! I wanted to let you know about CREDIT, a
> monthly demo series that we’re running to showcase open source tech
> projects from Wikimedia’s Community, Reading, Editing, Discovery,
> Infrastructure and Technology teams. *
>
> *CREDIT is open to the public, and we welcome questions and discussion.
> The next CREDIT will be held on February 1st at 11am PT / 2pm ET / 19:00
> UTC. *
>
> *There’s more info on MediaWiki
> , and on Etherpad
> , which is where we take notes and
> ask questions. You can also ask questions on IRC in the Freenode chatroom
> #wikimedia-office (web-based access here
> ). Links to
> video will become available at these locations shortly before the event.*
>
> *Please feel free to pass this information along to any interested folks.
> Our projects tend to focus on areas that might be of interest to folks
> working across the open source tech community: language detection,
> numerical sort, large data visualizations, maps, and all sorts of other
> things.*
>
> *If you have any questions, please let me know! Thanks, and I hope to see
> you at CREDIT.*
>
> *YOURNAME*
>
>
> Thanks!
>
> Adam Baso
> Director of Engineering, Reading
> Wikimedia Foundation
> ab...@wikimedia.org
>
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] "must be of type int, int given"

2017-04-18 Thread Denny Vrandečić
I tried to change the int to a float, easy enough, and the error went away.

Just to be replaced with

Exception handler threw an object exception: TypeError: Argument 2 passed
to stream_set_blocking() must be an instance of int, bool given in
/vagrant/mediawiki/includes/libs/redis/RedisConnectionPool.php:233

And I can't find a bool being given here. For fun, I cast $port to an int,
but that didn't change anything.

Grmpf.

Thanks for the pointer though.

On Mon, Apr 17, 2017 at 7:49 PM Chad  wrote:

> On Mon, Apr 17, 2017 at 3:07 PM Denny Vrandečić 
> wrote:
>
> > Ah, that's a good point! Sorry, stupid error.
> >
> > I think I did it now - adding to
> > mediawiki-vagrant/puppet/hieradata/common.yaml (I hope that is the right
> > approach).
> >
> > Now I get the following error, which seems unrelated to my extension. Hm.
> >
> > Apr 17 21:48:57 mediawiki-vagrant hhvm[29575]: #033[0m#033[22;31m[Mon Apr
> > 17 21:48:57 2017] [hphp] [29575:7ff81f7ff700:1:02] [] Exception
> handler
> > threw an object exception: TypeError: Argument 5 passed to pfsockopen()
> > must be an instance of float, int given in
> > /vagrant/mediawiki/includes/libs/redis/RedisConnectionPool.php:233
> >
> >
> That almost sounds like we should be casting the input to
> RedisConnectionPool
> to a float from an int. If it expects floats, easy enough to provide
> one...could just
> check with ctype_digit() so we can handle ints and strings that look like
> numbers.
>
> And probably throw an exception if we're not, it's probably bogus config or
> a bug
> if we're looking at non-numeric input.
>
> -Chad
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Issue loading JS with ResourceLoader but not with addScript

2017-04-18 Thread Legoktm
Hi,

On 04/17/2017 02:17 PM, James Montalvo wrote:
> Uncaught Error: Module "jquery" is not loaded.

Does your module definition have a dependency on 'jquery'? You should
remove that as it will cause errors like this. jQuery is always loaded
before any other RL modules are.

-- Legoktm

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] "must be of type int, int given"

2017-04-18 Thread Denny Vrandečić
Indeed, it seems your right - if I namespace the thing, the compiler
actually tells me that namespace/int is not the same as int. So yeah, it
probably assumes a type int here, which has no relation to the built-in
scalar int.

D'oh.

I didn't realize until know that one wasn't allowed to use type hints with
scalar types (int, string, bool, etc.) until PHP7. This explains a lot.

On Mon, Apr 17, 2017 at 9:33 PM Stas Malyshev 
wrote:

> Hi!
>
> > So, if I start a fresh MediaWiki Vagrant installation, and the vagrant
> ssh
> > into the virtual machine, the fastest way to reproduce the issue is to
> > start hhvmsh and type
> >
> > function f():int { return 1; };
>
> Suspicion: HHVM thinks "int" is a class name, not primitive type name.
> Not sure why though...
>
> --
> Stas Malyshev
> smalys...@wikimedia.org
>
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] "must be of type int, int given"

2017-04-18 Thread Denny Vrandečić
That would be neat!

On Mon, Apr 17, 2017 at 7:51 PM Chad  wrote:

> On Mon, Apr 17, 2017 at 2:07 PM Gergo Tisza  wrote:
>
> > On Mon, Apr 17, 2017 at 8:35 PM, Denny Vrandečić 
> > wrote:
> >
> > > Value returned from function f() must be of type int, int given
> >
> >
> > Have you enabled PHP7 mode
> > ?
> >
> >
> I'm curious if we should enable this in Vagrant and our Jenkins testing so
> we can avoid weird failures that spawned this thread.
>
> -Chad
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l