Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/green-insects-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lynx-js/web-core-wasm": patch
---

reexports essential utils & types in @lynx-js/web-elements from @lynx-js/web-core-wasm/client
5 changes: 5 additions & 0 deletions .changeset/lemon-bugs-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lynx-js/react-webpack-plugin": patch
---

Set `__DEV__` and `__PROFILE__` to `true` on `NODE_ENV === 'development'`.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
runs-on:
- label: lynx-ubuntu-24.04-xlarge
name: Ubuntu
# - label: lynx-windows-2022-large-verify
# - label: lynx-windows-2022-large
# name: Windows
timeout-minutes: 30
permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ jobs:
- name: Ubuntu
label: lynx-ubuntu-24.04-medium
- name: Windows
label: lynx-windows-2022-large-verify
label: lynx-windows-2022-large
name: Vitest (${{ matrix.runs-on.name }})
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workflow-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
runs-on:
- label: lynx-ubuntu-24.04-xlarge
name: Ubuntu
- label: lynx-windows-2022-large-verify
- label: lynx-windows-2022-large
name: Windows
timeout-minutes: 30
needs: get-merge-base
Expand Down
1 change: 1 addition & 0 deletions packages/web-platform/web-core-wasm/ts/client/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import './mainthread/LynxView.js';
import '../../css/index.css';
export type { LynxViewElement } from './mainthread/LynxView.js';
export * from '@lynx-js/web-elements';
1 change: 1 addition & 0 deletions packages/web-platform/web-elements/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"type": "module",
"exports": {
".": {
"@lynx-js/source-field": "./src/elements/index.ts",
"types": "./dist/elements/index.d.ts",
"default": "./dist/elements/index.js"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,17 @@ class ReactWebpackPlugin {
DEBUG: null,
}).apply(compiler);

const isDev = process.env['NODE_ENV'] === 'development'
|| compiler.options.mode === 'development';

new DefinePlugin({
__DEV__: JSON.stringify(compiler.options.mode === 'development'),
__DEV__: isDev,
// We enable profile by default in development.
// It can also be disabled by environment variable `REACT_PROFILE=false`
__PROFILE__: JSON.stringify(
process.env['REACT_PROFILE']
?? options.profile
?? compiler.options.mode === 'development',
?? isDev,
),
// User can enable ALog by environment variable `REACT_ALOG=true`
__ALOG__: JSON.stringify(Boolean(process.env['REACT_ALOG'])),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
it('__DEV__ should be true when mode is production but NODE_ENV is development', () => {
expect(__DEV__).toBe(true);
expect(__PROFILE__).toBe(true);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { createConfig } from '../../../create-react-config.js';

const config = createConfig();

let oldNodeEnv;
config.plugins.unshift({
apply: () => {
oldNodeEnv = process.env.NODE_ENV;
process.env.NODE_ENV = 'development';
},
});

config.plugins.push({
apply: () => {
process.env.NODE_ENV = oldNodeEnv;
},
});

/** @type {import('@rspack/core').Configuration} */
export default {
...config,
context: __dirname,
mode: 'production',
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/** @type {import("@lynx-js/test-tools").TConfigCaseConfig} */
module.exports = {
bundlePath: [
'main__main-thread.js',
'main__background.js',
],
};
Loading