Commit Graph

60 Commits

Author SHA1 Message Date
David Taylor 61f0b26035
DEV: Remove vendored copy of messageformat (#21658) 2023-05-19 10:59:04 +01:00
David Taylor 25fabccd59
DEV: Enable parallel babel processing in ember-cli (#20215)
Ember CLI will automatically run babel transformations in parallel when the config is 'serializable', and can therefore be applied in multiple processes automatically. If any plugin is defined in an unserializable way, parallelisation will be disabled.

Our discourse-widget-hbs transformer was causing parallelisation to be disabled. This commit fixes that, and also enables the throwUnlessParallelizable flag so that we catch this kind of issue more easily in future.

This commit also refactors our deprecation silencing system into its own file, and uses a fake babel plugin to ensure deprecations are silenced in babel worker processes.

In our GitHub CI jobs, this doubles the speed of ember builds (1m30s -> 45s). It should also improve production deploy times, and cold-start dev builds.
2023-02-09 16:24:24 +00:00
Gerhard Schlager 4e42759caa
FIX: Use correct plural rules for Russian (#19467)
Previously this didn't work because Transifex didn't support "many".
2022-12-14 18:56:46 +01:00
Jarek Radosz 5f7163b5bb
DEV: Extensively use `startsWith()` (#17540) 2022-07-17 20:16:39 +02:00
Jarek Radosz c3fd91670e
DEV: Update linting setup and fix issues (#17345)
Re-lands #16119 and #17298

* Update eslint-config-discourse
* Update linting workflow
* Prettier-ignore stuff
* Update template-lint config
* Auto-fix template issues
* Fix various template issues
  Mostly incorrect attributes and unused templates
* Prettier js files
* Fix template auto-fix regressions
* Small css tweak

Co-authored-by: Peter Wagenet <peter.wagenet@gmail.com>
2022-07-06 10:37:54 +02:00
Discourse Translator Bot 7ac485fb9f
FEATURE: Add Croatian language (#17130)
Co-authored-by: Gerhard Schlager <gerhard.schlager@discourse.org>
2022-06-18 00:18:22 +02:00
Gerhard Schlager 1022d8872c
FIX: Add missing pluralization rules for Bosnian (#17131) 2022-06-18 00:17:15 +02:00
Jarek Radosz 99b2cfe26e
DEV: Disallow `Ember` global usage (#16147)
…and sprinkle `// eslint-disable-next-line no-undef` throughout the code where is unavoidable for now
2022-03-09 17:54:07 +01:00
Jarek Radosz 97ba3e1e5b
DEV: Drop unused pluralization ruleset (#15863)
The Polish locale we're using is `pl_PL` so this file is unused.
2022-02-09 16:53:48 +01:00
David Taylor 9811a1c5d9
DEV: Allow `transformed` values to be used in all widget hbs statements (#13331)
Previously, the `transformed.blah` shortcut could only be used in top-level hbs statements like {{transformed.blah}}. When attempting to use it in a sub-expression like `{{concat "hello" transformed.world}}`, it would raise a "transformed is not defined" error.

This commit updates the shortcut logic to make `transformed.blah` and `attrs.blah` work consistently in all hbs expressions.

Co-authored-by: Jordan Vidrine <jordan@jordanvidrine.com>
2021-06-08 16:46:07 +01:00
Josh Soref 59097b207f
DEV: Correct typos and spelling mistakes (#12812)
Over the years we accrued many spelling mistakes in the code base. 

This PR attempts to fix spelling mistakes and typos in all areas of the code that are extremely safe to change 

- comments
- test descriptions
- other low risk areas
2021-05-21 11:43:47 +10:00
Joffrey JAFFEUX 8957e4d9d0
A11Y: makes user notifications list more accessible (#11992)
Previous markup used to be

```
<div>
  <div>
    <li>
```

Instead we will now have:

```
<ul>
  <li>
    <div>
```

Note this commit also adds two things:
- ability to override tagName of a widget when attaching it
- ability to pass opts and otherOpts to {{attach}}, it could be useful in templates but is mostly useful to test `tagName` for now
2021-02-08 08:45:14 +01:00
Robin Ward 61f5d501cb
DEV: Migrate to Ember CLI (#11932)
This encompasses a lot of work done over the last year, much of which
has already been merged into master. This is the final set of changes
required to get Ember CLI running locally for development.

From here on it will be bug fixes / enhancements.

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
Co-authored-by: romanrizzi <rizziromanalejandro@gmail.com>

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
Co-authored-by: romanrizzi <rizziromanalejandro@gmail.com>
2021-02-03 14:22:20 -05:00
Robin Ward ce3fe2f4c4 REFACTOR: Support bundling our `admin` section as an ember addon 2020-09-22 15:14:29 -04:00
Robin Ward 7df57b35da REFACTOR: Remove `Discourse.__widget_helpers`
It's now a variable in the context where the templates are created.
2020-08-06 14:35:46 -04:00
David Taylor 8c03868808
DEV: Correctly render data- attributes in widget hbs templates (#10376)
In virtualdom, element 'properties' are not completely synonymous with element 'attributes'. In particular, `data-` properties will not be rendered as attributes. To ensure all attributes are passed through, we need to include them under an `attributes` key. For more info, see https://github.com/Matt-Esch/virtual-dom/blob/master/docs/vnode.md#custom-attributes-data-
2020-08-06 14:33:09 +01:00
Joffrey JAFFEUX 23d585f255
REFACTOR: removes unreachable statement (#9680) 2020-05-07 16:37:02 +02:00
Robin Ward b2b7afd310 Rename the server side widget hbs compiler 2020-03-27 12:06:14 -04:00
Robin Ward eaa324ecbd Revert "Move the widget-hbs compiler to js from es6"
This reverts commit 5d66a2c16e.
2020-03-25 16:13:26 -04:00
Robin Ward 5d66a2c16e Move the widget-hbs compiler to js from es6 2020-03-25 15:03:21 -04:00
Gerhard Schlager a5e80079d6 FEATURE: Add Belarusian language 2019-07-04 11:37:37 +02:00
Bianca Nenciu 4f97f85178 DEV: Fix lint. (#7824) 2019-06-28 20:24:09 +02:00
Robin Ward 3cb0d27d38 DEV: Upgrade our widget handlebars compiler
Now supports subexpressions such as i18n and concat, plus automatic
attaching of widgets similar to ember.
2019-05-02 15:47:57 -04:00
Robin Ward dd29af4475 REFACTOR: `{{avatar}}` and `{{date}}` helpers in vdom templates
This is a step towards a nicer flag display under posts.
2019-04-30 15:22:38 -04:00
Gerhard Schlager d43f4206c7 FEATURE: Add Armenian language 2019-03-28 14:24:14 +01:00
Penar Musaraj 5cef5b34ef DEV: Yarn-manage moment and moment-timezone libraries 2019-02-12 13:57:52 -05:00
Bianca Nenciu 5407036ef9 DEV: Run prettier. (#6420) 2018-09-21 11:02:23 +00:00
Joffrey JAFFEUX 0732c69f73
updates moment.js 2.22.1 and vendor moment-timezone 0.5.14 2018-04-26 09:15:53 +02:00
Mohammad AlTawil 234aa68bf8 Correct Arabic month names
Correct Arabic month names. It's not right to concatenate month names from two different calendars [Assyrian calendar](https://en.wikipedia.org/wiki/Assyrian_calendar) and [Gregorian calendar](https://en.wikipedia.org/wiki/Gregorian_calendar)
2018-01-14 20:01:45 +01:00
blokovi 364e6fdd53 FIX: pluralization rules for Serbian language (#5453)
Updated SR pluralization to use 3 keys: one, few, other (as by Transifex)
2017-12-22 12:20:19 +01:00
Robin Ward 0c84352386 Add support for transformations 2017-10-05 16:24:58 -04:00
Robin Ward 07d04aba1d Support `{{unless}}` in virtual dom templates 2017-10-05 14:35:07 -04:00
Robin Ward 051b49efdb FIX: Properly encode string literals in hbs compiler 2017-10-04 15:53:06 -04:00
Robin Ward 0caf6a0f7d Support for HTML values in widget hbs templates 2017-09-29 09:56:14 -04:00
Robin Ward df81d109e5 The ability to attach `attrs` when embedding widgets 2017-09-28 16:08:43 -04:00
Robin Ward e980322ed6 Allow hbs widgets to access their parent state 2017-09-28 15:19:44 -04:00
Robin Ward 8c2d6118ff Remove some of the last few `fa-icon` helpers 2017-09-14 11:20:36 -04:00
Robin Ward cb56dcdf2e FIX: Use proper `iconNode` when compiling virtual dom templates 2017-09-01 11:20:33 -04:00
Robin Ward dffb1fc4ee FEATURE: Use Glimmer compiler for widget templates
Widgets can now specify a template which is precompiled using Glimmer's
AST and then converted into our virtual dom code.

Example:

```javascript
createWidget('post-link-arrow', {
  template: hbs`
    {{#if attrs.above}}
      <a class="post-info arrow" title={{i18n "topic.jump_reply_up"}}>
        {{fa-icon "arrow-up"}}
      </a>
    {{else}}
      <a class="post-info arrow" title={{i18n "topic.jump_reply_down"}}>
        {{fa-icon "arrow-down"}}
      </a>
    {{/if}}
  `,

  click() {
    DiscourseURL.routeTo(this.attrs.shareUrl);
  }
});
```
2017-09-01 09:28:16 -04:00
Guo Xiang Tan 0f2e2ea175 Update moment locales as well. 2017-04-20 12:24:20 +08:00
Guo Xiang Tan 8052218f61 Upgrade momentjs. 2017-04-19 22:04:35 +08:00
Neil Lalonde 477b237e45 FIX: use 'other' instead of 'many' for Ukrainian pluralization until translations are fixed 2016-12-30 11:49:25 -05:00
Sawood Alam 3f765e0227
Added Urdu locale file for moment.js 2016-12-06 13:55:38 -05:00
Régis Hanol 4eeae880b6 fix deprecation comment in momentjs 2016-05-21 12:49:29 +02:00
Régis Hanol d43231da92 FIX: force date-picker to work with english locale 2016-05-18 20:58:33 +02:00
Robin Ward cc25716e47 FIX: Allow message format translations to be overridden 2016-04-08 14:49:50 -04:00
Neil Lalonde 44e41df76b FIX: add missing MessageFormat files for fa_IR, pl_PL and tr_TR 2016-03-30 14:02:42 -04:00
Gerhard Schlager 8ced8350ba Upgrade moment.js to version 2.11.2
In order to make future upgrades easier we don't rename the locale files anymore.
2016-02-05 21:42:48 +01:00
Anton Andriyevskyy c42a5551a1 Update RU pluralization to use 3 keys: one, few, other (as by Transifex) 2014-08-23 15:28:14 +03:00
Robin Ward 55c01d3320 Upgrade moment.js to latest version, add missing locales now that we
support more languages.
2014-08-20 14:41:50 -04:00