-
Notifications
You must be signed in to change notification settings - Fork 41
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
docs(en): merge rollup/master into rollup-docs-cn/master @ 7c0b1f88 #161
Merged
Conversation
This file contains 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
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Replace include with includePath * Tree-shaking * Reduce performance overhead * Tree-shaking the namespace if it is passed to function * Optimize tree-shaking for ParameterVariable * refactor: track the usage of namespace * Track arguments * Improve tree-shaking and Tweak tests * make path unconditional * make code more concise * Try to include all properties of arguments in ParameterScope * Add comment to explain includePath semantics * Ensure we do not confuse arguments and parameters by name arguments = what is passed to a call parameters = what is declared in a function * Implement basic object expression tree-shaking This will allow us to more easily track if the inclusion logic is correct. * include UNKNOWN_PATH for externalVariable and syntheticNamespace * extend the includeVariableInModule function to take path * preserve additionalInitializers * wrap double brackets to empty object * include UNKNOWN_PATH for resolved properties when subPath is empty * clear cached path for paramter variable * extends the includePath of Variable to take context * extends InclusionContext to include currentIncludedParameter * record the included Path of trackedArugment * add a recursion tracker to the hasEffectsOnInteractionAtPath call in parameterVariable * preserve the object on the right side of the global assignment * avoid excessive object tree-shaking for parameters * Move Identifier inclusion logic to IdentifierBase To see in one place what happens here and avoid duplication * Use a dedicated tracker so that each path of a variable is included once. * Make the path a required parameter for includeVariableInModule This will result in including the given path. However, if a variable is later called with different paths, we also want to include those paths. Thus if the variable is included, we still call includePath on the variable and rely on the included path tracking logic of the variable to prevent infinite cycles. * Improve order of properties in file * Only explicitly re-include non-empty paths An empty path is equivalent to making something "included" * Rename PathTracker -> EntityPathTracker for better differentiation. * Refine recursion detection Use existing context function and differentiate between different interaction types. This will also allow us to treat recursions as "false" rather than "true". * Improve name We are tracking which parts of an argument are included via destructuring. * Forward destructuring paths when declaring variables The goal is to make it easy then to properly associate included paths with variables declared via destructuring. This will happen in subsequent commits. * Improve handling of unknown keys in inclusion tracker - short-circuiting when including them should save some memory - other symbols will now be handled like unknown, making sure they are not overlooked, e.g. when "unknown number" is already included and checking whether a specific number is included. * Rework how destructuring declarations are handled While the lhs of a destructuring declaration is preserved if included, only relevant paths of the rhs are preserved. This works by storing an initPath with each variable that describes which path of the init is actually the init. * Add detailed regression tests for destructured variables * Rewrite initial support for parameter destructuring * Include context with call arguments We will need this as calling a function on an object, we need to make sure all paths on the object accessed by the function are included. At the moment, this includes many more paths as the logic is not yet very refined. In the future, this should probably become includeInteractionArgumentsAtPath * Only include properties of arguments that are used or destructured * Track argument values through destructuring Also, this will use the addArgumentValue method for tracking known values in the same place we generally track values. Note that at the moment, this will only work one level deep as ParameterVariable only tracks top-level deoptimizations. * Consider correct initPath when including call arguments * Move argument deoptimization for function calls to ReturnValueScope * Prevent access to parameter variables * Clean up comments and add test * Remove some leftover unused code * Fix lint error * Replace included paths with a constant when an unknown path is included Hopefully, this saves some memory. * Do not check audit while installing This can fail a release as our audit check relies on a dependency * Track side effects when destructuring This tracks effects when destructuring properties of an object triggers a getter or an access error. * Only selectively deoptimize on pattern assignment * Track side effects when passing objects with getters to functions The destructuring may trigger the getters. * Ensure to fully include objects via dynamic import We want to tree-shake them eventually, but not this PR: * Observe propertyReadSideEffects: false when destructuring * Observe destructured getter side effects When destructuring getters on an object, we need check whether the getter mutates the object it is defined on. In that case, we cannot remove an unused destructured variable. * 4.27.0-0 * Always include variable for destructured variables Especially in the case where we include for destructuring side effects only, this ensures we avoid variable names conflicts. * 4.27.0-1 --------- Co-authored-by: Lukas Taegert-Atkinson <[email protected]>
In certain cases, the maximum length was actually 21, resulting in unexpected file names and off-by-one-sourcemaps.
fix(deps): update swc monorepo Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Add breakoff condition for deep path access. * 4.27.1-0 * Add more breakoff condition for deep path access. * 4.27.1-1
* Ensure we also include declared variables if they are included for a key or default side effect * Always include full array patterns
…ed (#5736) Revert "feat: implement object tree-shaking (#5420)" This reverts commit a9acb57.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
❌ Deploy Preview for relaxed-alfajores-47dd1b failed.
|
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.
此 PR 自动生成。
合并 rollup/rollup 的修改至本仓库(@ 7c0b1f8)
以下文件存在冲突,可能需要重新翻译:
请解决所有冲突后提交到此 pull request,可直接在 Github 修改、切换到 sync-7c0b1f88 分支进行修改或者使用 Github Desktop 拉取此 pr 修改并提交。
禁止使用 Squash Merge 来合并此 Pull Request!
使用该操作会导致上游仓库的内容丢失,并致使下一次合并产生冲突。