Commit Graph

462 Commits

Author SHA1 Message Date
Damien Elmes
ddcb2adf71 add docstring to forEditorField 2021-03-29 18:13:45 +10:00
Damien Elmes
0e4bcbd69b
Merge pull request #1101 from Arthur-Milchior/TS_type
NF: add type ts
2021-03-29 18:09:56 +10:00
Damien Elmes
f1780e6e24 move loader arg into esbuild() invocation
upstream.bzl should be kept as close to upstream as possible, so that
it's easier to send changes upstream and pull in future changes
2021-03-29 17:59:06 +10:00
Arthur Milchior
a114f36b4c NF: add type ts 2021-03-28 23:59:16 +02:00
Henrik Giesel
922ee56ce8 Add copy_bootstrap_icons macro 2021-03-28 18:50:37 +02:00
Henrik Giesel
7dcb3ae678 Include pin-angle icon via inline SVG 2021-03-28 16:15:30 +02:00
Damien Elmes
dbfbcc36c6 define file extension in .d.ts so typescript doesn't complain 2021-03-28 16:15:28 +02:00
Henrik Giesel
3a44ffe2bb Unsuccessfully try to add text loader for .svg files 2021-03-28 16:14:52 +02:00
Henrik Giesel
bbea9ac9d7 Remove bootstrap-icons from css folder 2021-03-28 16:14:52 +02:00
Damien Elmes
0d49b3eabb move back to latest Jest
Patch is no longer required after previous change
2021-03-28 21:44:55 +10:00
Damien Elmes
493557aee7 fix Jest on Windows 2021-03-28 20:59:51 +10:00
Damien Elmes
f46f4cbf17 Revert "disable Jest tests on Windows for now"
This reverts commit 36022844bb.
2021-03-28 20:59:31 +10:00
Damien Elmes
36022844bb disable Jest tests on Windows for now 2021-03-28 20:34:10 +10:00
Damien Elmes
c891f45ed9 add Jest for TS unit tests
@hgiesel the reason no files were being found is because Jest ignores
symlinks by default. The Bazel example includes a patch we can use
to work around it, and Jest plan to add symlink support in a future
update.

https://github.com/bazelbuild/rules_nodejs/blob/stable/examples/jest/patches/jest-haste-map%2B24.9.0.patch

