-
Notifications
You must be signed in to change notification settings - Fork 52
Conversation
1f208c9
to
1c9ec6a
Compare
1c9ec6a
to
967e2e5
Compare
967e2e5
to
8887e8c
Compare
I assume this is WIP until tests are passing? |
Yes. This assumes component-compiler-utils PRs are merged. I asked for your review on approach. The descriptor compiler and an assemble implementation to cater common use cases. |
@yyx990803 please review now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Aside from the comment above, one thing is we might want to introduce an option to "externalize" the normalizer (kinda like webpack externals option) where the output will be one of:
- Directly inlined (default)
- Using a global (
normalizer: 'globalVariable'
) - Using an import (
normalizer: '~module-name'
)
src/compiler.ts
Outdated
const template = | ||
descriptor.template && this.compileTemplate(filename, descriptor.template) | ||
|
||
const styles = descriptor.styles.map(style => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The map function should probably be extracted into a method.
The externalization can be introduced later. Once you finish the style map refactor you can merge this to master and publish as |
There is simple
assemble
implementation which can cater most use-cases.