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

Avoid conflicts with ember-cli-htmlbars-inline-precompile #317

Commits on Oct 1, 2019

  1. Avoid conflicts with ember-cli-htmlbars-inline-precompile

    Both ember-cli-htmlbars-inline-precompile and ember-cli-htmlbars used
    the same _exact_ check to determine if
    `babel-plugin-htmlbars-inline-precompile` was registered. When the build
    was parallelizable we would properly detect that the
    babel-plugin-htmlbars-inline-precompile was or was not the one added by
    each respective addon (because the addon's own `__dirname` is included
    in the check) **but** when the build was not parallelizable the babel
    plugins array contains a standard Babel plugins array. In that case,
    both addons were _only_ checking if the plugin _path_ matched (via
    `require.resolve`) which was completely insufficient.
    
    This issue resulted in `ember-cli-htmlbars-inline-precompile` _thinking_
    that it was already registered _when_ the build was not parallelizable,
    which would subsequently make it not register its own instance of the
    plugin (to support import paths other than `ember-cli-htmlbars`).
    
    The fix here s twofold:
    
    1. This forces any instances of ember-cli-htmlbars-inline-precompile
       addon to be completely inert if it is part of the same parent addon
       or app as ember-cli-htmlbars itself.  In addition, we emit a
       deprecation notice when applicable.
    2. Updating the `_isInlinePrecompileBabelPluginRegistered` method to
       properly check if the plugin ember-cli-htmlbars is registering is
       already registered (with our configuration).
    rwjblue committed Oct 1, 2019
    Configuration menu
    Copy the full SHA
    2c3121f View commit details
    Browse the repository at this point in the history
  2. Reproduce inline precompilation failures when using ember-cli-htmlbar…

    …s-inline-precompile
    
    We **specifically** had tests for the scenario that ultimately was
    reported as failing. The description in ember-cli#317 explains the scenario
    better, but the failure scenario was only exposed IFF the same version
    of babel-plugin-htmlbars-inline-precompile was used (because both
    ember-cli-htmlbars-inline-precompile and ember-cli-htmlbars were
    comparing `require.resolve('babel-plugin-htmlbars-inline-precompile')`
    to determine if they should append the plugin again, so if they didn't
    use the same version ember-cli#312 wasn't possible).
    
    This updates the ember-try scenario to use
    ember-cli-htmlbars-inline-precompile@3.0.0, in order to replicate the
    error.
    
    (cherry picked from commit 79e953e)
    rwjblue committed Oct 1, 2019
    Configuration menu
    Copy the full SHA
    71314df View commit details
    Browse the repository at this point in the history