Commit Graph

84 Commits

Author SHA1 Message Date
Sami Mazouz
229a7affa5
feat: Code Splitting (#3860)
* feat: configure webpack to allow splitting chunks
* feat: `JsDirectoryCompiler` and expose js assets URL
* chore: support es2020 dynamic importing
* feat: control which URL to fetch chunks from
* feat: allow showing async modals & split 'LogInModal'
* feat: split `SignUpModal`
* feat: allow rendering async pages & split `UserSecurityPage`
* fix: module might not be listed in chunk
* feat: lazy load user pages
* feat: track the chunk containing each module
* chore: lightly warn
* chore: split `Composer`
* feat: add common frontend (for split common chunks)
* fix: jsDoc typing imports should be ignored
* feat: split `PostStream` `ForgotPasswordModal` and `EditUserModal`
* fix: multiple inline async imports not picked up
* chore: new `common` frontend assets only needs a jsdir compiler
* feat: add revision hash to chunk import URL
* fix: nothing to split for `admin` frontend yet
* chore: cleanup registry API
* chore: throw an error in debug mode if attempting to import a non-loaded module
* feat: defer `extend` & `override` until after module registration
* fix: plugin not picking up on all module sources
* fix: must override default chunk loader function from webpack plugin
* feat: split tags `TagDiscussionModal` and `TagSelectionModal`
* fix: wrong export name
* feat: import chunked modules from external packages
* feat: extensions compatibility
* feat: Router frontend extender async component
* chore: clean JS output path (removes stale chunks)
* fix: common chunks also need flushing
* chore: flush backend stale chunks
* Apply fixes from StyleCI
* feat: loading alert when async page component is loading
* chore: `yarn format`
* chore: typings
* chore: remove exception
* Apply fixes from StyleCI
* chore(infra): bundlewatch
* chore(infra): bundlewatch split chunks
* feat: split text editor
* chore: tag typings
* chore: bundlewatch
* fix: windows paths
* fix: wrong planned ext import format
2023-08-02 17:57:57 +01:00
David Sevilla Martin
c80220ad9b
fix(regression): Webpack not working on Windows with new export registry 2023-07-27 11:22:14 +01:00
Sami Mazouz
016503d8c3
feat: export registry (#3842)
* feat: registry first iteration

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* feat: improve webpack auto export loader

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chore: remove `compat` API

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* chore: cleanup

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

---------

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-06-29 18:57:53 +01:00
Sami Mazouz
fad818d1e5
chore: add script placeholders to allow running scripts globally
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-06-07 11:19:59 +01:00
David Wheatley
12ef1bfdbb
perf: transpile js to es6 (#3699) 2023-06-07 11:09:34 +01:00
Sami Mazouz
e5abffc75b
chore: v1.8 preparations
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-20 16:08:42 +01:00
dependabot[bot]
13e655aca5
chore(deps): bump webpack from 5.75.0 to 5.76.0 (#3761)
Bumps [webpack](https://github.com/webpack/webpack) from 5.75.0 to 5.76.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.75.0...v5.76.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-19 07:45:00 +01:00
Sami Mazouz
b66fe5dd5f
chore(release): preparations
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-03-09 19:00:32 +01:00
Sami Mazouz
748cca6d12
chore: prepare @flarum/jest-config for release
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-02-12 17:45:00 +01:00
Sami Mazouz
7e6458a125
feat(jest): mithril component testing (#3679)
* feat(jest): create jest config package for unit testing
* chore: housekeeping
* fix: now we need to explicitly allow importing without extension
* fix: recover EditorDriverInterface import
* feat(jest): mithril component testing
* fix: use separate `tsconfig.test.json`

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-02-10 23:02:50 +01:00
Sami Mazouz
e7fc29a59f
feat(jest): create jest config package for unit testing (#3678)
* feat(jest): create jest config package for unit testing
* chore: housekeeping
* fix: now we need to explicitly allow importing without extension
* fix: recover EditorDriverInterface import
* Apply suggestions from code review
* chore: yarn

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-02-08 22:02:40 +01:00
David Wheatley
3bdb0af993
fix: intellisense imports defaulting to absolute path from src folder (#3549)
* docs: remove baseUrl recommendation

Fixes https://github.com/flarum/flarum-tsconfig/issues/4

* chore: implement change within framework monorepo
2022-08-05 20:23:45 +01:00
Sami Mazouz
27fb011bf5
chore: with yarn workspaces we only need a single yarn.lock (#3464)
* chore: yarn workspaces means we only need a single `yarn.lock`
* fix: add a `cache_dependency_path` workflow input
* fix: re-introduce `env.cache_dependency_path`
2022-06-19 19:01:21 +01:00
Alexander Skvortsov
a595665bfb
fix: Assorted Typing Fixes (#3348)
With all the commits below, we resolve all outstanding typing issues in the repo, and CI jobs run green.

* fix: Convert DashboardPage and DashboardWidget to TypeScript

* fix: fix type errors in package manager ext

* fix: Convert Post component to TypeScript

* fix: avatar typings should accept null user

* fix: convert Notification component to TypeScript

* fix: properly use `typeof` in ForumApplication

* feat: make Notification content attr generic

* chore: format Notification component

* fix: Convert DiscussionRenamedNotification to TypeScript

* fix(pusher) move shims to a location where they get applied

* fix(pusher): fix some typing errors

* fix(akismet): fix some typing issues

* chore: update core dist typings

* chore(pusher): format

* fix: anchorScroll should accept string selectors

* fix: more accurately represent ApiQueryParamsPlural

* fix: convert PostStreamState to TypeScript

* chore(core): rebuild typings

* feat: allow extending app.routes

* fix: more flexible typings for highlight.ts

* fix: use primitive `number` type for Discussion typings

* fix: convert DiscussionListItem to TypeScript

* chore: rebuild core typings

* fix: final pusher type fixes

* feat: start tags TypeScript conversion

* fix: require-dev tags in pusher for CI TypeScript purposes.

* chore(core): format

* chore(tags): build dist typings

* feat(pusher): use dist types from tags.

* feat: convert flags to TypeScript

* chore(flags): generate dist typings

* fix(akismet): last type errors

* chore: update .yarn-integrity

* chore: partially run flarum-cli audit infra --fix

The tsconfig changes from that command are ignored, since we don't yet support "replacable sections" that would let us add custom config.

* chore: use type imports

* fix: broader gitattributes

* chore: run flarum-cli audit infra --monorepo --fix

* feat: make `app.data` typings extensible

* chore(core): format

* chore: boost tags TypeScript coverage

* fix(tags): further increase type coverage.
2022-03-23 11:43:14 -04:00
Alexander Skvortsov
cf7a7fcbe0 Merge remote-tracking branch 'js_packages_tsconfig/REWRITE' 2022-03-11 18:01:05 -05:00
Alexander Skvortsov
309485e4b7 Merge remote-tracking branch 'js_packages_webpack-config/REWRITE' 2022-03-11 18:01:04 -05:00
David Wheatley
08c2e9f198 feat: add support for Plug'n'Play package managers (#14)
* chore: use yarn berry with pnp

* feat: add plug'n'play support

* chore: add yarn gitattributes

* typo: fix comment
2021-11-08 23:53:18 +00:00
Alexander Skvortsov
077bddd8dd Release v2.0.0 2021-10-31 14:04:45 -04:00
Alexander Skvortsov
4822eeaab9 Release v2.0.0-beta.2 2021-10-27 17:11:17 -04:00
Alexander Skvortsov
7de88fb499 Update externals function syntax 2021-10-27 17:10:47 -04:00
Alexander Skvortsov
60e8dfb236 Release v2.0.0-beta.1 2021-10-27 17:06:53 -04:00
Alexander Skvortsov
f2b7b3b873 Bump webpack dependency to v5 2021-10-27 17:06:22 -04:00
David Wheatley
628019eddc v1.0.2 2021-09-10 19:16:19 +01:00
David Wheatley
ad02f0845d Add support for Array.flat() as per core polyfill 2021-09-10 19:08:58 +01:00
David Wheatley
5939928f12 Bump to 1.0.1 2021-08-15 21:27:33 +02:00
David Wheatley
a8e49b28d8 Add missing throttle-debounce types dependency 2021-08-15 21:22:45 +02:00
David Wheatley
81eb4804e5 Add configuration for global typings (#2)
Support for https://github.com/flarum/core/pull/2992
2021-08-15 20:01:53 +01:00
David Wheatley
6040aa0da9 Add support for .finally in promises (#3)
See: https://stackoverflow.com/a/54746036/11091039

We use `Promise.finally` in core, but the `tsconfig.json` doesn't list it as supported.
2021-07-30 20:26:13 +01:00
David
8fdfc2e4b6 Bump version to 1.0.0 2021-07-18 22:31:59 +01:00
David Wheatley
d2bc73b766 Update README.md 2021-07-18 22:25:28 +01:00
David
ecf016c348 Set package publishConfig 2021-07-18 21:40:30 +01:00
David
2f8cff03e7 Make version beta 2021-07-18 21:37:39 +01:00
David
53172af77d Add note about installing as dev dep 2021-07-18 21:32:48 +01:00
David
f6b4f2fbfb Add documentation 2021-07-18 21:31:11 +01:00
David
848dbc9ae8 Initial commit 2021-07-18 21:26:28 +01:00
David Wheatley
91d4c63090 Various grammatical changes 2021-07-09 08:56:10 +01:00
David Wheatley
f4807ada6a q 2021-07-09 08:55:14 +01:00
David Wheatley
818ae1c8b2 v1.0.0 2021-05-29 14:09:12 +01:00
David Wheatley
f1635cde13 Add support for Flarum typings in tsconfig 2021-05-27 22:37:32 +01:00
David Wheatley
e1e265fa29 Bump version to 1.0.0 2021-05-27 10:43:21 +01:00
David Wheatley
a8e6dd8fff Update dependencies to new versions 2021-05-27 10:41:21 +01:00
David Wheatley
df4b5969e3 Add missing typing packages as dependencies
These are required for core's global packages shim to work.
2021-05-20 22:51:33 +01:00
David Wheatley
819e2e1d33 Change first line to be a heading 2021-05-20 22:09:15 +01:00
David Wheatley
4c9d8389a6 Update copyright year 2021-05-15 00:54:10 +01:00
David Wheatley
47f28b5681 Add MIT license
Matches other Flarum repos
2021-05-15 00:53:49 +01:00
Alexander Skvortsov
3022586237 Bump version to 0.1.0-beta.16.2 2021-05-12 19:06:11 -04:00
David Wheatley
abea6716eb Add Webpack Bundle Analyzer to webpack config (#12) 2021-05-12 19:05:27 -04:00
David Wheatley
30a95910bb Remove unused dependency 2021-05-12 22:00:34 +01:00
Alexander Skvortsov
39aeba8200 Publish v0.1.0-beta.16.1 2021-05-11 20:35:56 -04:00
David Wheatley
4bdb02a878 Move Typescript configuration to webpack config from core (#11) 2021-05-11 20:28:31 -04:00