Closed Bug 973927 Opened 10 years ago Closed 10 years ago

Build node app to support localized teaching kits

Categories

(Webmaker Graveyard :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: humph, Assigned: alicoding)

References

Details

(Whiteboard: [teachingkit])

During the Feb Work Week we discussed the need to create, maintain, and localize some high-quality teaching kits, see https://teach.etherpad.mozilla.org/kitlocalization for notes.

The goals we have include:

* stop using Thimble and "Remix" for our core teaching kits.
* use our existing node.js based i18n + Transifex workflow for server-side rendered, localized HTML content
* decouple the update cycle of the kits from webmaker.org
* make it possible to remix these kits within Thimble despite the fact that they won't be Thimble makes.

From a technical point of view, what we want here is a node app similar to webmaker.org, but somewhat simplified.  We need nunjucks-based templates, i18n, and some sort of way to deal with json-per-kit vs. per-app the way we do it now (i.e., each kit will have it's own set of json files).

Once we build this we can host it at kits.webmaker.org or something.
Depends on: 973732
Q from the peanut gallery -- would it not be possible to do client-side template substitution and henceforth not need a server process at all, have the entire teaching kit be static?  (e.g. use github pages for simpler contribution?).

What's the active process that needs a server?
We discussed that approach, too.  The issue is that they want to support the "Remix" case, such that the localized/rendered view you see can be opened in Thimble and a new one made.  If the page is actually just a bunch of JS to do client-side rendering and JSON fetching for strings, that isn't possible.  So the need to have this not-be-Thimble, but also seem to work just like something in Thimble complicates things.
So not just "remix", but "remix in thimble"?  Something like "sign in to thimble and load a blank window with the contents at URL x"?

In other words, isn't this just one of many "make a new version of this URL in thimble" which people could apply to any rendered page?
Pomax did a prototype of Thimble that allows for that, yes, but it is really fragile.

NOTE: we also want to leverage the shared localization approach we have across all our apps, for example, user pref'ed languages, the ability to have different languages turned on in staging vs. production for testing, ability to support both url-based and header selected locales, deal with mappings of langauges/locales for partially translated content...AND not re-invent it all.

We've solved these problems, and we're using it across Webmaker.  I want to leverage that and not start over.  No matter how you do the rendering, it's the exact same work for the people doing the Kits: nunjuck-based templates in github.
To have remixes work in Thimble you could add CORS headers to whatever this node app is hosting as content, then provide a URL to https://github.com/mozilla/thimble.webmaker.org/blob/master/views/friendlycode.html#L92 .
(In reply to David Humphrey (:humph) from comment #4)
> Pomax did a prototype of Thimble that allows for that, yes, but it is really
> fragile.


Sorry I'm missing history, but is there a place where I can find out about said fragility?
 
> NOTE: we also want to leverage the shared localization approach we have
> across all our apps, for example, user pref'ed languages, the ability to
> have different languages turned on in staging vs. production for testing,
> ability to support both url-based and header selected locales, deal with
> mappings of langauges/locales for partially translated content...AND not
> re-invent it all.

Sure, I wasn't trying to suggest otherwise.  Mostly I was curious the degree to which we can avoid having to do anything serverside, and instead provide JS libraries and REST endpoints, as I believe that is an environment more conducive to contribution from the edges, which feels important for teaching kits.  I'm likely missing some context.

> We've solved these problems, and we're using it across Webmaker.  I want to
> leverage that and not start over.  No matter how you do the rendering, it's
> the exact same work for the people doing the Kits: nunjuck-based templates
> in github.

Indeed. Note FWIW, the localization model for Appmaker is a tad different, I think.  Not in this bug, but we should figure out whether that lack of harmony is dissonant or melodious.
I'm thinking that it should be possible to do a vast majority (maybe even all) of it client side.

Sending the rendered DOM into thimble via post request could be a way to solve some of the remix issues.

However there are a number of advantages to having some of this done server side too... though overall performance etc... is something that I'd not be too confident weighing in on with my current level of knowledge.
Here is the sample node app that we built during the workweek: https://github.com/alicoding/node-webmaker-teaching-kit-demo

Our main reason for having this as server side app so that we can control on getting the template based on the locale. We can simply change it from URL and then when we want to publish to Thimble that template in that specific locale can be publish from a simple click. Whereas doing it client-side it's true there are lots of advantages on getting people to contribute and easy to update, but with localization it won't be easy if we are going to do it that way.

IMO if we can do it mostly server side it will be really easy for both creating the kit and localization workflow since we know it really well on that part and don't really have to spend more time on creating something new and to perfect it for the new way.

The only thing left in this process is to create some automation tool to convert most of the existing kits into l10n ready template and we can start.
In that case I'm going to mark the following blockers.
Depends on: 971800, 962509
Assignee: nobody → ali
Status: NEW → ASSIGNED
Whiteboard: [kit]
See Also: → 974924
Whiteboard: [kit] → [teachingkit]
Should we close this bug for now until the plan to migrate is ready?
I think so, doing.  Let's re-file when we get there.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.