Skip to content

Commit

Permalink
Refact/spell (#275)
Browse files Browse the repository at this point in the history
* refactor: modify letter spell (#273)

Co-authored-by: Frank <[email protected]>

* refactor: 💡 change all sandboxContructor to sandboxConstructor

* chore: 🤖 version

* fix: 🐛 eval should not be bind (#302)

* fix: 🐛 eval should not be bind

✅ Closes: alibaba/ice#4294

* fix: 🐛 eventlistener should be store in this.eventListeners (#296)

* fix: 🐛 eventlistener should be store in this.eventListeners

✅ Closes: #295

* test: 💍 add more tests

✅ Closes: #295

* refactor: 💡 compatible with spell error

Co-authored-by: Zan Fu <[email protected]>
Co-authored-by: Frank <[email protected]>
  • Loading branch information
3 people authored May 20, 2021
1 parent 16b6465 commit 692b7f8
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

See [https://github.com/ice-lab/icestark/releases](https://github.com/ice-lab/icestark/releases) for what has changed in each version of icestark.

## 2.3.2

- [refact] compatible with sandbox spell error.

## 2.3.1

- [fix] parse `library` the right way if `library` is an array. ([#287](https://github.com/ice-lab/icestark/issues/287))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/stark",
"version": "2.3.1",
"version": "2.3.2",
"description": "Icestark is a JavaScript library for multiple projects, Ice workbench solution.",
"scripts": {
"install:deps": "rm -rf node_modules && rm -rf ./packages/*/node_modules && yarn install && lerna exec -- npm install",
Expand Down
4 changes: 4 additions & 0 deletions packages/icestark-module/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.4.1

- [refact] compatible with sandbox spell error.

## 1.4.0

- [feat] support local component when using `<MicroModule />`. ([#205](https://github.com/ice-lab/icestark/issues/205))
Expand Down
2 changes: 1 addition & 1 deletion packages/icestark-module/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/stark-module",
"version": "1.4.0",
"version": "1.4.1",
"description": "toolkit for load standard micro-module",
"main": "lib/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/icestark-module/src/MicroModule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface State {
}

/**
* default render compoent, mount all modules
* default render component, mount all modules
*/
export default class MicroModule extends React.Component<any, State> {
private moduleInfo = null;
Expand Down
4 changes: 2 additions & 2 deletions packages/icestark-module/src/modules.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Sandbox, { SandboxProps, SandboxContructor } from '@ice/sandbox';
import Sandbox, { SandboxProps, SandboxConstructor } from '@ice/sandbox';
import ModuleLoader from './loader';
import { Runtime, parseRuntime, RuntimeInstance } from './runtimeHelper';

Expand All @@ -14,7 +14,7 @@ export interface StarkModule {
unmount?: (targetNode: HTMLElement) => void;
};

export type ISandbox = boolean | SandboxProps | SandboxContructor;
export type ISandbox = boolean | SandboxProps | SandboxConstructor;

let globalModules = [];
let importModules = {};
Expand Down
4 changes: 2 additions & 2 deletions packages/icestark-module/tests/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import '@testing-library/jest-dom/extend-expect';
import { render } from '@testing-library/react';
import * as fs from 'fs';
import * as path from 'path';
import Sandbox, { SandboxContructor } from '@ice/sandbox';
import Sandbox, { SandboxConstructor } from '@ice/sandbox';

import {
getModules,
Expand Down Expand Up @@ -133,7 +133,7 @@ describe('render modules', () => {
test('mountModule with custom sandbox', (next) => {
const moduleInfo = { name: 'customSandbox', url: '//localhost', mount: defaultMount, unmount: defaultUnmount };
const div = document.createElement('div');
mountModule(moduleInfo, div, {}, (Sandbox as SandboxContructor));
mountModule(moduleInfo, div, {}, (Sandbox as SandboxConstructor));
setTimeout(() => {
expect(div.innerHTML).toBe('<div><h2>404</h2></div>');
unmoutModule(moduleInfo, div);
Expand Down
4 changes: 2 additions & 2 deletions src/apps.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Sandbox, { SandboxContructor, SandboxProps } from '@ice/sandbox';
import Sandbox, { SandboxConstructor, SandboxProps } from '@ice/sandbox';
import * as isEmpty from 'lodash.isempty';
import { NOT_LOADED, NOT_MOUNTED, LOADING_ASSETS, UNMOUNTED, LOAD_ERROR, MOUNTED } from './util/constant';
import { matchActivePath, MatchOptions, PathData, PathOptions } from './util/matchPath';
Expand Down Expand Up @@ -29,7 +29,7 @@ export interface BaseConfig extends PathOptions {
url?: string | string[];
container?: HTMLElement;
status?: string;
sandbox?: boolean | SandboxProps | SandboxContructor;
sandbox?: boolean | SandboxProps | SandboxConstructor;
entry?: string;
entryContent?: string;
/**
Expand Down
4 changes: 2 additions & 2 deletions src/util/handleAssets.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as urlParse from 'url-parse';
import Sandbox, { SandboxProps, SandboxContructor } from '@ice/sandbox';
import Sandbox, { SandboxProps, SandboxConstructor } from '@ice/sandbox';
import { PREFIX, DYNAMIC, STATIC, IS_CSS_REGEX } from './constant';
import { warn, error } from './message';
import { Fetch, defaultFetch } from '../start';
Expand Down Expand Up @@ -515,7 +515,7 @@ export async function loadAndAppendJsAssets(assets: Assets, sandbox?: Sandbox, f
);
}

export function createSandbox(sandbox?: boolean | SandboxProps | SandboxContructor) {
export function createSandbox(sandbox?: boolean | SandboxProps | SandboxConstructor) {
// Create appSandbox if sandbox is active
let appSandbox = null;
if (sandbox) {
Expand Down

0 comments on commit 692b7f8

Please sign in to comment.