Skip to content

Commit

Permalink
Merge branch 'main' into refactor/node
Browse files Browse the repository at this point in the history
  • Loading branch information
ErKeLost authored Oct 12, 2024
2 parents 08e14b7 + 04a124f commit 9dc4f7a
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .changeset/wet-snakes-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@farmfe/runtime": patch
"@farmfe/core": patch
---

Fix css dynamic loading runtime error #1551
7 changes: 7 additions & 0 deletions bench/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# bench

## 1.0.16

### Patch Changes

- Updated dependencies
- @farmfe/core@1.3.27

## 1.0.15

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion bench/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bench",
"version": "1.0.15",
"version": "1.0.16",
"private": true,
"description": "",
"scripts": {},
Expand Down
3 changes: 3 additions & 0 deletions examples/css-url/src/dynamic.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
background-color: lightblue;
}
2 changes: 2 additions & 0 deletions examples/css-url/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react';
import './main.css';

import('./dynamic.css');

export function Main() {
return (
<>
Expand Down
2 changes: 1 addition & 1 deletion js-plugins/solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"solid-js": "^1.7.8"
},
"peerDependencies": {
"@farmfe/core": "workspace:^1.3.26"
"@farmfe/core": "workspace:^1.3.27"
},
"files": [
"build"
Expand Down
2 changes: 1 addition & 1 deletion js-plugins/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"source-map": "^0.7.4"
},
"peerDependencies": {
"@farmfe/core": "workspace:^1.3.26",
"@farmfe/core": "workspace:^1.3.27",
"less": "*",
"sass": "*",
"stylus": "*"
Expand Down
8 changes: 8 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @farmfe/core

## 1.3.27

### Patch Changes

- Bump version
- Updated dependencies
- @farmfe/runtime@0.12.6

## 1.3.26

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@farmfe/core",
"version": "1.3.26",
"version": "1.3.27",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
Expand Down Expand Up @@ -90,7 +90,7 @@
"ws": "^8.14.2"
},
"dependencies": {
"@farmfe/runtime": "workspace:0.12.5",
"@farmfe/runtime": "workspace:0.12.6",
"@farmfe/runtime-plugin-hmr": "workspace:3.5.7",
"@farmfe/runtime-plugin-import-meta": "workspace:0.2.2",
"@farmfe/utils": "workspace:*",
Expand Down

Large diffs are not rendered by default.

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

## 0.12.6

### Patch Changes

- Bump version

## 0.12.5

### Patch Changes
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": "@farmfe/runtime",
"version": "0.12.5",
"version": "0.12.6",
"description": "Runtime of Farm",
"author": {
"name": "bright wu",
Expand Down
5 changes: 5 additions & 0 deletions packages/runtime/src/module-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ export class ModuleSystem {
}),
)
.then(() => {
// Do not require the module if all the resources are not js resources
if (resources.every(resource => resource.type !== 0)) {
return;
}

if (!this.modules[moduleId]) {
throw new Error(
`Dynamic imported module "${moduleId}" is not registered.`,
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9dc4f7a

Please sign in to comment.