Skip to content

Commit

Permalink
Merge branch 'release/next' into feat/compile-data-loader
Browse files Browse the repository at this point in the history
  • Loading branch information
ClarkXia authored Mar 6, 2024
2 parents 78a9d0e + 2125777 commit 1a65872
Show file tree
Hide file tree
Showing 27 changed files with 119 additions and 63 deletions.
7 changes: 0 additions & 7 deletions .changeset/lovely-pans-arrive.md

This file was deleted.

7 changes: 7 additions & 0 deletions .changeset/serious-birds-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@ice/webpack-config': patch
'@ice/rspack-config': patch
'@ice/shared-config': patch
---

fix: imporve dev sourcemap
5 changes: 0 additions & 5 deletions .changeset/yellow-donkeys-fetch.md

This file was deleted.

6 changes: 6 additions & 0 deletions packages/bundles/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.2.4

### Patch Changes

- 4bce5d79: fix: bump rspack version

## 0.2.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/bundles/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/bundles",
"version": "0.2.3",
"version": "0.2.4",
"license": "MIT",
"author": "ICE",
"description": "Basic dependencies for ice.",
Expand Down
4 changes: 3 additions & 1 deletion packages/bundles/scripts/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,9 @@ const tasks = [
const fileContent = fs.readFileSync(sourcePath, 'utf8');
fs.writeFileSync(targetPath,
replaceDeps(fileContent, webpackDevServerDeps.concat([...commonDeps, '@rspack/core', 'webpack-dev-server']))
.replace(/webpack-dev-server\/client\/clients/g, '@ice/bundles/compiled/webpack-dev-server/client/clients'),
.replace(/webpack-dev-server\//g, '@ice/bundles/compiled/webpack-dev-server/')
.replace(/@rspack\/core\//g, '@ice/bundles/compiled/@rspack/core/')
.replace(/@rspack\/dev-server\//g, '@ice/bundles/compiled/@rspack/dev-server/'),
);
} else {
fs.copyFileSync(sourcePath, targetPath);
Expand Down
13 changes: 13 additions & 0 deletions packages/ice/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 3.4.4

### Patch Changes

- 4bce5d79: fix: bump rspack version
- Updated dependencies [4bce5d79]
- Updated dependencies [547601f3]
- @ice/bundles@0.2.4
- @ice/rspack-config@1.1.4
- @ice/runtime@1.4.2
- @ice/shared-config@1.2.4
- @ice/webpack-config@1.1.11

## 3.4.3

### Patch Changes
Expand Down
12 changes: 6 additions & 6 deletions packages/ice/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/app",
"version": "3.4.3",
"version": "3.4.4",
"description": "provide scripts and configuration used by web framework ice",
"type": "module",
"main": "./esm/index.js",
Expand Down Expand Up @@ -47,12 +47,12 @@
"bugs": "https://github.com/alibaba/ice/issues",
"homepage": "https://v3.ice.work",
"dependencies": {
"@ice/bundles": "0.2.3",
"@ice/bundles": "0.2.4",
"@ice/route-manifest": "1.2.2",
"@ice/runtime": "^1.4.0",
"@ice/shared-config": "1.2.3",
"@ice/webpack-config": "1.1.10",
"@ice/rspack-config": "1.1.3",
"@ice/runtime": "^1.4.2",
"@ice/shared-config": "1.2.4",
"@ice/webpack-config": "1.1.11",
"@ice/rspack-config": "1.1.4",
"@swc/helpers": "0.5.1",
"@types/express": "^4.17.14",
"address": "^1.1.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
"webpack-dev-server": "4.15.0"
},
"peerDependencies": {
"@ice/app": "^3.4.3",
"@ice/runtime": "^1.4.0"
"@ice/app": "^3.4.4",
"@ice/runtime": "^1.4.2"
},
"publishConfig": {
"access": "public"
Expand Down
6 changes: 6 additions & 0 deletions packages/plugin-unocss/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @ice/plugin-unocss

## 1.1.0

### Minor Changes

- e0b2eae1: fix: use postcss plugin to transform unocss

## 1.0.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-unocss/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/plugin-unocss",
"version": "1.0.2",
"version": "1.1.0",
"description": "A plugin for enable unocss in your app based on `@ice/app`",
"license": "MIT",
"type": "module",
Expand Down
9 changes: 9 additions & 0 deletions packages/rspack-config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @ice/rspack-config

## 1.1.4

### Patch Changes

- 4bce5d79: fix: bump rspack version
- Updated dependencies [4bce5d79]
- @ice/bundles@0.2.4
- @ice/shared-config@1.2.4

## 1.1.3

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/rspack-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/rspack-config",
"version": "1.1.3",
"version": "1.1.4",
"repository": "alibaba/ice",
"bugs": "https://github.com/alibaba/ice/issues",
"homepage": "https://v3.ice.work",
Expand All @@ -15,8 +15,8 @@
"*.d.ts"
],
"dependencies": {
"@ice/bundles": "0.2.3",
"@ice/shared-config": "1.2.3"
"@ice/bundles": "0.2.4",
"@ice/shared-config": "1.2.4"
},
"devDependencies": {
"@rspack/core": "0.5.4"
Expand Down
6 changes: 3 additions & 3 deletions packages/rspack-config/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as path from 'path';
import { createRequire } from 'module';
import { getDefineVars, getCompilerPlugins, getJsxTransformOptions, getAliasWithRoot, skipCompilePackages } from '@ice/shared-config';
import { getDefineVars, getCompilerPlugins, getJsxTransformOptions, getAliasWithRoot, skipCompilePackages, getDevtoolValue } from '@ice/shared-config';
import type { Config, ModifyWebpackConfig, ImportDeclaration } from '@ice/shared-config/types';
import type { Configuration, rspack as Rspack } from '@rspack/core';
import lodash from '@ice/bundles/compiled/lodash/index.js';
Expand Down Expand Up @@ -107,6 +107,7 @@ const getConfig: GetConfig = async (options) => {
assetsManifest,
redirectImports,
fastRefresh,
sourceMap,
} = taskConfig || {};
const isDev = mode === 'development';
const absoluteOutputDir = path.isAbsolute(outputDir) ? outputDir : path.join(rootDir, outputDir);
Expand Down Expand Up @@ -213,8 +214,6 @@ const getConfig: GetConfig = async (options) => {
rules: [
{
test: /\.(jsx?|tsx?|mjs)$/,
// Set enforce: 'post' to make sure the compilation-loader is executed after other transformers.
enforce: 'post',
...(excludeRule ? { exclude: new RegExp(excludeRule) } : {}),
use: {
loader: 'builtin:compilation-loader',
Expand Down Expand Up @@ -290,6 +289,7 @@ const getConfig: GetConfig = async (options) => {
infrastructureLogging: {
level: 'warn',
},
devtool: getDevtoolValue(sourceMap),
devServer: {
allowedHosts: 'all',
headers: {
Expand Down
7 changes: 7 additions & 0 deletions packages/runtime/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @ice/runtime

## 1.4.2

### Patch Changes

- 547601f3: feat: new api of `useActive` for keep alive
- fix: single router dose not work when route path is customized

## 1.4.1

- fix: compatible with basename is undefined.
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/runtime",
"version": "1.4.1",
"version": "1.4.2",
"description": "Runtime module for ice.js",
"type": "module",
"types": "./esm/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/src/runClientApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ async function render({ history, runtime, needHydrate }: RenderOptions) {
},
};
const SingleComponent = process.env.ICE_CORE_ROUTER !== 'true' &&
await getSingleRoute(routes, basename, routeModuleCache);
await getSingleRoute(routes, basename, location, routeModuleCache);
const renderRoot = appRender(
root,
<AppContextProvider value={appContext}>
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/src/singleRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ export const useRevalidator = () => {
throw new Error('useRevalidator is not supported in single router mode');
};

export const getSingleRoute = async (routes: RouteItem[], basename: string, routeModuleCache = {}) => {
export const getSingleRoute = async (routes: RouteItem[], basename: string, location: Partial<Location> | string, routeModuleCache = {}) => {

Check warning on line 302 in packages/runtime/src/singleRouter.tsx

View workflow job for this annotation

GitHub Actions / build (16.x, ubuntu-latest)

This line has a length of 141. Maximum allowed is 120

Check warning on line 302 in packages/runtime/src/singleRouter.tsx

View workflow job for this annotation

GitHub Actions / build (16.x, windows-latest)

This line has a length of 141. Maximum allowed is 120

Check warning on line 302 in packages/runtime/src/singleRouter.tsx

View workflow job for this annotation

GitHub Actions / build (18.x, ubuntu-latest)

This line has a length of 141. Maximum allowed is 120

Check warning on line 302 in packages/runtime/src/singleRouter.tsx

View workflow job for this annotation

GitHub Actions / build (18.x, windows-latest)

This line has a length of 141. Maximum allowed is 120
const matchedRoutes = matchRoutes(routes, location, basename);
const routeModules = await loadRouteModules(matchedRoutes.map(({ route }) => route), routeModuleCache);
let loaders = [];
Expand Down
7 changes: 7 additions & 0 deletions packages/shared-config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @ice/shared-config

## 1.2.4

### Patch Changes

- Updated dependencies [4bce5d79]
- @ice/bundles@0.2.4

## 1.2.3

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/shared-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/shared-config",
"version": "1.2.3",
"version": "1.2.4",
"repository": "alibaba/ice",
"bugs": "https://github.com/alibaba/ice/issues",
"homepage": "https://v3.ice.work",
Expand All @@ -17,7 +17,7 @@
"*.d.ts"
],
"dependencies": {
"@ice/bundles": "0.2.3",
"@ice/bundles": "0.2.4",
"@rollup/pluginutils": "^4.2.0",
"browserslist": "^4.22.1",
"consola": "^2.15.3",
Expand Down
2 changes: 2 additions & 0 deletions packages/shared-config/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import getDefineVars from './getDefineVars.js';
import getPostcssOpts from './getPostcssOpts.js';
import getCSSModuleLocalIdent from './getCSSModuleLocalIdent.js';
import getAliasWithRoot from './getAlias.js';
import getDevtoolValue from './utils/getDevtool.js';

export {
getCSSModuleLocalIdent,
Expand All @@ -17,4 +18,5 @@ export {
getDefineVars,
getPostcssOpts,
getAliasWithRoot,
getDevtoolValue,
};
16 changes: 16 additions & 0 deletions packages/shared-config/src/utils/getDevtool.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { Config } from '../types';

interface GetDevtoolOptions<T = any> {
(sourceMap: Config['sourceMap']): T;
}

const getDevtoolValue: GetDevtoolOptions = (sourceMap) => {
if (typeof sourceMap === 'string') {
return sourceMap;
} else if (sourceMap === false) {
return false;
}
return 'source-map';
};

export default getDevtoolValue;
8 changes: 8 additions & 0 deletions packages/webpack-config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.1.11

### Patch Changes

- Updated dependencies [4bce5d79]
- @ice/bundles@0.2.4
- @ice/shared-config@1.2.4

## 1.1.10

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/webpack-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/webpack-config",
"version": "1.1.10",
"version": "1.1.11",
"repository": "alibaba/ice",
"bugs": "https://github.com/alibaba/ice/issues",
"homepage": "https://v3.ice.work",
Expand All @@ -15,8 +15,8 @@
"*.d.ts"
],
"dependencies": {
"@ice/shared-config": "1.2.3",
"@ice/bundles": "0.2.3",
"@ice/shared-config": "1.2.4",
"@ice/bundles": "0.2.4",
"fast-glob": "^3.2.11",
"process": "^0.11.10"
},
Expand Down
11 changes: 1 addition & 10 deletions packages/webpack-config/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ESlintPlugin from '@ice/bundles/compiled/eslint-webpack-plugin/index.js';
import CopyPlugin from '@ice/bundles/compiled/copy-webpack-plugin/index.js';
import type { NormalModule, Compiler, Configuration } from 'webpack';
import type webpack from 'webpack';
import { compilationPlugin, compileExcludes, getCompilerPlugins, getDefineVars, getAliasWithRoot } from '@ice/shared-config';
import { compilationPlugin, compileExcludes, getCompilerPlugins, getDefineVars, getAliasWithRoot, getDevtoolValue } from '@ice/shared-config';
import type { Config, ModifyWebpackConfig } from '@ice/shared-config/types.js';
import configAssets from './config/assets.js';
import configCss from './config/css.js';
Expand Down Expand Up @@ -427,12 +427,3 @@ export function getWebpackConfig(options: GetWebpackConfigOptions): Configuratio
.reduce((result, next: ModifyWebpackConfig<Configuration, typeof webpack>) => next(result, ctx), webpackConfig);
}

function getDevtoolValue(sourceMap: Config['sourceMap']) {
if (typeof sourceMap === 'string') {
return sourceMap;
} else if (sourceMap === false) {
return false;
}

return 'source-map';
}
Loading

0 comments on commit 1a65872

Please sign in to comment.