make auto definition optional#3
Merged
johnjenkins merged 3 commits intojohnjenkins:feat-custom-elements-import-dependenciesfrom Sep 29, 2021
rwaskiewicz:johnjenkins-feat-custom-elements-import-dependencies-ryan-3
Merged
make auto definition optional#3johnjenkins merged 3 commits intojohnjenkins:feat-custom-elements-import-dependenciesfrom rwaskiewicz:johnjenkins-feat-custom-elements-import-dependencies-ryan-3
johnjenkins merged 3 commits intojohnjenkins:feat-custom-elements-import-dependenciesfrom
rwaskiewicz:johnjenkins-feat-custom-elements-import-dependencies-ryan-3
Conversation
johnjenkins
reviewed
Sep 29, 2021
Owner
johnjenkins
left a comment
There was a problem hiding this comment.
Let me know what you think re the comments :)
| * functionality allows consumers to bypass the explicit call to define a component, its children, its children's | ||
| * children, etc. Users of this flag should be aware that enabling this functionality may increase bundle size. | ||
| */ | ||
| autoDefineCustomElements?: boolean; |
Owner
There was a problem hiding this comment.
Hey, I wonder if it might make more sense for this to go into the OutputTargetDistCustomElements interface as opposed to config extras? (~L1900)
| setupComponentDependencies(moduleFile, components, newStatements, caseStatements, tagNames); | ||
| addDefineCustomElementFunction(tagNames, newStatements, caseStatements); | ||
|
|
||
| if (config.extras?.autoDefineCustomElements) { |
Owner
There was a problem hiding this comment.
Hey, I wonder if it might make more sense for this to go into the OutputTargetDistCustomElements interface as opposed to config extras?
Suggested change
| if (config.extras?.autoDefineCustomElements) { | |
| import { isOutputTargetDistCustomElements } from 'src/compiler/output-targets/output-utils'; | |
| ... | |
| if (config.outputTargets.find(isOutputTargetDistCustomElements).autoDefineCustomElements) { |
OutputTargetDistCustomElements
johnjenkins
approved these changes
Sep 29, 2021
8247a84
into
johnjenkins:feat-custom-elements-import-dependencies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With this commit, we make auto definition of custom elements optional, by hiding them behind a configuration flag (
autoDefineCustomElements)A small design decision here: the
BUILD.*global variable is not available to us in code that lives insrc/compiler/*, which is why we use theconfigfile directly (or rather, the parsed/validated version of the config file).I also reverted the version change in
package.jsonI made in the last PR/commit