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

Native exports #5

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Native exports #5

wants to merge 5 commits into from

Conversation

okcoker
Copy link

@okcoker okcoker commented Dec 15, 2015

Adds ability to export templates as native es6 exports. Consider this a WIP. Brad just alerted me about helpers.

Turns

Aftershave.templates.someTemplate = function(args) {
    // code
};

into:

export default function someTemplate(args) {
    // code
};

Adds exports option to generate template files as native exports
This will allow individual functions to be imported for upcoming import functionality
In your templates you can do something like:

{% import { getDisplayPrice } from '../utils/viewhelpers.js' %}
{% import { isAvailableInCountry } from '../utils/viewhelpers.js' %}

And they will be spit out in your result file. This hopefully gets
rid of the need for global helpers on the Aftershave namespace.
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.

1 participant