-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
'@difizen/babel-preset-mana': patch | ||
'@difizen/mana-observable': patch | ||
'@difizen/umi-plugin-mana': patch | ||
'@difizen/mana-syringe': patch | ||
'@difizen/mana-common': patch | ||
'@difizen/mana-react': patch | ||
'@difizen/mana-react-example': patch | ||
'@difizen/mana-core': patch | ||
'@difizen/mana-l10n': patch | ||
'@difizen/mana-app': patch | ||
'@difizen/mana-umi-example': patch | ||
'@difizen/mana-ui': patch | ||
'@difizen/mana-docs': patch | ||
--- | ||
|
||
You can now define metadata for views through view decorators, and view components can be React Lazy components, so dynamic components are also supported. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import 'react'; | ||
import assert from 'assert'; | ||
import 'reflect-metadata'; | ||
|
||
import { view } from './decorator'; | ||
import { BaseView } from './default-view'; | ||
import { ViewComponentToken, ViewDefineToken } from './view-protocol'; | ||
|
||
describe('app', () => { | ||
it('#view factory', () => { | ||
@view('foo') | ||
class Foo extends BaseView {} | ||
assert(Reflect.getMetadata(ViewDefineToken, Foo) === 'foo'); | ||
}); | ||
it('#view meta', () => { | ||
const FooRender = () => <></>; | ||
@view({ id: 'foo', component: FooRender }) | ||
class Foo extends BaseView {} | ||
assert(Reflect.getMetadata(ViewDefineToken, Foo) === 'foo'); | ||
assert(Reflect.getMetadata(ViewComponentToken, Foo) === FooRender); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters