Commit graph

39 commits

Author SHA1 Message Date
Reece Dunham
05e7250c08
feat(v2): Webpack 5, PostCSS 8 (#4089)
* Initial webpack 5 work

* It works on my machine (lol)

* Committing a bit more work

* It works - sorta

* Update packages/docusaurus/package.json

* at least fix prettier /shrug

* making more progress. build should work now, css stuff is still a bit broken

* Terser things

Signed-off-by: Reece Dunham <me@rdil.rocks>

* Working on things

* Vendor webpack

* Repair chunks, and tests

* Rerun prettier

* Re-add client prefetching

* Update snapshots

* Update snapshots

* I hope this works

* Remove redundant dev server code

* relock

* Trying to reduce memory usage and fix things

* Dead code elim

* Search bar works!!!

* Prefetching should work again

* lock

* ts issue

* Repair snapshot

* Run prettier

* Fix the CI for now

* fix lint-prettier

* clean-css works, now for the other one

* Fix lockfile

* Fixes prettier

* Other css minification works!!!

* Add clean-css options, fix webpack versions

Signed-off-by: Reece Dunham <me@rdil.rocks>

* Fix tests and several of the webpack loaders

Signed-off-by: Reece Dunham <me@rdil.rocks>

* Re-add support for simple css minifier

* Update other related dependencies

* Fix lockfile

* Dev server fixups

Signed-off-by: Reece Dunham <me@rdil.rocks>

* Simplify css things

* Update webpack, try with postcss 7

* Other cssnano repairs

* fix lockfile

* Clean up the babel preset

* Fix lockfile

* Bump RL SSR version

* Fix the build errors

* Lockfile fix

* It works again

* webpack 5 should close compiler after run

* add proper webpack5 persistent caching config

* upgrade webpack deps again

* reduce build perf timeouts to avoid build time regressions

* test if incremental build can run on netlify

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* test

* test

* test

* test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* fix existsSync() calls

* replace @ts-nocheck by a temporary Webpack type

* replace @ts-nocheck by a temporary Webpack type

* replace @ts-nocheck by a temporary Webpack type

* migrate existing stats.warningsFilter to config.ignoreWarnings

* remove stats from postBuild lifecycle data doc, as it is likely unused (we'll add it back if someone ask for it)

* improve build.ts TS issues + move some sync code to async

* cleanup TS of start.ts

* fix TS error

* fix TS issues

* fix TS issues

* fix ts error

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* script cleanup

* script cleanup

* re-enable @typescript-eslint/ban-ts-comment

* Deprecate getCacheLoader / getBabelLoader but keep retrocompatibility

* useless TS

* fix and comment gca(chunkName) prefetching function

* remove deprecated mainTemplate.requireFn

* temporarily use react-loadable-ssr-addon-v5-slorber until PR merged: https://github.com/facebook/docusaurus/pull/4089

* comment unsafeCache option

* add explicit and more precise webpack targets

* splitChunks, use new type: "css/mini-extract" as it seems recommended for webpack 5

* webpack error handling:
- log error.details as documented
- keep using react-dev-utils/formatWebpackMessages for now

* fix webpack5 warnings for evalSourceMapMiddleware.js

* typo

* rename webpackHotDevClient

* make all modifications of react-dev-utils explicit with a comment

* revert LogPlugin adapter

* loader-utils update

* add useful share cache comment

* add useful comments regarding the null-loader used in SSR for css files

* upgrade webpack-merge in a retrocompatible way

* use MiniCssExtractPlugin.emit false as recommended

* use @docusaurus/responsive-loader

* revert MiniCssExtractPlugin esModule: false change

* add link to PR for custom CleanWebpackPlugin

* pwa: add fallback to env variable or webpack 5 fails to build

* upgrade to CssMinimizerPlugin 2.0

* only build en locale for windows tests

* line breaks between errors

* add useful comment

* Fix e2e tests with Yarn2 not finding new init template dependencies

* fix bad import

* disable browserslist target as webpack already tries to use browserlists if a config is found, and it is a problem for existing sites

* webpack5 TS fixes

* fix getMinimizer order (even if it does not work yet)

* update postcss to v8, fix cssnano minimizer errors

* add NavbarItem position to types (useful for QuestDB site upgrade to Webpack5)

* add webpack cache env variable to reduce risk of webpack 5 adoption

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-04-30 18:06:53 +02:00
Sébastien Lorber
cb403afa93
fix(v2): i18n perf issue: getTranslationFile() should not load content again (#4593)
* Fix getTranslationFiles() perf issue

* improve doc
2021-04-09 19:28:48 +02:00
Armano
5534affdb9
fix(v2): remove no longer used postcss-present-env from dependencies (#4506) 2021-03-29 18:04:13 +02:00
Sébastien Lorber
dd5e5098b8
docs(v2): Add missing i18n docs: API lifecycles + Crowdin migration guide (#4470)
* Add the missing i18n docs: Crowdin migration + i18n lifecycle APIs

* fix heading ids

* fix doc typo
2021-03-19 18:19:30 +01:00
Alexey Pyltsyn
291a72fbae
docs(v2): use explicit heading IDs (#4460) 2021-03-19 11:00:41 +01:00
Sébastien Lorber
60d189a91c
fix(v2): Export Joi from validation-utils package (#4459) 2021-03-18 19:27:51 +01:00
Alexey Pyltsyn
2fb642d9ee
feat(v2): allow extend PostCSS config (#4185)
* feat(v2): allow extend PostCSS config

* polish the configurePostCss system

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-02-09 20:02:54 +01:00
Reece Dunham
66cc7364cd
feat(v2): Allow plugins to consume webpack stats (#4021)
* refactor(v2): Allow plugins to consume webpack stats

Signed-off-by: Reece Dunham <me@rdil.rocks>

* Warn level only

* Fix issue

* Revert start.ts change
2021-01-11 15:34:42 +01:00
kenve
4f64da8eda
docs(v2): update the link of Joi (#3644) 2020-10-27 15:03:17 +03:00
Alexey Pyltsyn
bfefc46436
refactor(v2): various fixes (#3587)
* refactor(v2): various fixes

* Test
2020-10-16 10:54:23 +02:00
Sébastien Lorber
5b79f2ebc2
feat(v2): site client modules (#3545)
* site client modules

* Update website/docs/api/docusaurus.config.js.md

Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>

Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
2020-10-07 14:44:14 +03:00
Alexey Pyltsyn
9134b1396b
docs: various fixes and improvements (#3546) 2020-10-07 12:39:47 +02:00
Anshul Goyal
ef9314e5a4
feat(v2): update swizzle command to suggest component/theme (#3021)
* update swizzle command

* change messages

* fix formatting

* add docs

* fix component lisiting

* allow themes to provide a list for safe swizzle components

* support both commanjs and ES exports

* fix debug plugin doesn't swizzle

* add dos

* remove unsed file

* fix docs plugin not swizzle properly

* fix console.log

* use new validate

* fix linting

* use config options for plugin

* rerun test

* fix type

* add a comment

* Update packages/docusaurus/src/commands/swizzle.ts

* Update packages/docusaurus/src/commands/swizzle.ts

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2020-08-06 13:53:03 +02:00
Sébastien Lorber
d25d4b08f6
fix(v2): remove buggy routesLoaded + deprecate routesLoaded lifecycle (#3141)
* remove bad deletion of docs / if conflicting with a page

* deprecate routesLoaded
2020-07-28 14:28:14 +02:00
Sébastien Lorber
15e73daae7
feat(v2): global data + useGlobalData + docs versions dropdown (#2971)
* doc components initial simplification

* doc components initial simplification

* add docContext test

* Add poc of global data system + use it in the theme

* Revert "doc components initial simplification"

This reverts commit f657b4c4

* revert useless changes

* avoid loosing context on docs switch

* fix docs tests

* fix @generated/globalData ts declaration / es import

* typo

* revert bad commit

* refactor navbar in multiple parts + add navbar item types validation + try to fix remaining merge bugs

* add missing watch mode for plugin debug

* fix docs global data integration, move related hooks to docs plugin + convert to TS

* change versions link label

* fix activeClassName react warning

* improve docs global data system + contextual navbar dropdown

* fix bug preventing the deployment

* refactor the global data system to namespace automatically by plugin name + plugin id

* proper NavbarItem comp

* fix tests

* fix snapshot

* extract theme config schema in separate file + rename navbar links to navbar items

* minor typos

* polish docs components/api

* polish useDocs api surface

* fix the docs version suggestions comp + data

* refactors + add docsClientUtils unit tests

* Add documentation

* typo

* Add check for duplicate plugin ids detection

* multi-instance: createData plugin data should be namespaced by plugin instance id

* remove attempt for multi-instance support
2020-07-21 11:16:08 +02:00
Sébastien Lorber
8aa6ef47e4
feat(v2): configureWebpack merge strategy + use file-loader for common asset types (#2994)
* Add some default asset loaders
Add webpack merge strategy feature to enable plugins to prepend some webpack configuration (like the ideal image plugin that should override the default image loader)

* Add documentation for using assets from markdown

* add path prefix for webpack file loader

* renaming

* document Merge strategies

* rename mergeStrategies -> mergeStrategy
2020-07-01 19:06:02 +02:00
Sébastien Lorber
c2bb03ab00
fix(v2): refactor color mode system (#3012)
* refactor color mode system to enable all possibilities

* fix destructuring bug

* colorMode validation + deprecation + minor name changes + doc

* rename method noFlashColorMode

* fix doc wording

* docs wording

* docs wording

* re-enable theme config merging/normalization + colorMode fixes

* document theme normalization

* code review changes
2020-06-30 12:21:20 +02:00
Sam Zhou
ec3c281952
docs(v2): Document TypeScript support (#2997) 2020-06-26 12:09:21 +02:00
Anshul Goyal
81d855355e
feat(v2): option and config validation life cycle method for official plugins (#2943)
* add validation for blog plugin

* fix wrong default component

* fix test and add yup to package.json

* remove console.log

* add validation for classic theme and code block theme

* add yup to packages

* remove console.log

* fix build

* fix logo required

* replaced yup with joi

* fix test

* remove hapi from docusuars core

* replace joi with @hapi/joi

* fix eslint

* fix remark plugin type

* change remark plugin validation to match documentation

* move schema to it's own file

* allow unknown only on outer theme object

* fix type for schema type

* fix yarn.lock

* support both commonjs and ES modules

* add docs for new lifecycle method
2020-06-24 20:08:16 +02:00
Alexey Pyltsyn
fc161b8455
docs(v2): various improvements (#2768) 2020-05-18 11:37:53 +08:00
Alexey Pyltsyn
00a8e9e365
feat(v2): allow home page for docs (#2652)
* feat(v2): allow home page for docs

* Refactor

* Remove debugging info 🤦‍♂️

* Add sort routes for first test case

* Sort child routes for consistency
2020-05-17 17:48:02 +08:00
Reece Dunham
04a420d68f
refactor(v2): enhance CLI experience (#2556)
Signed-off-by: Reece Dunham <me@rdil.rocks>
2020-04-08 12:57:10 +08:00
Yangshun Tay
36ea74504e
docs(v2): use codeblock title syntax instead of comments (#2473) 2020-03-29 01:08:50 +08:00
Yangshun Tay
2b6e440970
chore(v2): v2.0.0 alpha.44 (#2379)
* chore: v2.0.0-alpha.44

* chore: v2.0.0-alpha.44

* update CHANGELOG
2020-03-08 23:43:40 +08:00
Yangshun Tay
4aee06e74f
docs(v2): fix getPathsToWatch() example syntax in lifecycle APIs (#2357)
* Update lifecycle-apis.md

Fix getPathsToWatch() example syntax issue

* fix syntax in other versions

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
2020-03-05 09:23:15 +08:00
Zhenchao Cai
b25eb5dd36
docs(v2): move the quotes to remark admonitions (#2313)
* docs(v2): move the quotes to remark admonitions

* Delete package-lock.json

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
2020-02-23 18:11:37 +08:00
Alexey Pyltsyn
f2137bb872 docs(v2): make correct path to webpack config module 2020-01-18 22:52:14 +03:00
Mattia Astorino
7087425485 docs(v2): update custom webpack configuration snippet (#2139)
* Update custom webpack configuration snippet

Fix #2097

* Update lifecycle-apis.md
2019-12-29 16:38:50 +08:00
Yangshun Tay
4927f764e5 misc(v2): nitpicky formatting 2019-12-04 00:55:52 -08:00
endiliey
0e23e4ce32 docs(v2): fix typo in lifecycle api docs 2019-11-30 15:46:46 +07:00
Endi
97491c5cfb
feat(v2): injectHtmlTags API to inject head and/or body html tags (#2057)
* wip: define html tag definition

* feat(v2): implement injectHtmlTags api

* remove useless file

* nits

* documentation

* allow string, use prebodyTags and postBodyTags

* typo

* refactor typing

* chore(v2): bump deps
2019-11-30 11:52:26 +07:00
Endi
91b261af7a docs(v2): more examples on lifecycle apis, cleanup (#2051)
* docs(v2): more examples on lifecycle apis, cleanup

* typo
2019-11-25 10:31:57 -08:00
yangshun
29ce98c63a docs(v2): misc updates 2019-11-17 05:44:21 -08:00
Jamie Davenport
ffa6b71b1d docs(v2): update configureWebpack utility functions (#1970) 2019-11-12 17:35:12 +07:00
Yangshun Tay
f635f9aba2
docs(v2): code block line highlighting (#1904)
* docs(v2): code block line highlighting

* misc: update CHANGELOG

* misc: respond to review

* docs: add line highlighting to the template
2019-10-29 14:59:24 +08:00
Endi
2bbfbf88d6
docs(v2): update plugins, presets and themes docs (#1889)
* docs(v2): update plugins, presets and themes docs

* ideal image plugin

* proof reading

* Merge master
2019-10-26 15:10:48 +07:00
Endi
b1f6951fbb
feat(v2): allow plugin to extendCli (#1843)
* feat(v2): allow plugin to extendCli

* rename to externalCommand
2019-10-16 13:16:26 +07:00
Wei Gao
4ce1b582cf docs(v2): document plugins and lifecycle APIs (#1724)
* wip docs(v2): lifecycle apis

* docs(v2): edit advanced plugins

* wip plugins & lifecycle api docs

* wip plugins doc

* Update advanced-plugins.md

* misc: update plugins docs

* misc: remove excessive line
2019-10-08 00:23:03 -07:00
Wei Gao
f4f458460c docs(v2) themes (#1645)
* More prep

* rename xxx-api to api-xxx

* move content around for plugins and themes

* wip docs: using themes

* docs(v2): tweak using plugins

* docs(v2): list official themes in docs

* docs(v2): advanced themes

* wip notes for lifecycle apis

* resolve PR review discussions

* lower case "theme"

* better intro for using themes

* add a simple README to @docusaurus/theme-classic

* remove list of components from theme classic README and replace with link to directory
2019-07-26 12:00:40 +07:00
Renamed from website/docs/plugins-api.md (Browse further)