Commit Graph

73 Commits

Author SHA1 Message Date
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
ClarkXia 16b88d947c chore: bump dependencies version 2022-11-14 19:25:24 +08:00
ClarkXia d4cd31000e feat: manifest type 2022-11-14 19:23:02 +08:00
水澜 2eac971c1b feat: data loader shaking (#246)
* fix: lint

* feat: apply swc transform to esbuild

* chore: updata lock file

* refactor: rename params

* fix: types

* fix: add data loader to entry

* fix: add data loader after runtime

* feat: support config exports for ssr

* fix: conflict

* chore: remove debug info

* fix: transform page entry only

* fix: file extension

* fix: file extension

* revert: document

* fix: side effects

* feat: filter pages without getData

* feat: bundle optimization in dev mod

* refactor: side effects is not needed

* refactor: pass swc options to server compiler

* chore: comment

* refactor: runtime chunk is no more needed

* refactor: render data loader according to manifest

* test: data-loader

* chore: rename

* refactor: jsxTransform

* chore: update swc plugin version

* chore: update lock file

* fix: add jsx dev runtime

* chore: update swc plugin version

Co-authored-by: ZeroLing <zhuoling.lcl@alibaba-inc.com>
2022-11-14 19:22:57 +08:00
ZeroLing 723e0718e0 fix: test cases 2022-11-14 19:21:29 +08:00
ZeroLing 82d5ba6605 fix: remove swc helper 2022-11-14 19:21:15 +08:00
ZeroLing b727c4ded6 chore: move to @ice/runtime/jsx-runtime 2022-11-14 19:20:46 +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 91b87a15a4 fix: enable jsx syntax in .js file for default (#247) 2022-11-14 19:17:54 +08:00
ZeroLing cd96b3fcb9 chore: restore sample project 2022-11-14 19:17:54 +08:00
ZeroLing 2d15e80f47 refactor: support unit for project 2022-11-14 19:17:53 +08:00
ZeroLing a4fc59055f feat: add style compat 2022-11-14 19:17:53 +08:00
ZeroLing b4fa9e86e4 chore: optimize code style 2022-11-14 19:17:53 +08:00
ZeroLing 68fdcf8bc0 feat: impl onAppear and onDisappear 2022-11-14 19:17:53 +08:00
ZeroLing 8aa8764d06 feat: add dependency 2022-11-14 19:17:53 +08:00
ClarkXia 95cf70d639 chore: add plugin rax compat 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
ClarkXia 070e707944 feat: serve static assets (#164)
* feat: server static assets

* chore: update lock

* fix: dev server

* chore: remove log

* fix: middleware order

* chore: lock file

* chore: types

* chore: types
2022-11-14 19:17:25 +08:00
luhc228 6480a214b9 feat: add rpx2vw postcss plugin (#193) 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
水澜 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
ClarkXia 7305be723a feat: pre bundle for dependencies (#138)
* feat: rename folder

* feat: bundle scripts

* feat: ncc

* fix: pre bundle

* chore: optimize code

* chore: terser options

* fix: test case

* fix: package fail to pack

* feat: tsChecker and eslint

* chore: ts type

* fix: pack scripts

* fix: same webpack instance (#146)

* fix: same instance of webpack

* fix: same instance of webpack
2022-11-14 19:16:51 +08:00
shuilan.cj 740595cce0 feat: upgrade to react 18 2022-11-14 19:16:38 +08:00
luhc228 de39aedb16 feat: cli options (#120)
* feat: support analyzer

* feat: support https

* feat: support force remove cache

* chore: config order

* chore: remove todo

* chore: self-signed-cert

* chore: self-signed option
2022-11-14 19:16:17 +08:00
ClarkXia 8f4f79dae5 feat: minify and dropLogLevel (#119)
* feat: minify and dropLogLevel

* fix: test case
2022-11-14 19:16:17 +08:00
luhc228 7701b09595 Fix: react-jsx error (#113)
* fix: react-jsx error

* chore: remove blank line

* chore: polyfills

* chore: remove rootDir

* chore: remove hasJSXRuntime function

* fix: error

* fix: error
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 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
luhc228 3008689844 chore: defineUserConfig to defineConfig (#110) 2022-11-14 19:15:33 +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
luhc228 d11f461d6b refactor: global layout (#40) 2022-11-14 19:14:39 +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
ClarkXia 43a143de6d feat: support defineUserConfig (#53)
* feat: support config file

* feat: config file

* feat: add config watch

* fix: createServer path

* feat: add json support

* chore: space

* fix: add browserlist and webpack bundle analyze

* fix: update package name
2022-11-14 19:13:53 +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
luhc228 de7ec7dfd3 feat: rewrite matchRoutes function 2022-11-14 19:08:44 +08:00
shuilan.cj 4a56072283 fix: aplus blocks the puppeteer load page 2022-11-14 19:08:05 +08:00
shuilan.cj 498877ccdb refactor: root -> main 2022-11-14 19:06:40 +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 b99bf43e3a fix: ts error 2022-11-14 19:01:14 +08:00