Giter VIP home page Giter VIP logo

twinkle-enwiki's Introduction

twinke-enwiki

This is not the deployed version of Twinkle on English Wikipedia, for that see twinkle instead.

This is the enwiki localisation of Twinkle core.

Development

This project is written in TypeScript using ES modules format. Webpack is used as the module bundler.

Run npm start for development. This invokes webpack-dev-server, which refreshes the application in the browser on every code change. The bundled application can be accessed via http://localhost:5500/, which you can import into your on-wiki common.js page.

Add the following to your on-wiki common.js page:

mw.loader.load('http://localhost:5500/'); 

A sourcemap is generated to allow debugging of TypeScript code using the browser's dev tools, in which you can place debug breakpoints.

It is also possible to debug using breakpoints set in your IDE rather than the browser. For WebStorm, setup a debug configuration for external web server. If using Chrome, this causes a default profile of Chrome to open (without your bookmarks or other customisations). This can be fixed by following instructions here. Something similar can be done for VS Code as well.

Production build

Running grunt build generates the production build with minification. It takes care of escaping any nowiki tags and inserting gadget comments on top of the webpack output.

Webpack minification is done rather than leaving it to the MediaWiki ResourceLoader in order to take advantage of tree-shaking. Any functions that twinkle-core provides which aren't applicable to enwiki and hence unused, are removed from the output bundle. This enables twinkle-core to provide a number of central functions and classes without worry of bloating every wiki's Twinkle gadget with code they are not using.

twinkle-enwiki's People

Contributors

siddharthvp avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

twinkle-enwiki's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.