https://github.com/facebook/jest/pull/9351
2021-03-28 19:41:20 +10:00
Henrik Giesel
05ea624f85 Utilize ts/tsconfig.js from ts/{editor,html-filter} 2021-03-28 19:41:20 +10:00
Henrik Giesel
fb9461508e No need to explicitly import from index 2021-03-28 19:41:20 +10:00
Henrik Giesel
35beebcfa6 Satisfy formatter 2021-03-28 19:41:20 +10:00
Henrik Giesel
861c723ec0 Avoid using outerHTML + Fix regression 2021-03-28 19:41:20 +10:00
Henrik Giesel
f9259621a6 Change filter logic in html-filter/element: predicate true, means it stays in 2021-03-28 19:41:20 +10:00
Henrik Giesel
519aea2ea8 Move html-filter into its own directory 2021-03-28 19:41:20 +10:00
Henrik Giesel
730dfdd527 Insert break statements into switch 2021-03-28 19:41:20 +10:00
Henrik Giesel
39aa549ac9 Create htmlFilter{Node,Styling} for better separation of concerns 2021-03-28 19:41:20 +10:00
Henrik Giesel
d3d3720b39 Put filterElement logic completely into its own file 2021-03-28 19:41:20 +10:00
Henrik Giesel
1d4d7fabec Move most of tags allowed to its own file 2021-03-28 19:41:20 +10:00
Henrik Giesel
592d73c344 Refactor htmlFilter to use function declarations 2021-03-28 19:41:20 +10:00
Damien Elmes
76127126a6 use relative link to sass file
links relative to workspace root break when invoked from an external
repo
2021-03-28 12:37:21 +10:00
Damien Elmes
f3a3bb5467 add links to pending PRs 2021-03-28 12:32:40 +10:00
Damien Elmes
559d1a4793 fix(esbuild): files not being found when building external repo
An esbuild rule that ran fine in a local repo (eg bazel build //:my_esbuild_rule)
fails when built externally (eg bazel build @other_workspace//:my_esbuild_rule).
By prepending the workspace root to the bin path, the resulting base
URL works correctly in both local and remote repo invocations, allowing
esbuild output to be consumed by a different repo.

This change fixes remote repos in Bazel 4.0.0. 3.7.0 seems to require a
workspace_root.replace("external/", "") call first in order
to get the correct location. So while this patch should not break anything
that was not already broken, it only fixes/adds support for remote repos
in 4.0+.
2021-03-28 11:30:15 +10:00
Damien Elmes
08fd7a4747 add esbuild/helpers.bzl in from upstream 2021-03-28 11:12:23 +10:00
Damien Elmes
b23642d568 update $(location ...) in esbuild inject lines 2021-03-28 09:35:46 +10:00
Damien Elmes
944528d462 support expanding locations in esbuild arguments 2021-03-28 09:35:27 +10:00
Damien Elmes
fd324d4711 update TS deps 2021-03-27 15:02:02 +10:00
Damien Elmes
d2eb5c32f4 remove obsolete comment 2021-03-26 21:47:23 +10:00
Damien Elmes
b57e9be46f allow js to request specific i18n modules
Brings the payload on the congrats page with a non-English language
down from about 150k to 15k
2021-03-26 21:43:36 +10:00
Damien Elmes
8920a6f9ea fix handling of variables that don't match ts naming style 2021-03-26 21:34:24 +10:00
Damien Elmes
c039845c16 use singleton + free functions for i18n in ts
This allows for tree shaking, and reduces the congrats page from 150k
with the old enum solution to about 80k.
2021-03-26 20:38:44 +10:00
Damien Elmes
0de7ab87a5 drop legacy enum from ts/ 2021-03-26 19:26:35 +10:00
Damien Elmes
2e704660d6 update remaining TR references in ts/ 2021-03-26 19:24:48 +10:00
Damien Elmes
1ca25c563f update most no-arg TR references in *.svelte 2021-03-26 19:13:30 +10:00
Damien Elmes
cd4572c3dd update TR references with args in *.svelte 2021-03-26 19:13:30 +10:00
Damien Elmes
df93ed0b15 update TR references with args in *.ts; fix average answer time 2021-03-26 19:10:39 +10:00
Damien Elmes
b435658acb convert no-arg TR references to method invocations in *.ts 2021-03-26 19:10:27 +10:00
Damien Elmes
264b9204c0 generate ts methods for translations 2021-03-26 18:11:58 +10:00
Damien Elmes
9aece2a7b8 rework translation handling
Instead of generating a fluent.proto file with a giant enum, create
a .json file representing the translations that downstream consumers
can use for code generation.

This enables the generation of a separate method for each translation,
with a docstring that shows the actual text, and any required arguments
listed in the function signature.

The codebase is still using the old enum for now; updating it will need
to come in future commits, and the old enum will need to be kept
around, as add-ons are referencing it.

Other changes:

- move translation code into a separate crate
- store the translations on a per-file/module basis, which will allow
us to avoid sending 1000+ strings on each JS page load in the future
- drop the undocumented support for external .ftl files, that we weren't
using
- duplicate strings in translation files are now checked for at build
time
- fix i18n test failing when run outside Bazel
- drop slog dependency in i18n module
2021-03-26 09:41:32 +10:00
Henrik Giesel
7655f14859 Satisfy svelte_check 2021-03-22 15:41:43 +01:00
Henrik Giesel
a418d36c7f Add type signatures to asyncReactive 2021-03-22 15:30:35 +01:00
Henrik Giesel
6ec721d550 Satisfy formatter 2021-03-22 15:25:49 +01:00
Henrik Giesel
4cd60da7b8 Fix asyncReactive detection of loading
- Removed `success` store as it wouldn't work
- We should check for a value in error instead
2021-03-22 15:23:48 +01:00
Henrik Giesel
e23b1b77b7 Partially revert "Make sure RangeBox does not trigger update on stores on creation"
This reverts commit 15b19e44b9.
2021-03-22 15:11:36 +01:00
Henrik Giesel
9bbdc616c4 Remove assignment to preferencesPromise: getPreferences will only be called once 2021-03-22 04:03:52 +01:00