Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

feat: use component-compiler-utils #59

Merged
merged 15 commits into from
May 1, 2018

Conversation

znck
Copy link
Member

@znck znck commented Apr 26, 2018

There is simple assemble implementation which can cater most use-cases.

@znck znck force-pushed the feat/use-component-compiler-utils branch from 1f208c9 to 1c9ec6a Compare April 26, 2018 05:26
@znck znck changed the title feat: allow additional properties in options feat: use component-compiler-utils Apr 26, 2018
@znck znck requested a review from yyx990803 April 26, 2018 05:29
@znck znck force-pushed the feat/use-component-compiler-utils branch from 1c9ec6a to 967e2e5 Compare April 26, 2018 05:30
@znck znck force-pushed the feat/use-component-compiler-utils branch from 967e2e5 to 8887e8c Compare April 26, 2018 05:30
@yyx990803
Copy link
Member

I assume this is WIP until tests are passing?

@znck
Copy link
Member Author

znck commented Apr 26, 2018

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.

@znck
Copy link
Member Author

znck commented Apr 27, 2018

@yyx990803 please review now.

Copy link
Member

@yyx990803 yyx990803 left a 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 => {
Copy link
Member

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.

@yyx990803
Copy link
Member

The externalization can be introduced later. Once you finish the style map refactor you can merge this to master and publish as @vue/component-compiler. Also add some documentation :)

@znck znck merged commit 976d4f1 into vuejs:master May 1, 2018
@znck znck deleted the feat/use-component-compiler-utils branch May 1, 2018 07:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants