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

API to create and return a component constructor #354

Merged
merged 14 commits into from
Mar 7, 2017

Conversation

taylorzane
Copy link
Contributor

This PR implements an API call, create, that takes a component string, and returns a Svelte component constructor.

It also implements the eval format, that create uses behind the scenes. eval is just like iife with the exception that eval does not set a global variable, but simply returns the result of the IIFE (the component constructor).

The create call has the following signature: create(source[, options]) -> SvelteComponent. options is optional as the format is set to eval automatically. All other defaults are set as they are with compile.

These changes are accompanied by tests, that all pass.

I made sure to follow the style of the repo to the best of my abilities, please mention any irregularities.

@taylorzane
Copy link
Contributor Author

This addresses issue #345

@Rich-Harris Rich-Harris merged commit 415aed7 into sveltejs:master Mar 7, 2017
Rich-Harris added a commit that referenced this pull request Mar 7, 2017
@Rich-Harris
Copy link
Member

Thanks so much! Released this as 1.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants