Commit Graph

51 Commits

Author SHA1 Message Date
David Taylor 9248ad1905 DEV: Enable `Style/SingleLineMethods` and `Style/Semicolon` in Rubocop (#6717) 2018-12-04 11:48:13 +08:00
Kyle Zhao 8b2a379e4e
DEV: transpile certain ES6 files without producing a module (#6460)
`.js.no-module.es6` files will be transpiled without producing a module.

import/export statements are deliberately not supported, so one would still need to use 
`const module = require('moduleName').default.`
2018-10-09 09:18:23 +08: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 5012d46cbd Add rubocop to our build. (#5004) 2017-07-28 10:20:09 +09:00
Guo Xiang Tan ac9c8ccf3b Fix broken specs. 2017-07-20 13:17:45 +09:00
Guo Xiang Tan 0edb0018ff Dispose of heap when we reset the context. 2017-07-20 13:10:56 +09:00
Robin Ward 754c1e5438 Upgrade to Babel 6 2017-07-05 15:25:23 -04:00
Robin Ward 2f480e21a0 Stop using Babel source gem, which is no longer updated 2017-07-05 14:19:16 -04:00
Sam 6e5296a510 FEATURE: upgrade sprockets to latest stable
This unlocks Rails upgrades, so we can now upgrade to latest Rails
2017-04-17 10:12:05 -04:00
Sam 7e43e73df6 FIX: properly reset all contexts after forking
Fixes hang on backup
2016-11-02 13:34:20 +11:00
Robin Ward a546395397 REFACTOR: Migrate markdown functionality in ES6 2016-07-11 12:57:05 -04:00
Sam 695773db1c FEATURE: upgrade from therubyracer to mini_racer
This pushes our internal V8 JavaScript engine from Chrome 32 to 50.

It also resolves some long standing issues we had with the old wrapper.
2016-05-23 09:57:15 +10:00
Jeff Atwood ed446ca487 increase transpiler timeout to 15 sec 2016-04-21 16:52:25 -07:00
Jeff Atwood 8f59917f6b increase es6 transpiler timeout from 5 to 10 sec 2016-03-29 16:43:04 -07:00
Robin Ward b4f306ce03 FEATURE: Site Customizations can use the plugin api 2016-03-18 14:41:48 -04:00
Robin Ward d1e85bdd8b FEATURE: Use virtual dom framework for faster post rendering 2016-02-11 11:00:40 -05:00
Sam aa2f802247 PERF: DISCOURSE_NO_CONSTANTS removed
we minimize the amount of constants we decalre see: https://meta.discourse.org/t/deprecating-es6-compatibility-layer/35821
2015-12-01 10:58:01 +11:00
Sam 5c899c765b Revert "Revert "REFACTOR: support booting discourse with DISCOURSE_NO_CONSTANTS""
This reverts commit c21457d6a7.
2015-11-21 12:27:06 +11:00
Robin Ward c21457d6a7 Revert "REFACTOR: support booting discourse with DISCOURSE_NO_CONSTANTS"
This reverts commit c0b277d273.
2015-11-20 10:00:12 -05:00
Sam c0b277d273 REFACTOR: support booting discourse with DISCOURSE_NO_CONSTANTS
This change is discussed here: https://meta.discourse.org/t/deprecating-es6-compatibility-layer/35821

Prior to this change we were not booting correctly with DISCOURSE_NO_CONSTANTS
2015-11-21 00:14:50 +11:00
Sam 09bedfd4c0 Make DISCOURSE_NO_CONSTANTS work in anon for home page 2015-11-20 00:29:56 +11:00
Robin Ward a89241f0b9 Don't include code in files for jshint anymore, eslint is run on command
line
2015-08-13 15:19:27 -04:00
Robin Ward 22844b9e46 Ember 1.12 support 2015-08-13 11:14:16 -04:00
Robin Ward 3c742918fe FIX: Transpile unicode to fix opera issue 2015-07-30 15:16:07 -04:00
Robin Ward bb93a345eb UX: Use smaller messages for moderator actions. 2015-07-27 10:09:21 -04:00
Robin Ward 4706b77940 Backwards compatibility with deprecation for `Discourse.PostMenuView` 2015-07-07 15:18:19 -04:00
Robin Ward aee12fd6ef Ember Deprecations for Topics 2015-05-11 11:18:37 -04:00
Robin Ward 788b66e4a3 Update SourceURL to work better 2015-04-16 16:51:49 -04:00
Robin Ward c7d367996a PERF: Concatenate scripts in development mode
This improves my DOMContentLoaded from 9s+ to less than 4s.
Pinging @SamSaffron on this because this was previously controversial.

This implementation adds the `@sourceURL` directive so chrome correctly
identifies the source files.
2015-04-16 15:40:23 -04:00
Robin Ward a83a19f6ce ES6 module migrations 2015-04-15 14:54:36 -04:00
Robin Ward f50280a889 Split out bulk operations modal and `Discourse.Route.showModal`
This makes it easier to share bulk topic operations, for example
from a plugin's custom topic list.
2015-03-10 15:40:56 -04:00
Robin Ward 4691fe35b3 FIX: 6to5 was renamed to Babel
I can't believe they just pulled the old gem and broke people deploying
our site to production. I get it, your name changed, but don't break
other people's apps with no deprecations.
2015-03-05 13:08:32 -05:00
Robin Ward cf3582bedb FIX: JSHint wasn't validating ES6 files, this fixes a bunch of errors. 2015-02-10 17:21:16 -05:00
Robin Ward 9584990477 Whitelist specific ES6 features we want for now. 2015-02-06 13:44:17 -05:00
Robin Ward a65e0a80ba Add support for more ES6 features 2015-02-06 13:26:33 -05:00
Robin Ward 9a07945a16 FIX: Don't add constants for ES6 modules in plugins
If you're using ES6 in a plugin, you shouldn't be depending on the
backwards compatibility layer. That's for proper Discourse only.
2015-02-03 13:14:05 -05:00
Robin Ward 0fc0533134 FEATURE: Admin interface for adding custom fields for users 2014-09-25 16:17:51 -04:00
Robin Ward 0adfeb1cff ES6: Mega update of controllers 2014-08-13 10:22:47 -04:00
Robin Ward c709ea8f9e FIX: Don't generate compatibility layer for test files 2014-08-06 18:07:27 -04:00
Robin Ward 15a51c6316 ES6: Patch up a few issues with the admin controllers conversion 2014-07-25 14:17:58 -04:00
Robin Ward 4c51258526 PERF: Speed up JSHint tests by using local buffers instead of AJAX
requests.
2014-07-22 14:13:37 -04:00
Robin Ward fd3ceae1d6 ES6: Enable compatibility layer for routes 2014-07-22 12:09:29 -04:00
Robin Ward 44ee7587c0 FIX: Plugins should be required by the path we generate for them 2014-06-09 15:22:11 -04:00
Robin Ward 010da29957 FIX: Plugin transpilation should work in workspaces that aren't called
`discourse`
2014-05-20 16:54:59 -04:00
Robin Ward 5bbe938e82 FIX: Backwards compatibility layer was not handling constants that ended
with 's'
2014-05-20 11:13:43 -04:00
Robin Ward 275fa02082 Generate compatibility layer for Components too 2014-05-16 16:39:41 -04:00
Robin Ward ba8b45792c Plugins: Prefix `discourse/plugins/PLUGINNAME` for plugin export names. 2014-05-15 16:31:45 -04:00
Robin Ward ad90d9710d Add an ENV variable to enable the stricter, plugin-incompatible ES6
behaviour for development.
2014-05-13 12:49:02 -04:00
Robin Ward 092f7510b4 Plugin Backwards compatibility layer for ES6 2014-05-12 15:53:38 -04:00
Robin Ward 0e296e767a Remove unused stuff. 2014-05-08 11:35:34 -04:00