Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose transformations as a public API #13764

Closed
rbuckton opened this issue Jan 30, 2017 · 2 comments
Closed

Expose transformations as a public API #13764

rbuckton opened this issue Jan 30, 2017 · 2 comments
Assignees
Labels
Domain: Transforms Relates to the public transform API Fixed A PR has been merged for this issue Suggestion An idea for TypeScript

Comments

@rbuckton
Copy link
Member

Expose the transformFiles and getTransformers functions as a public API.

@dherges
Copy link

dherges commented Nov 8, 2017

Hi @rbuckton,

is there documentation on the transformations API? (#13940)

Here is a blog post http://blog.scottlogic.com/2017/05/02/typescript-compiler-api-revisited.html

My use case is inlining external resources into TypeScript from decorator metadata (more specific: Angular components):

Source Code:

@Component({
  templateUrl: './foo.component.html'
})
export class FooComponent {}

Expected transformed result will be similar to:

@Component({
  template: '<h1>Content from foo.component.html here...</h1>'
})
export class FooComponent {}

(and then compiled to es2015 syntax / es2015 module format)

--- edit ---

Use case is close to #13940 (comment)

Is it possible to transform-and-compile?

@geovanisouza92
Copy link

I'm looking for inlining things too (XML in my case).

Currently I'm using webpack loaders (have used babel-preval before, but it doesn't work with TS).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Domain: Transforms Relates to the public transform API Fixed A PR has been merged for this issue Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants