24
1
Fork 0

fluent_loader no longer needs polyfill with node 10

This commit is contained in:
Danny Coates 2018-08-03 10:48:00 -07:00
parent e97b8ff42d
commit a83e0cfbda
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
2 changed files with 3 additions and 7 deletions

View File

@ -30,7 +30,7 @@ A file sharing experiment which allows you to send encrypted files to other user
## Requirements
- [Node.js 8.2+](https://nodejs.org/)
- [Node.js 10.0+](https://nodejs.org/)
- [Redis server](https://redis.io/) (optional for development)
- [AWS S3](https://aws.amazon.com/s3/) or compatible service. (optional)

View File

@ -1,7 +1,4 @@
// TODO: when node supports 'for await' we can remove babel-polyfill
// and use 'fluent' instead of 'fluent/compat' (also below near line 42)
require('babel-polyfill');
const { MessageContext } = require('fluent/compat');
const { MessageContext } = require('fluent');
const fs = require('fs');
function toJSON(map) {
@ -39,8 +36,7 @@ module.exports = function(source) {
return `
module.exports = \`
if (typeof window === 'undefined') {
require('babel-polyfill');
var fluent = require('fluent/compat');
var fluent = require('fluent');
}
(function () {
var ctx = new fluent.MessageContext('${locale}', {useIsolating: false});