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

[FEAT] Add shouldParseScope, disableTemplateTag, disableFunctionCall options #333

Merged
merged 1 commit into from
Feb 22, 2021

Commits on Feb 22, 2021

  1. [FEAT] Add shouldParseScope and disableTemplateLiteral options

    This PR refactors `modules` to enable users to pass an options, with
    three options currently supported:
    
    1. `shouldParseScope`, which allows users to parse the `scope` parameter
       into a static format usable by the precompiler
    
        ```js
        {
          modules: {
            'ember-cli-htmlbars': 'default',
            '@ember/template-compilation': {
              export: 'precompileTemplate',
              shouldParseScope: true,
            }
          }
        }
        ```
    
        When enabled, the scope parameter is parsed, and then turned into an
        array of the keys on the object. If a non-object is passed, or any of
        the keys or values are not references, then an error is thrown.
    
    2. `disableTemplateLiteral`, which disables using the precompile macro as a
       template tag. This should be used for `precompileTemplate` in
       `ember-cli-htmlbars`
    
    3. `disableFunctionCall`, which disables using the precompile macro as
       a function call. This should be used by experimental template import
       syntaxes.
    
    This PR also refactors the way that imports statements are processed.
    They're now parsed in the beginning, in `Program`, ensuring that the
    parse step is only done once, and that we can build a list of all
    present imports in the file. This allows us to support more than one
    module at once.
    
    wip
    Chris Garrett committed Feb 22, 2021
    Configuration menu
    Copy the full SHA
    e5f4049 View commit details
    Browse the repository at this point in the history