Commit Graph

381 Commits

Author SHA1 Message Date
逆葵 06061f26fd refactor(miniapp): update miniapp page lifecycles hooks 2022-11-29 17:05:53 +08:00
ClarkXia 60cad35493
chore: version (#5634) 2022-11-29 11:46:34 +08:00
水澜 b058de7c03
fix: merge context for component(#5630) 2022-11-29 10:28:41 +08:00
ZeroLing 31eb662648
chore: update repo and changelog (#5618)
* chore: add changelog and docs update

* docs: update docs repo

* Update CHANGELOG.md
2022-11-24 19:11:13 +08:00
水澜 71bce7719c
fix: app data loader (#5569)
* fix: call data loader by data-loader.js in csr

* chore: add comment
2022-11-17 11:45:45 +08:00
luhc228 c7ff8e3fff
fix: render empty html content in prod (#5560)
* fix: render empty html content in prod

* feat: basename example

* fix: ci
2022-11-16 18:00:48 +08:00
水澜 6ce0835d9b refactor: app data loader (#689)
* refactor: getAppData to dataLoader

* refactor: merge data loader logic in one file

* fix: comments
2022-11-15 16:31:09 +08:00
ClarkXia e21fb48509 fix: release 3.0 2022-11-15 10:37:30 +08:00
染陌同学 36475937e8 Feat/define data loader (#643)
* feat: modify dataLoader

* feat: add type

* feat: add DataLoaderConfig

* feat: modify getData to defineDataLoader

* chore: remove defineDataLoader

* fix: fetcher shoule return promise

* fix: loader may be undefined

* fix: err loader config

* chore: modify example of pha

* feat: modify getData

* chore: modify type and mofiy options of init

* feat: modify fetcher to dataLoaderFetcher and add dataLoaderImport to entry

* chore: modify defaultDataLoaderFetcher

* chore: load data by route id

* feat: modify serverDataLoader and staticDataLoader

* feat: add fetcher when route change

* fix: deal with window undefined

* chore: modify type

* feat: try get data from cache

* feat: support useData

* feat: add defineStaticDataLoader and defineServerDataLoader

* chore: modify getData of example

* fix: should load data

* fix: fix ssg err

* fix: fix dataloader for ssg

* test: modify env of test

* fix: shoule clear cache when route changed

* fix: fix renderMode and add defult remder mode

* fix: add window

* test: add jsdom

* test: modify getData to dataLoader

* test: modify test of clientApp

* test: clear window after each test

* test: remove only

* test: remove only

* chore: modify appear

* fix: Try get data from cache when CSR

* chore: update lock

* chore: remove unused

* refactor: data loader (#685)

* refactor: set global fetcher

* refactor: set global fetcher

* fix: should not build react in data loader

* fix: test

* test: modify test

Co-authored-by: 水澜 <shuilan.cj@taobao.com>
Co-authored-by: ZeroLing <i@zeroling.com>
2022-11-15 10:33:11 +08:00
ClarkXia f9a3829e63 fix: rename getConfig as pageConfig (#684)
* fix: rename getConfig as pageConfig

* chore: optimize code

* fix: type

* fix: optimzie code
2022-11-15 10:33:11 +08:00
水澜 cf58abb821 feat: use app context separately (#681)
* feat: use app context separately

* refactor: reuse data
2022-11-15 10:33:11 +08:00
水澜 3a672c387e fix: request in data loader (#662)
* fix: support request in data loader

* fix: type

* fix: type

* fix: ts error

* fix: type

* feat: support config exports in plugin

* fix: filter static modules

* refactor: rename
2022-11-15 10:33:11 +08:00
ClarkXia 9f57caffb4 fix: duplicate assets in document output (#646)
* fix: duplicate assets in document output

* fix: add test case

* chore: typo
2022-11-15 10:33:11 +08:00
luhc228 1b38b5eb43 refactor: app provider (#644)
* refactor: app Provider

* feat: add example

* fix: example warning

* fix: AppProvider to AppRuntimeProvider

* feat: miniapp AppRuntimeProvider

* fix: miniapp provider order

* chore: remove type
2022-11-15 10:33:11 +08:00
水澜 8beb2075c4 fix: load data without matched ids (#656) 2022-11-15 10:33:08 +08:00
ClarkXia 7b1cb86299 refactor: type dependencies (#638)
* refactor: types dependencies

* chore: types

* fix: tsconfig

* chore: optimize code

* fix: conflict
2022-11-15 10:33:00 +08:00
luhc228 9208dae707 refactor: import app store (#596)
* fix: throw error when no app store

* fix: ts type

* refactor: import app store

* refactor: change extraContext to runtimeOptions

* feat: call render in plugin

* refactor: optimize code

* chore: remove log
2022-11-15 10:32:49 +08:00
ClarkXia c926a0455e fix: regex rule for different package manager (#635)
* fix: regex rule for different package manager

* chore: remove log
2022-11-15 10:32:49 +08:00
水澜 f479384c6a fix: should disable hydrate when document only (#625)
* fix: should disable hydrate when document only

* fix: disable hydrate when document only
2022-11-15 10:32:49 +08:00
ClarkXia 3c5866e533 feat: support static runtime (#609)
* feat: support static runtime

* fix: optimize code

* fix: optimize code

* fix: update app data

* fix: optimize code and add test case
2022-11-15 10:32:49 +08:00
染陌同学 0b7f438c9f chore: modify name of loaders (#621) 2022-11-15 10:32:49 +08:00
染陌同学 232aace2d1 Feat/static prefetch (#611)
* feat: add matchedIds

* feat: add matchedIds

* feat: transfrom object of getData

* feat: add transformLoaders

* feat: add fetcher to ejs

* feat: add dataLoaderExport

* feat: modify export to import

* chore: modify comment

* feat: add default fetcher

* feat: modify transformLoaders
2022-11-15 10:32:49 +08:00
ClarkXia 5b61d8acbd feat: support route config type (#595)
* feat: support route config type

* fix: type

* fix: optimize code
2022-11-15 10:32:49 +08:00
luhc228 2e57000afc feat: keep-alive (#556)
* feat: init keep-alive plugin

* chore: update lock

* feat: add api

* chore: remove plugin

* chore: not modify code

* fix: lock

* feat: support keep-alive

* chore: lock

* chore: update component name

* chore: add ref

* chore: import name

* docs: keep-alive

* chore: line break

* chore: remove unstable prefix
2022-11-15 10:32:49 +08:00
ClarkXia 3be3f6ab5c refactor: miniapp runtime (#597) 2022-11-15 10:32:48 +08:00
luhc228 7fe93e3503 feat: ClientOnly component (#542)
* feat: BrowserOnly Component

* docs: BrowserOnly component docs

* docs: optimize

* feat: export useIsBrowser Hook

* feat: useIsBrowser example

* docs: useIsBrowser

* docs: typo

* chore: clientOnly

* feat: ClientOnly and useMounted

* feat: add ClientOnly test

* docs: update docs

* feat: use hooks instead of Context

* chore: import name
2022-11-15 10:32:48 +08:00
染陌同学 f8247d6472 feat: auto create root for pure js bundle (#592)
* feat: auto create root for pure js bundle

* chore: remove console and add warning

* chore: modify warning

* chore: add mock function for test
2022-11-15 10:32:48 +08:00
ClarkXia 4e954de8f3 fix: optimize html output (#569)
* fix: optimize html output

* fix: test case

* fix: optimize code
2022-11-15 10:32:43 +08:00
ClarkXia c41078d705 fix: remove useless config in document (#535)
* fix: remove useless config in document

* chore: optimize code

* fix: optimize code
2022-11-15 10:32:43 +08:00
水澜 114373633f feat: build routes config for document render (#552)
* feat: render document by routes config

* test: downgrade to csr

* chore: rename

* refactor: load route modules after only in ssr

* fix: pha test

* fix: compat with no routes config

* fix: ensure routes config before build

* fix: test case

* fix: test timeout

* fix: cache in test case

* refactor: check routes config before server compiler

* refactor: allways generate routes config

* chore: remove dead code

* fix: reset status when init config
2022-11-15 10:32:43 +08:00
NK 7af2915af6 fix(miniapp): lint warning (#562) 2022-11-15 10:32:43 +08:00
NK 3e031c477b feat: miniapp (#333)
* feat(miniapp): use platform in cli to generate miniapp code

* fix: lint error

* feat(miniapp): add miniapp project

* chore: revert example code

* chore: optimize code

* feat(miniapp): migrate some packages to ice

* feat(miniapp): update swcOptions for miniapp

* chore(example): add more pages

* feat(miniapp): add miniapp runClientApp

* feat(miniapp): update compile config for miniapp

* feat(miniapp): support get app and routes config in compile

* fix(miniapp): lint warning

* feat(miniapp): support routeData/routeConfig and reduce size

* fix: lint warning

* fix: lint warning

* feat(miniapp): support global css and page css

* feat(miniapp): support css modules

* feat(miniapp): support copying assets in public dir

* feat(miniapp): support Link and getSearchParams

* feat(miniapp): use index.ts.ejs as template

* feat(miniapp): support passing params in Link

* feat(miniapp): support history in miniapp

* fix(miniapp): build without compiling server bundle

* fix(miniapp): use getRoutesConfig

* feat(miniapp): support build options like outputDir

* chore(miniapp): update miniapp examples

* feat(miniapp): support html tags

* feat(miniapp): remove taro related code

* fix(miniapp): some cases

* fix(miniapp): use require.resolve to get page loader

* chore(miniapp): update lock

* fix(miniapp): page loader check this name

* chore(miniapp): add devDependencies

* chore: update index ejs template

* refactor(miniapp): update multiple platforms logic in ice

* chore: lock regenerator-runtime version

* chore(miniapp): add ali miniapp build command

* fix(ice): set default value of platform to web

* fix(runtime): remove duplicated denpdencies

* chore: set default value of platform to web

* feat(miniapp): registerSerialization when plugin activated

* test(miniapp): suit for vitest

* chore(miniapp): add webpack-sources to bundles

* chore: clean code

* chore(miniapp): remove jest config file

* fix: lint error

* fix: add default value of outputDir

* refactor(miniapp): remove openBrowser from logMessage

* chore(miniapp): remove unnecessary ts-ignore

* fix: type error

* chore(miniapp): rename Adapter to adapter

* chore(miniapp): update interface name

* refactor: use plugins to support miniapp

* chore(miniapp): update example name

* fix: update dependencies

* feat(miniapp): add platform check in cli

* chore: update lock

* fix: remove useless platform option

* fix: lint warning

* fix: lint warning

* test: use src code in tests

* chore(miniapp): remove ||= operators

* fix(miniapp): exclude miniapp-runtime esm code

* fix(ice-cli): update platform for build command
2022-11-15 10:32:43 +08:00
水澜 41302c1cb8 fix: disable hydrate when downgrade (#539)
* fix: disable hydrate when downgrade

* refactor: downgrade

* fix: remvoe dead code
2022-11-15 10:32:43 +08:00
ZeroLing 86b234162d feat: plugin jsx plus (#529)
* feat: create plugin jsx plus

* feat: add jsx plus plugin

* chore: dismiss all lint problems

* feat: add include and exclude

* docs: update docs of jsx plus

* fix: in case of auto lint fix

* fix: lint problem

* fix: compatible with node 14

* chore: update version

* chore: update pnpm lock

* fix: dev dep
2022-11-15 10:32:39 +08:00
ClarkXia 5439b89ef5 feat: add types for document component (#515) 2022-11-15 10:31:14 +08:00
luhc228 55311b43bd chore: remove consola from runtime (#498) 2022-11-15 10:30:56 +08:00
ClarkXia ad531405a8 test: improve test case (#497)
* test: improve test case

* test: compat win32

* test: test case

* test: add test case

* test: add test case

* test: test case for rax-compat

* test: test case for routes

* fix: types error

* fix: to strict equal

* chore: remove unused props

* fix: types

* test: test case for run client app

* chore: remove empty router

* test: test case of run server app

* chore: remove log

* chore: do not remove file by test case

* fix: remove document dependency when run client app

* chore: lint

* chore: remove config

* fix: lint

* chore: lint warning

* fix: test case

* chore: update unplugin
2022-11-15 10:30:52 +08:00
ZeroLing ec42015d34 Plugin/request (#439)
* feat: introduce useRequest

* chore: add some description

* fix: export statment for generator

* fix: make @ice/types dev dep

* fix: remove I prefix for interface

* fix: lint

* fix: update pnpm

* feat: add use case for app config

* fix: using export request config

* fix: review for code

* fix: dev dependency
2022-11-15 10:30:37 +08:00
逆葵 15e930045b chore: move @ice/types to devDependencies 2022-11-15 10:30:35 +08:00
逆葵 5283fcefd1 chore(types): update @ice/types version 2022-11-15 10:30:35 +08:00
逆葵 ce8f2bccde refactor(types): move runtime types to @ice/types 2022-11-15 10:30:32 +08:00
水澜 f384a2043d fix: remove component in csr (#486)
* fix: remove component in csr

* fix: keep export default for app

* fix: should load route modules first to get config
2022-11-15 10:27:46 +08:00
ZeroLing d30c5e0342 Feat/appconfig (#485)
* feat: appConfig or defineAppConfig

* test: add test for defineAppConfig
2022-11-15 10:27:46 +08:00
ClarkXia aa248063ef feat: support optimize router (#456)
* feat: support optimize router

* feat: export useNavigate

* chore: remove useless code
2022-11-15 10:27:18 +08:00
水澜 e51f296269 fix: assets order (#470)
* fix: assets order

* fix: delete anotation

* fix: page assets should load before entry assets
2022-11-15 10:27:18 +08:00
luhc228 d5d6a7ad0f feat: add Data component (#404)
* feat: add Data component

* feat: compat ssr fallback to csr

* feat: support disableFallback when renderServer

* chore: remove Data component
2022-11-15 10:27:18 +08:00
ClarkXia c66f3c2e0a feat: support import history from ice (#458)
* feat: support import history from ice

* fix: test case
2022-11-15 10:27:18 +08:00
luhc228 02eba057c3 refactor: optimize ssr error stack (#422)
* chore: add consola to runtime

* chore: format build failure

* fix: webpack error stack

* chore: remove formatBuildFailure

* chore: remove consola

* feat: optimize server compile log

* chore: remove try catch
2022-11-15 10:27:16 +08:00
luhc228 2ca66f5857 feat: store plugin (#431)
* feat: app store

* chore: store example

* chore: lock

* feat: init page store

* feat: update page store

* fix: disable reset page state

* feat: createModel

* test: with-store test

* fix: comment

* chore: lock
2022-11-15 10:23:01 +08:00
luhc228 26f8bf7b67 fix: fail to render document when csr (#428)
* fix: fail to render document when csr

* chore: merge release-next

* chore: line break
2022-11-15 10:22:42 +08:00
luhc228 be13ee9dd8 fix: hash router preview (#393)
* feat: init example

* fix: can not render component

* chore: lock

* feat: test case

* fix: comment

* fix: test error

* fix: test case

* fix: not use the correct location in hash router

* chore: remove appConfig param

* chore: remove AppConfig type
2022-11-15 10:20:02 +08:00
luhc228 a205555e61 chore: remove appConfig extends index type (#398) 2022-11-15 10:15:35 +08:00
ZeroLing 459882146a feat: runtime document (#377)
* docs: merge with release next

* feat: add props passing for Document elements
2022-11-15 10:15:15 +08:00
luhc228 cc091c8131 fix: render client app basename (#417) 2022-11-15 10:15:15 +08:00
luhc228 511bba514f fix: incorrect server render basename (#416) 2022-11-15 10:15:15 +08:00
ClarkXia 7185da210f fix: reorder js chunk (#412) 2022-11-15 10:15:15 +08:00
luhc228 2aa2f66b2b fix: ssr stream error recursion (#392)
* chore: remove abort()

* chore: support disableFallback
2022-11-15 10:15:12 +08:00
水澜 00f75371ed feat: getAppData (#375)
* feat: getAppData

* fix: remove dead code

* fix: should remove default export for app entry too

* docs: app data
2022-11-15 10:15:12 +08:00
luhc228 d19f65b803 feat: support memory router (#351)
* feat: support memory router

* feat: support enable read page path from appContext

* feat: support pass server build options (#367)

* feat: support pass server build options

* feat: add more config

* fix: merge buildConfig

* fix: merge buildOptions (#370)

* feat: support memoryRouter config

* chore: createRouterHistory

* feat: support builOptions function
2022-11-15 10:14:38 +08:00
luhc228 d375a59d3e chore: set app.strict default value to false (#319) 2022-11-15 10:13:06 +08:00
水澜 8f8042d0cf fix: basename in faas (#328)
* fix: basename in faas

* fix: if basename not exist

* fix: type

* fix: lint

* fix: duplicate basename

* feat: server only basename

* fix: lint

* fix: type

* fix: basename order

* fix: basename order
2022-11-14 19:54:19 +08:00
luhc228 4bf28c6bb5 feat: optimize server compile (#334)
* feat: support compile server bundle after the webpack compile end

* feat: support watch appConfig

* chore: update .ice to RUNTIME_TMP_DIR

* chore: optimize code

* chore: remove build condition

* chore: remove SERVER_OUTPUT

* chore: remove compileMiddleware

* chore: comment

* fix: outputDir

* fix: comment

* chore: add preBundle option

* feat: pass serverCompileTask to plugin

* fix: get serverCompileTask from extendsPluginAPI
2022-11-14 19:53:48 +08:00
水澜 0152f33742 feat: get server data (#288)
* fix: lint

* feat: getStatiData getServerData

* refactor: distinguish static env

* test: get static data

* fix: ssr runtime env

* fix: ssr runtime env

* fix: fliter ssr runtime env

* fix: routes data may be null

* fix: return empty object if getStaticData not exists

* fix: throw error when generate html

* fix: env order

* refactor: env name

* refactor: ssg option

* refactor: get hydrate info by userConfig

* fix: lint

* fix: lint

* fix: lint

* refactor: static generation to render mode

* refactor: reset ssr env in runtime

* refactor: isCSR to csr

* fix: type
2022-11-14 19:48:13 +08:00
ClarkXia e08e5df4db feat: optimize basename for ssg (#313)
* feat: optimize basename for ssg

* fix: route path

* fix: lint
2022-11-14 19:47:16 +08:00
luhc228 1667fbafe1 feat: support set basename in plugin (#300)
* feat: support set basename in plugin

* feat: write basename to ejs template
2022-11-14 19:47:11 +08:00
luhc228 c5eef24f52 fix: key unique warning (#296)
* fix: key unique warning

* chore: change file extname from tsx to ts
2022-11-14 19:44:04 +08:00
luhc228 50be6fa47b Feat: defineAppConfig (#265)
* feat: defineAppConfig

* feat: watch

* feat: add defineAuthConfig

* chore: remove NodeNext

* chore: ts-expect-error

* feat: add ./*

* chore: add ts-expect-error

* fix: types error

* chore: declare runtime module

* chore: types

* fix: types

* refactor: types path

* fix: export path
2022-11-14 19:41:27 +08:00
luhc228 5b651061ae feat: package watch (#267)
* feat: package watch

* feat: watch

* chore: remove package watch

* feat: watch and build

* fix: build

* chore: remove prebundle from build

* chore: rename
2022-11-14 19:23:02 +08:00
ZeroLing 43437856b7 fix: add jsx dev runtime (#263) 2022-11-14 19:22:08 +08:00
ZeroLing bf812fc6ea chore: version check 2022-11-14 19:21:33 +08:00
luhc228 aaa362f55a fix: doctype not existed when renderDocument (#256) 2022-11-14 19:21:15 +08:00
ZeroLing b0ba0b8548 chore: monorepo 2022-11-14 19:20:46 +08:00
ZeroLing b727c4ded6 chore: move to @ice/runtime/jsx-runtime 2022-11-14 19:20:46 +08:00
ClarkXia e79205ed0a fix: optimize code 2022-11-14 19:20:45 +08:00
luhc228 66ba831e0f feat: support FaaS (#174)
* feat: faas middleware

* refactor: ssr middleware

* feat: 404

* chore: middlewares order

* feat: 404

* refactor: optimize

* chore: middleware name

* chore: dependencies

* fix: 404 error

* feat: add midway support

* feat: update deps version

* chore: remove faas plugin and example

* chore: lock

* fix: cannot analyse default 404 page

* chore: remove comment

* fix: start error

* chore: remove ssr middleware

* chore: 404 componentName

* chore: remove Dashboard page

* fix: default route id

Co-authored-by: Lxxyx <Lxxyxzj@gmail.com>
2022-11-14 19:20:26 +08:00
luhc228 48e80d9796 feat: support bundle cjs deps (#250)
* feat: support bundle cjs deps

* refactor: remove esbuild plugin

* chore: delete cache

* chore: log

* chore: defineConfig

* fix: comment

* chore: type

* fix: ICE_CORE_SSG

* chore: remove unless set.add
2022-11-14 19:19:50 +08:00
ClarkXia 5dc86f6d44 fix: run server app 2022-11-14 19:19:01 +08:00
ClarkXia ecf09cf763 feat: appExport 2022-11-14 19:18:41 +08:00
ClarkXia 0c88d42025 chore: remove useAppData 2022-11-14 19:17:54 +08:00
ClarkXia 4f63ff7dd9 chore: remove getAppData 2022-11-14 19:17:54 +08:00
ZeroLing 68fdcf8bc0 feat: impl onAppear and onDisappear 2022-11-14 19:17:53 +08:00
luhc228 9276bd54ca feat: add useLocation api (#212)
* feat: add useLocation api

* feat: add useLocationSingle
2022-11-14 19:17:27 +08:00
luhc228 7457c5aa55 fix: css asserts order (#224) 2022-11-14 19:17:27 +08:00
ClarkXia b10b336514 Refactor service (#159)
* feat: refactor service

* fix: functional plugin

* fix: getCompilerPlugins

* feat: add log

* fix: refactor webpack compiler

* chore: update lock

* fix: remove useless code

* fix: config type

* chore: rename folder

* chore: optimize code

* fix: mock

* fix: ssr render

* fix: types

* chore: unused vars
2022-11-14 19:17:27 +08:00
luhc228 51d0ac263a feat: support set router basename (#195)
* feat: basename

* chore: remove routeMatch in server render middleware

* fix: use webpack-dev-server instead of express

* chore: remove resolutions

* chore: devDependencies order

* refactor: routeModules

* chore: lock

* fix: types

* chore: lock

* fix: comment

* fix: comment

* chore: remove webpack
2022-11-14 19:17:25 +08:00
ClarkXia d1d5912394 fix: hmr failed when reload (#202) 2022-11-14 19:17:25 +08:00
luhc228 7e92e55e15 fix: csr load component module (#188)
* fix: csr load component module

* chore: comment
2022-11-14 19:17:25 +08:00
luhc228 19b00c1276 feat: mock (#161)
* feat: support get mock data

* feat: middleware

* feat: support watch mock dir file change

* chore: lock

* fix: mock

* chore: lint

* feat: put mock middleware to first

* feat: support mock exclude

* fix: app.addProvider not be added (#190)

* feat: app.addProvider not be executed

* fix: still excute when error

* chore: skip test
2022-11-14 19:17:25 +08:00
luhc228 f510bf65cc fix: fs/promises module not found in node12 (#186)
* chore: fs/promises not works in node12

* chore: use fse instead fs

* fix: build error in pnpm v7
2022-11-14 19:17:22 +08:00
水澜 27599db870 refactor: getAppData (#183)
* feat: data loader

* refactor: put load logic to runtime

* feat: pass matched ids

* refactor: reuse initial context

* feat: generate loader template

* fix: name with slash

* fix: name with slash

* feat: throw error

* feat: preload app data

* refactor: initail context to request context

* chore: add comment

* chore: add comment

* fix: type

* fix: merge conflict

* refactor: get app data

* fix: conflict

* fix: csr app data

Co-authored-by: luhc228 <luhengchang228@126.com>
2022-11-14 19:17:10 +08:00
水澜 5af5199972 feat: preload data (#158)
* feat: data loader

* refactor: put load logic to runtime

* feat: pass matched ids

* refactor: reuse initial context

* feat: generate loader template

* fix: name with slash

* fix: name with slash

* feat: throw error

* feat: preload app data

* refactor: initail context to request context

* chore: add comment

* chore: add comment

* fix: type

* fix: merge conflict

* fix: types error

* fix: merge error

Co-authored-by: luhc228 <luhengchang228@126.com>
Co-authored-by: ClarkXia <xiawenwu41@gmail.com>
2022-11-14 19:17:10 +08:00
水澜 704247de1e fix: csr hydrate error (#176)
* fix: csr hydrate error

* chore: demo for csr

* refactor: update route config

* fix: lint

* chore: update lock yaml

* fix: type

* refactor: pass app to document by context

* fix: lint

* chore: comment

* fix: type

* fix: do not overwrite title if not config

* chore: rename

Co-authored-by: luhc228 <luhengchang228@126.com>
2022-11-14 19:17:10 +08:00
大果 69c7ecb251 feat: support tree-shaking react-router deps when only one route (#86)
* feat: support tree-shaking react-router deps when only one route

* chore: optimize history API

* fix: typo error

* chore: make esbuild compile @ice/runtime add inject env vars

* chore: make esbuild compile @ice/runtime add inject env vars

* chore: resolve conflict

* feat: mock react-router api when disable router

* feat: env

* fix: test

* feat: support dotenv

* chore: add stringify

* chore: lock build-scripts

* feat: add removeHistoryDeadCode userConfig

* fix: duplicate register of routes

* fix: default value of define

* chore: optimize code

* fix: typo

* chore: upgrade react

* fix: code

* chore: optimize matchRoutes

Co-authored-by: ClarkXia <xiawenwu41@gmail.com>
2022-11-14 19:17:06 +08:00
ClarkXia 1d89ae541d fix: server exports (#173)
* fix: server exports

* fix: types
2022-11-14 19:16:54 +08:00
ClarkXia 3590d723c7 chore: remove useless fallback which cause infinite reload (#166) 2022-11-14 19:16:51 +08:00
水澜 97f7388ccf feat: suspense ssr (#143)
* feat: suspense ssr

* feat: stream render

* feat: downgrade to document

* feat: support render document only

* fix: typo

* refactor: downgrade for page

* fix: typo

* refactor: piper

* refactor: navigator

* chore: comment

* fix: typo

* feat: add log

* refactor: piper to pipe

* refactor: rename

* feat: log for error

* refactor: pipe in else

* fix: lint

* refactor: rename to pipe

* feat: add downgrade info
2022-11-14 19:16:51 +08:00
水澜 e0297618b1 refactor: route wrapper (#135)
* refactor: wrapper

* feat: support wrapper layout

* chore: demo for auth

* fix: typo

* fix: typo

* fix: typo

* fix: typo

* fix: typo

* feat: generate layout info when build

* refactor: wrapper for layout

* test: update snapshot for layout

* fix: typo
2022-11-14 19:16:51 +08:00
shuilan.cj b12122a31a fix: typo 2022-11-14 19:16:50 +08:00
shuilan.cj c65b0f2321 refactor: add component with children 2022-11-14 19:16:46 +08:00
shuilan.cj 668cbc55c4 refactor: hydrate api 2022-11-14 19:16:44 +08:00
shuilan.cj 740595cce0 feat: upgrade to react 18 2022-11-14 19:16:38 +08:00
luhc228 a37b09a321 fix: fail to load latest module in ssr (#123)
* fix: fail to load latest module in server env

* chore: update desc
2022-11-14 19:16:17 +08:00
水澜 99e586bf7c Feat nested routing (#112)
* feat: nested routing

* fix: update page config after navigate

* fix: initial value

* refactor: fn name

* feat: avoid load data for old route

* refactor: decoupling the dependency to page

* refactor: types for getConfig

* refactor: use prmomise

* chore: rename

* test: filter matched route

* chore: optimize types

* feat: support useAppData

* chore: just play

* chore: remove log

* chore: resolve conflict

* refactor: pages to routes

* fix: page to route

* refactor: merge value

Co-authored-by: liuxiong.lx <liuxiong.lx@alibaba-inc.com>
2022-11-14 19:16:12 +08:00
ClarkXia b50d478103 feat: optimize output folder (#115)
* feat: optimize folder

* fix: assets transform

* fix: optimze code

* fix: optimize code
2022-11-14 19:15:57 +08:00
luhc228 54163342ef Feat: define routes and ignore route files (#69)
* feat: support define routes

* fix: test

* fix: test

* chore: undefined type

* fix: conflict

* chore: remove pages str from route id

* fix: watch route change

* fix: warn

* fix: test

* fix: test

* chore: example

* chore: add route-gen example

* feat: add integration test

* chore: test

* chore: update config file

* chore: remove pnpm cache

* chore: test

* chore: remove test:ci from ci workflow

* chore: update build-scripts version

* chore: build fixture

* chore: remove devServer test

* chore: buildFixture

* feat: add vitest

* chore: add ts-ignore

* chore: node ci version

* chore: comment bundle analyzer

* chore: add test timeout

* fix: lint

* chore: remove threads

* chore: set maxThreads and minThreads

* chore: add maxConcurrency

* chore: remove coverage

* chore: threads

* chore: set threads to false

* fix: conflict

* fix: comment
2022-11-14 19:15:57 +08:00
luhc228 e8407ed19a Feat: support css modules in ssr (#43)
* feat: support css module in ssr

* chore: lock

* chore: type

* fix: transform esbuild-style-plugin in jest env

* fix: test fail

* chore: transformIgnorePatterns

* chore: ci test step

* chore: -max-old-space-size

* chore: transformIgnorePatterns

* chore: transformIgnorePatterns

* chore: transformIgnorePatterns

* feat: esbuild-css-plugin

* refactor: esbuild plugins

* chore: esbuild plugin dir

* fix: build error

* fix: lint

* fix: conflict

* chore: add desc

* chore: add comment

* chore: set extract to false

* chore: add more desc
2022-11-14 19:15:46 +08:00
水澜 525142f9d4 refactor: hydrate document (#74)
* feat: update page config after link

* Rename Document.tsx to document.tsx

* chore: add comment

* test: routing

* fix: test utils of puppeteer page

* test: update pageconfig after route

* chore: add origin source

* fix: meta tag

* fix: add s

* feat: reuse the links already loaded

* refactor: hydrate document

* refactor: pass data by app context

* refactor: get assets in document

* refactor: pass app as children

* refactor: use app context

* revert: document

* refactor: pass document by app context

* Rename document.tsx to Document.tsx

* fix: hydrate error

* chore: add comment

* feat: toggle for ssr

* refactor: entry options

* refactor: merge simple functions

* feat: downgrade to csr

* refactor: ssr entry

* fix: file name

* fix: remove deadcode

* Rename generateHtml.ts to generateHTML.ts

* fix: remove deadcode

* fix: remove deadcode

* refactor: remove block scripts

* feat: pass ssr flag to csr

* fix: remove ssg flag

* fix: spelling

* refactor: pass ssr flag to hydrate

* chore: add todo for runtime

* fix: typo

* chore: add todo for load links

* chore: send html for send html

* refactor: remove config for custom rootId

* feat: load page assets

* feat: ssr config

* refactor: disable csr hydrate warning

* chore: add issue link

Co-authored-by: ClarkXia <xiawenwu41@gmail.com>
2022-11-14 19:15:29 +08:00
ClarkXia 748adfb2c4 refactor: create @ice/app for framework (#67)
* fix: package name

* refactor: main package for ice

* fix: test case

* test: test case

* test: run context without built-in plugin

* test: add console level

* test: test case

* fix: remove built-in plugin

* test: use json file

* Revert "test: use json file"

This reverts commit be309d7df5a00fcc14fdc54fe2a63c9bce54221c.

* fix: update build-scripts

* fix: optimize code

* fix: exports field

* chore: use consola instead of console

* fix: optimize code
2022-11-14 19:14:32 +08:00
大果 4552afaec8 chore: refactor router (#58)
* chore: refactor router

* chore: add example

* fix: load all modules in first request

* fix: route module load

* chore: remove unused param

* fix: rerender twice

* fix: loadRouteModules params

Co-authored-by: luhc228 <luhengchang228@gmail.com>
2022-11-14 19:14:14 +08:00
shuilan.cj 6b5d56bc15 fix: type 2022-11-14 19:13:50 +08:00
shuilan.cj 785db8e0d1 refactor: less optional chaining 2022-11-14 19:13:50 +08:00
shuilan.cj 0cd671d76f refactor: less optional chaining 2022-11-14 19:13:50 +08:00
shuilan.cj 99ae148bc4 fix: optional chaining 2022-11-14 19:13:50 +08:00
shuilan.cj dd72462092 fix: optional chaining 2022-11-14 19:13:50 +08:00
shuilan.cj 72d94642dd chore: rename context 2022-11-14 19:13:50 +08:00
shuilan.cj 5995a73ebf fix: type 2022-11-14 19:13:46 +08:00
shuilan.cj 7dc8e9b46e refactor: pass page data 2022-11-14 19:13:27 +08:00
ClarkXia 6f9e64bea5 fix: improve framework config (#36)
* feat: config

* fix: webpack config

* feat: user config

* fix: css minimizer option

* fix: css minimizer option

* fix: alias with root

* fix: default define

* chore: optimize code

* fix: optimize code

* chore: update comment

* chore: lint

* chore: remove useless code

* fix: assets mainfest

* fix: test case
2022-11-14 19:12:43 +08:00
ClarkXia 647996e63e feat: define runtime value (#30)
* feat: define runtime value

* chore: remove console

* test: fix test option

* fix: remove process fallback for client

* fix: optimize code

* feat: optimize code

* fix: optimize code

* fix: types

* chore: optimize code

* test: add test case

* fix: remove useless code

* chore: optimize code

* chore: optimize code
2022-11-14 19:12:27 +08:00
水澜 edc436a073 feat: Document (#34)
* feat: match route

* feat: generate route manifest

* feat: document component

* refactor: remove routes json

* feat: route data

* refactor: render async scripts

* feat: manifest

* fix: pass path info

* fix: block css

* fix: hijackwebpack

* feat: get assets from manifest

* fix: ts error

* feat: mege page assets and config

* fix: file suffix

* fix: file suffix

* fix: await generate html

* refactor: return the last page config

* fix: pageconfig may be null

* fix: page config type

* chore: log test result

* chore: log test result

* chore: log test result

* chore: log test result

* chore: enable after compile

* fix: await compile

* fix: await compile

* feat: assets manifest

* fix: lint

* fix: enable build test

* fix: enable build test

* fix: type

* chore: add comment

* fix: conflict

* fix: conflict

* refactor: use first compile tag

* refactor: root -> main

* refactor: server context to request context

* fix: defer attr

* refactor: load route data

* refactor: fn name

* refactor: rename to client entry

* refactor: rename route wapper to page wapper

* fix: aplus blocks the puppeteer load page

* fix: remove plugin not needed

* chore: add todo

* fix: update lock file

* feat: rewrite matchRoutes function

* fix: await async hooks (#41)

* chore: add todo

* refactor: route manifest

* chore: update lock file

* fix: get route str

* refactor: set default output

* refactor: set default output

* refactor: get extname

* refactor: rename plugin folder

* fix: file path

* fix: support tsx

Co-authored-by: ClarkXia <xiawenwu41@gmail.com>
Co-authored-by: luhc228 <luhengchang228@gmail.com>
2022-11-14 19:12:06 +08:00
shuilan.cj aa73e0cc50 revert: document options 2022-11-14 19:11:05 +08:00
shuilan.cj aed4a7b4e8 feat: pass server data to client 2022-11-14 19:10:47 +08:00
shuilan.cj 641321ef60 fix: get route str 2022-11-14 19:09:42 +08:00
shuilan.cj 51296eddf8 chore: add todo 2022-11-14 19:09:17 +08:00
luhc228 de7ec7dfd3 feat: rewrite matchRoutes function 2022-11-14 19:08:44 +08:00
shuilan.cj 6ad921f5fb refactor: rename route wapper to page wapper 2022-11-14 19:07:54 +08:00
shuilan.cj bcf39baac2 refactor: fn name 2022-11-14 19:07:48 +08:00
shuilan.cj 93de986b94 refactor: load route data 2022-11-14 19:07:32 +08:00
shuilan.cj 45bf5bc420 fix: defer attr 2022-11-14 19:07:14 +08:00
shuilan.cj db21ef183d refactor: server context to request context 2022-11-14 19:07:09 +08:00
shuilan.cj 498877ccdb refactor: root -> main 2022-11-14 19:06:40 +08:00
shuilan.cj 7987d15c61 feat: assets manifest 2022-11-14 19:05:44 +08:00
luhc228 e7735ec588 feat: await chunk import in CSR (#35)
* chore: remove this is undefined in esm warning

* chore: remove plugin-router

* feat: merge render

* feat: merge defaultAppConfig

* feat: support redirect without lazy

* fix: redirect error

* fix: ssr render error

* feat: add transition file

* refactor: route

* chore: update transition

* refactor: transition

* chore: ProvidePlugin

* chore: remove console

* chore: add router-dom server reference

* feat: add PageContext

* fix: comment

* chore: BrowserEntry

* chore: comment

* chore: update lock

* chore: error

* chore: loadRoutesModules

* feat: initialContext types
2022-11-14 19:05:10 +08:00
shuilan.cj 1d16997af8 fix: page config type 2022-11-14 19:03:39 +08:00
shuilan.cj fc21fd912f fix: pageconfig may be null 2022-11-14 19:01:47 +08:00
shuilan.cj 80f2912e04 refactor: return the last page config 2022-11-14 19:01:47 +08:00
shuilan.cj c39eb7bc9b fix: file suffix 2022-11-14 19:01:47 +08:00
shuilan.cj 0c7dff4751 fix: file suffix 2022-11-14 19:01:47 +08:00
shuilan.cj 6b7450eaa7 feat: mege page assets and config 2022-11-14 19:01:35 +08:00
shuilan.cj d43164123a feat: get assets from manifest 2022-11-14 19:01:14 +08:00
shuilan.cj eaeb94e782 fix: block css 2022-11-14 19:00:56 +08:00
shuilan.cj 7327af31ae refactor: render async scripts 2022-11-14 18:59:35 +08:00
shuilan.cj d4cbe9182b feat: route data 2022-11-14 18:59:05 +08:00
shuilan.cj 56a3e36bdf chore: remove log info 2022-11-14 18:55:37 +08:00
shuilan.cj 39a685761f fix: routes type name 2022-11-14 18:55:37 +08:00
shuilan.cj 1593b72fdd refactor: add app routes 2022-11-14 18:55:37 +08:00
shuilan.cj 90bc3d56c1 refactor: app router to app routes 2022-11-14 18:55:34 +08:00
shuilan.cj 441aab1f80 refactor: change to anonymous fn 2022-11-14 18:55:10 +08:00
shuilan.cj 118a142ee0 refactor: set router by runtime 2022-11-14 18:55:10 +08:00
shuilan.cj 490507b537 refactor: put universal logic to app 2022-11-14 18:55:06 +08:00
shuilan.cj dbace390b0 fix: error info 2022-11-14 18:54:37 +08:00
shuilan.cj a943078c07 fix: lint 2022-11-14 18:52:33 +08:00
shuilan.cj c8fdcedf96 refactor: fn name 2022-11-14 18:52:08 +08:00
shuilan.cj 5f7fff3b55 chore: remove dead code 2022-11-14 18:51:14 +08:00
shuilan.cj ee6cd1481e fix: lint 2022-11-14 18:50:38 +08:00
shuilan.cj 3689971527 fix: no-suspense 2022-11-14 18:50:38 +08:00
shuilan.cj 361888e8d6 chore: change params order 2022-11-14 18:50:14 +08:00
大果 2b11d0578e feat: router (#28)
* feat: generate route manifest

* chore: lock

* feat: support generate nested route manifest

* chore: type

* chore: rename test to tests

* chore: remove caseSensitive

* chore: support generate routes

* fix: lint

* fix: lint

* feat: add componentName

* feat: support generate route

* feat: not add Router when only has one page

* fix: merge confict

* refactor: service route generate

* chore: update route-manifest readme

* test: add more route test cases

* chore: remove comment

* test: add invalid routes test case

* chore: update invalid char judge logic

* fix: comment

* fix: lint error

* chore: lock

Co-authored-by: luhc228 <luhengchang228@gmail.com>
2022-11-14 18:49:43 +08:00
shuilan.cj 1c9f8c4207 feat: ssg 2022-11-14 18:05:22 +08:00
shuilan.cj 763452108a fix: lint 2022-11-14 18:03:49 +08:00
shuilan.cj e96d5f8f7d fix: lint 2022-11-14 18:00:23 +08:00
大果 400b31e4e6 feat: support useAppContext API (#26) 2022-11-14 17:54:57 +08:00
大果 a225545066 feat: rework entry (#23)
* feat: rework entry

* chore: setup lock

* fix: createRequire

* fix: IAuth -> AuthConfig
2022-11-14 17:53:49 +08:00
shuilan.cj af020d04b9 feat: ssr entry 2022-11-14 17:52:55 +08:00
liuxiong.lx 72a6f3bfb7 feat: rework entry 2022-11-14 17:52:01 +08:00
大果 6bbc638e45 feat: render router (#17)
* feat: renderRouter

* fix: lint

* fix: test case

* feat: remove renderComponent

* chore: add types

* fix: scripts

* chore: build order

* chore: remove workspace from version

* chore: upgrade lock

* chore: upgrade lock
2022-11-14 17:49:04 +08:00
大果 49ff12f30b feat: runtime structure & output dir (#16)
* chore: optimize runtime

* chore: fix lint

* fix: test case lib -> esm
2022-11-14 17:48:18 +08:00
luhc228 7c171732a3 feat: use esm standard (#14)
* feat: esm

* fix: require in esm

* fix: test fail
2022-11-14 17:47:51 +08:00
ClarkXia 5d43928afe chore: refactor package structrue (#10)
* chore: refactor package structrue

* chore: remove unexpected code

* fix: package info

* chore: fix readme

* chore: version
2022-11-14 17:45:35 +08:00
ClarkXia 282543d2df feat: basic runtime 2022-11-14 17:42:51 +08:00
ClarkXia 6131e93cb5 feat: basic runtime 2022-11-14 17:42:00 +08:00
ClarkXia ac910ed2dc refactor: remove 2.x code 2022-11-14 17:17:45 +08:00
luhc228 dd397109a9
feat: add compatible toString() function (#5399) 2022-07-11 17:51:42 +08:00
ClarkXia 4f833cfe86
chore: version and changelog (#5133)
* chore: changelog

* fix: dts generation

* chore: update lock

* chore: version
2022-01-17 13:57:08 +08:00
ClarkXia a111afa1eb
fix: use process.env.__IS_SERVER__ in SSR (#5119)
* chore: optimize code

* fix: version

* fix: env
2022-01-11 11:40:56 +08:00
ClarkXia 723a8b7b25
feat: SSR in mode vite ssr (#5045)
* feat: vite ssr

* chore: fix unexpected remove

* fix: ts type

* feat: ssr build in vite mode

* chore: optimize code

* fix: optimize code

* fix: ssr in dev

* chore: version and changelog

* feat: support redirect url

* fix: vite ssr

* chore: optimize code

* chore: optimize code

* chore: update lock file

* fix: noExternal with miniapp-history

* feat: support ssg

* feat: isServer

* chore: comment

* chore: rename plugin

* chore: comment

* fix: import env file

* chore: changelog

* chore: ts lint

* fix: env path
2022-01-11 10:36:40 +08:00
luhc228 1b5c693e7a chore: add sideEffects as false to @ice/runtime 2021-11-23 14:38:18 +08:00
luhc228 0c60375dbf chore: version and changelog 2021-11-19 14:41:44 +08:00
luhc228 6735a2bcbb fix: ssg render error 2021-11-19 11:35:21 +08:00
ClarkXia cd7d9bcafd fix: runtime compile 2021-09-17 11:58:32 +08:00
ClarkXia dbe6438e63
feat: lock axios version (#4640)
* feat: lock axios version

* chore: verison
2021-09-17 11:51:46 +08:00