Commit Graph
62 Commits
Author SHA1 Message Date
Jarek RadoszandGitHub ba8babbe5b DEV: Drop lodash (#16110) 2022-03-06 18:15:25 +01:00
Jarek RadoszandGitHub 8013821e5b DEV: Correctly tag heredocs (#16061)
This allows text editors to use correct syntax coloring for the heredoc sections.

Heredoc tag names we use:

languages: SQL, JS, RUBY, LUA, HTML, CSS, SCSS, SH, HBS, XML, YAML/YML, MF, ICS
other: MD, TEXT/TXT, RAW, EMAIL
2022-02-28 20:50:55 +01:00
Jarek RadoszandGitHub 372bdd941b DEV: Fix the javascript:update rake task (#16057)
The source of the moment tz name package has changed in #15761
2022-02-26 02:06:12 +01:00
Rafael dos Santos SilvaandGitHub 1980e4a7dd FEATURE: Use native color-picker (#15748) 2022-02-01 11:18:13 -03:00
Peter ZhuandGitHub 077003d795 DEV: Fix methods removed in Ruby 3.2 (#15459)
* File.exists? is deprecated and removed in Ruby 3.2 in favor of
File.exist?
* Dir.exists? is deprecated and removed in Ruby 3.2 in favor of
Dir.exist?
2022-01-05 18:45:08 +01:00
Penar MusarajandGitHub c2efb02614 FEATURE: Automatic admin editor dark mode (#15419) 2021-12-29 11:02:37 -05:00
Martin BrennanandGitHub 2a56f15562 DEV: Drop jQuery file uploader and old upload components (#15376)
This commit removes jQuery file uploader from Discourse,
completing the transition to Uppy. The image-uploader
and UploadMixin components are also removed in this commit
as they have already been replaced and are the only things
using jQuery file upload.

            .-'~~~`-.
          .'         `.
          |  R  I  P  |
          |   jquery  |
          |    file   |
          |   upload  |
          |           |
        \\| 2013-2021 |//
        -----------------
2021-12-22 08:59:44 +10:00
Martin BrennanandGitHub 3fa7e3bffb DEV: Remove old backup uploader and resumable.js (#15365)
Now that 81ae5900d5 has been
committed there is nothing in the codebase that uses either
resumable.js or the old backup-uploader component.

R.I.P resumable.js
2021-12-21 15:02:10 +10:00
Penar MusarajandGitHub 60f356bff0 DEV: Remove jquery-tags-input dependency (#15344) 2021-12-17 14:53:52 -05:00
Penar MusarajandGitHub 230a44d067 DEV: Remove jQuery color dependency (#15340) 2021-12-17 14:26:16 -05:00
Penar MusarajandGitHub 9da4e3df33 DEV: Remove jQuery autoellipsis dependency (#15336) 2021-12-17 11:45:12 -05:00
Joffrey JAFFEUXandGitHub c3b8ef9160 DEV: uses forked Mousetrap to avoid leaking listeners (#14198) 2021-09-08 14:48:13 +02:00
Martin BrennanandGitHub 3869e753f7 DEV: Update pretender and fake-xml-http-request (#13937)
We are still on a version of pretender since 2017
https://github.com/pretenderjs/pretender/releases/tag/v1.6.1

Since then many changes have been made, including adding support
for xhr.upload. Upgrading will let us write proper acceptance
tests for uppy, which uses XmlHTTPRequest internally including
xhr.upload.

Updates pretender to 3.4.7 and fake-xml-http-request to 2.1.2.

Note: There have been no breaking changes in the releases that would
affect us, mainly dropping support for old node versions.
2021-08-05 08:23:01 +10:00
Martin BrennanandGitHub 6364643589 DEV: Add uppy.js to build and project (#13645)
This PR adds uppy to the project with a custom JS build and the shims needed to import it into our JS code. We need a custom build of Uppy because we do not use webpack for our JS modules/build. The only way to get what you want from Uppy is to use the webpack modules or to include the entire Uppy project including all plugins in a single JS file. This way we can just use the plugins we actually want. Future PRs will actually use Uppy!
2021-07-07 10:39:33 +10:00
Rafael dos Santos SilvaandGitHub 19fbeab42a FEATURE: Optimize images before upload (#13432)
Integrates [mozJPEG](https://github.com/mozilla/mozjpeg) and [Resize](https://github.com/PistonDevelopers/resize) using WebAssembly to optimize user uploads in the composer on the client-side.

NPM libraries are sourced from our [Squoosh fork](https://github.com/discourse/squoosh/tree/discourse), which was needed because we have an older asset pipeline.
2021-06-23 12:31:12 -03:00
Penar MusarajandGitHub c75592d34a DEV: Remove IntersectionObserver polyfill (#13445) 2021-06-22 09:30:44 -04:00
Blake EricksonandGitHub d7902aa160 Revert "DEV: Drop old IE11 intersection-observer references" (#13017)
This reverts commit 7360a0f70fae59bb065dffb9b1ad42d13ff38f46.

iOS still wants this sometimes. Probably best to revert for now and we can
always remove this again later.

See: https://meta.discourse.org/t/189799/11?u=blake
2021-05-10 17:47:09 -06:00
Blake EricksonandGitHub 100d2ecc6d DEV: Drop old IE11 intersection-observer references (#12942)
It's been awhile since we have supported IE11 so it should be safe to remove
IntersectionObserver now.

From a TODO task in this repo:
> drop when we eventually drop IE11

Announcement of when we removed IE11 support:

https://meta.discourse.org/t/137984/40?u=blake
2021-05-04 17:54:54 -06:00
Osama SayeghandGitHub 260ca2d7f9 FEATURE: Allow theme tests to be run in production (take 2) (#12845)
This commit allows site admins to run theme tests in production via a new `/theme-qunit` route. When you visit `/theme-qunit`, you'll see a list of the themes/components installed on your site that have tests, and from there you can select a theme or component that you run its tests.

We also have a new rake task `themes:install_and_test` that can be used to install a list of themes/components on a temporary database and run the tests of the themes/components that are installed. This rake task can be useful when upgrading/deploying a Discourse instance to make sure that the installed themes/components are compatible with the new Discourse version being deployed, and if the tests fail you can abort the build/deploy process so you don't end up with a broken site.
2021-04-28 23:12:08 +03:00
Osama SayeghandGitHub cf90810ef6 Revert "FEATURE: Allow theme tests to be run in production (#12815)" (#12840)
This reverts commit c8ddd47ca0.

https://meta.discourse.org/t/failed-to-bootstrap-due-to-out-of-memory-killer/188141/18?u=osama

Precompiling test_helper.js is so expensive that it can make bootstrap
fail on servers with limited resources (2GB RAM). We will find another
way that doesn't require much resources.
2021-04-26 23:05:58 +03:00
Osama SayeghandGitHub c8ddd47ca0 FEATURE: Allow theme tests to be run in production (#12815)
This commit allows site admins to run theme tests in production via a new `/theme-qunit` route. When you visit `/theme-qunit`, you'll see a list of the themes/components installed on your site that have tests, and from there you can select a theme or component that you run its tests.

We also have a new rake task `themes:install_and_test` that can be used to install a list of themes/components on a temporary database and run the tests of the themes/components that are installed. This rake task can be useful when upgrading/deploying a Discourse instance to make sure that the installed themes/components are compatible with the new Discourse version being deployed, and if the tests fail you can abort the build/deploy process so you don't end up with a broken site.
2021-04-26 12:56:45 +03:00
Penar MusarajandGitHub ad7da6bb4c DEV: Fix build due to highlight.js branch issue (#12441)
Highlight.js changed their default branch from master to main. This switches to the @highlightjs/cdn-assets package, thus sidestepping the problem. It's a slightly cleaner integration though (no need to build locally anymore).
2021-03-18 18:21:23 -04:00
Penar MusarajandGitHub edfe31777d DEV: Add experimental json_scheme site setting type (#12226) 2021-03-01 09:15:17 -05:00
Bianca NenciuandGitHub 6ca4919060 FEATURE: Use diffhtml to update composer preview (#11237)
Displaying videos, animated GIFs or any kind of rich content in preview
used to refresh on every keystroke, which could cause performance
problems.
2021-02-18 16:07:26 +02:00
Vinoth KannanandGitHub 30a0cf63e6 DEV: enable CORS to all CDN get requests from workbox. (#11896)
To prevent opaque cache files, now all the CDN files will be requested in 'cors' mode if the cdn_cors_enabled global setting is enabled. Before enabling the setting, should enable the cors in the CDN server by adding the response header `access-control-allow-origin: *` or `access-control-allow-origin: https://discourse.example.com.`

And other external file requests other than CDN will not be cached if the response type is opaque.
2021-02-02 11:38:29 +05:30
Penar MusarajandGitHub f5295fdb5b DEV: Use absolute path for popper.js sourcemap (#11762) 2021-01-20 08:59:34 -05:00
Penar MusarajandGitHub 22d2f7a295 DEV: Remove jquery.ba-resize (#11457) 2020-12-11 11:36:32 -05:00
Robin Ward d0a823aade REFACTOR: Remove .erb from emoji-picker
We can't use erb in ember-cli, and it seems the emoji groups rarely
change anyway. This commit migrates the ERB to pre-rendered javascript
that is updated via the `rake javascript:update_constants` task.
2020-11-25 11:23:02 -05:00
Robin Ward 909e8ac301 REFACTOR: The Favcount library needs global variables
This moves the library into our lib folder, and refactored it to more
modern Javascript. I've kept the MIT license at the top of the file.

Doing this allows us to import it as a library in Ember CLI and ditch
yet another global variable.
2020-11-17 15:04:17 -05:00
Vinoth KannanandGitHub 564ebe2507 Revert "DEV: enable cors to all cdn get requests from workbox. (#10684)" (#11076)
This reverts commit e57c352fbd.

We need to improve out strategy by adding a cache breaker with this change ... some assets on CDNs and clients may have incorrect CORS headers which can cause stuff to break.
2020-10-30 16:05:35 +11:00
Vinoth KannanandGitHub e57c352fbd DEV: enable cors to all cdn get requests from workbox. (#10685)
Now all external requests from the service worker will be in CORS mode without credentials.
2020-10-28 23:36:19 +05:30
Robin Ward 620b93d1f6 REFACTOR: Remove .erb file from javascript tests
We can't use erb in Ember CLI (since it does not have Ruby) so this has
been ported to use our `javascript:update_constants` rake test instead.

Note we don't have to run this every time a notification type as it's
only used by fixtures to fill in some specific types we test against.
2020-10-08 18:36:09 -04:00
jbrwandGitHub 0d225f713e DEV - write JS files to versioned subdirectories (#10707)
* DEV - write JS files to versioned subdirectories

* Cleaner JS in cacheBuster
2020-09-21 15:06:56 -04:00
jbrwandGitHub 46866aaca8 DEV - versions of JS files written to a JS file to be included by loa… (#10649)
* DEV - versions of JS files written to a JS file to be included by load-script and appended as params to URLs

* Formatting

* Incorporate feedback from PR

* Update filename of public-js-versions
2020-09-11 13:53:56 -04:00
Joffrey JAFFEUXandGitHub 50735f95d4 FIX: updates highlightjs to latest version to avoid a freeze (#10578)
Example repro of the freeze:

```
```css
[
```
2020-09-02 15:14:48 +02:00
Jarek Radosz 2c1cfd5ad3 DEV: Remove jquery.cookie
A follow up to 520e4983dc

cc: @eviltrout
2020-08-31 11:53:01 +02:00
Penar MusarajandGitHub a2187b9b60 DEV: Upgrade ACE Editor to 1.4.12, remove extra ACE files (#10431) 2020-08-13 21:53:27 -04:00
Jarek RadoszandGitHub 132a417479 FEATURE: Poll breakdown 2.0 (#10345)
The poll breakdown modal replaces the grouped pie charts feature.

Includes:

* MODAL: Untangle `onSelectPanel`
Previously modal-tab component would call on click the onSelectPanel callback with itself (modal-tab) as `this` which severely limited its usefulness. Now showModal binds the callback to its controller.

"The PR includes a fix/change to d-modal (b7f6ec6) that hasn't been extracted to a separate PR because it's not currently possible to test a change like this in abstract, i.e. with dynamically created controllers/components in tests. The percentage/count toggle test for the poll breakdown feature is essentially a test for that d-modal modification."
2020-08-06 17:57:06 +02:00
Robin Ward a097bf680e FIX: Our test build of highlight.js was broken
Some definitions rely on others, in particular the c/cpp/c-like ones,
and we were appending the bundle of all files in the folder.

Instead for testing I've limited us to just three definitions. This has
the benefit of being a lot smaller to download/parse in test mode too.
2020-07-20 15:34:24 -04:00
Robin Ward b6f83d17e7 FIX: Silence route-recognizer source map errors in development mode 2020-07-15 15:42:04 -04:00
Robin Ward d94c839fe0 FIX: Add popper sourcemap 2020-07-15 15:29:12 -04:00
Joffrey JAFFEUXandGitHub 9a19170047 DEV: ensures highlightjs is correctly tested (#9923) 2020-05-29 13:05:44 +02:00
Robin Ward 25a073da5e DEV: Replace version.js.erb with pre generated file 2020-05-11 15:43:09 -04:00
Robin WardandGitHub f0985ac896 DEV: Generate emoji/data on demand (#9744)
These emoji rarely change and can be re-generated when we make changes
to them.
2020-05-11 15:29:46 -04:00
Robin Ward c64e183fec DEV: User UPPER_CASE for constants 2020-05-08 15:50:55 -04:00
Robin Ward ec9d0faad5 DEV: Don't use js.erb for constants
Adds a new rake task to auto generate a constants.js file with the
constants present. This makes migrating to Ember CLI easier, but also
slightly speeds up asset compilation by having to do less work.

If the constants change you need to run:
`rake javascripts:update_constants`
2020-05-08 14:14:01 -04:00
Penar MusarajandGitHub 6bd86977e0 DEV: Update jquery.fileupload and dependencies (#9466) 2020-04-28 10:39:29 -04:00
Joffrey JAFFEUXandGitHub ad7dd348ab DEV: makes popper.js part of javascript rake task (#8847) 2020-02-04 15:34:46 +01:00
Rafael dos Santos SilvaandGitHub 858f04c574 FEATURE: Make Discourse work offline with WorkboxJS (#7870) 2019-07-15 13:05:55 -03:00
Joffrey JAFFEUXandGitHub 4806f19504 DEV: allows lodash to be updated with rake javascript:update (#7881) 2019-07-11 16:57:03 +02:00