User:NeilK/Worklog/2011-01-18 to 2011-01-24

January 18, 2010

edit

Attended Features meeting remotely, but still too sick to work.

January 19, 2010

edit

Sick

January 20, 2010

edit

Sick of being sick, came into work although not 100% ready yet.

Worked a lot on the language library. Mdale's test suite has a lot of infrastructure and really only two tests (applied to many languages). Will port to Jasmine, so it can be much, much lighterweight, all the test-running infrastructure won't be needed.

Also, did not like how it obtained parsing results so slowly. Made a test spec generator which generates tests from the existing PHP implementation of the parser, saves as static JS which should be committed to repo.

Made a lot of progress -- now is running 50+ tests (combinatoric, languages * msgKeys * parameters), only problem seems to be that damn procPLURAL - it does not seem to be picking up new rules when we switch langs. Have to somehow tell it to reset itself and get new plural rules when we switch languages. Unsure how mdale's test is swinging that.

And then, rewriting the underlying library should be much simpler. Have in mind something that could probably do it all in just a few lines.

Uncertain about mdale's jquery case.

Roan, Trevor and I think that jquery magic makes more sense after the fact, after the base HTML has been made. The problem there is identifying the buttons after you've made them, since you can't rely on the same order in all languages.

Mdale wants to pass in event-bound jquery objects to templates, when constructing links or buttons, and have the library do complex swapping about with HTML and contained text. This however, is slightly inaccurate since it is at least theoretically possible to want two different buttons, with different bindings, but keyed off the same parameter... Still perhaps that case is too pathological to consider.

Perhaps the really right thing would be this:

  {{PLURAL this:$1|foo|bar}} blah blah {{PLURAL that:$1|foo|bar}}

Then later, 'this' and 'that' become ids in the generated HTML. Still unsure...

January 21, 2010

edit

Integrated complete test suite for languages, but... fails randomly due to language loading and globals overwriting each other.

Decided w/ Roan on making languages separated out by key; that is, the language is not a presumed global, you could potentially load two at once. Jasmine is declarative/asynchronous so it is hard to reconcile with a testing regime that depends on what the value of (say) mw.language.convertPlural() is at any given time.

Not only does this help testing, but we'll eventually have to do this for content languages anyway.


January 24, 2010

edit

MediaStorage meeting. Created some new stats from my shiny new toolserver account for MediaStorage uploads. Frustrating since the databases are unindexed in the ways we want, with uncooperative column types.

Ok. reconciling all these different implementations of parsing and language in MediaWiki.

We have:

  • Michael's patch in branch MwEmbedStandalone, which is somewhat improved, but still rather overcomplex by everyone else's standards.
  • my hacked version in trunk - extensions/UploadWizard/resources
  • the newly-namespaced version in trunk - resources

What we need to do:

  • bring the best of Michael's MwEmbedStandalone changes into the UploadWizard version
    • mw.Parser is basically the same
      • a few instances of 'for var in' which should be fixed
      • 'templateParCount' -- extends options?
      • allows for triple - curly braces? is this useful?
  • verify that his slow parserTest still works
  • try the jasmine test (will have failures, but will mostly work)
  • bring THOSE changes into the trunk/resources version
  • verify slow ParserTest still works
  • try the jasmine test (will have failures, but will mostly work)
  • namespace out the languages as decided
  • try if that works in the jasmine test (should completely work)
  • work on rewriting basic parsing algorithm