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

Support static inline colouring for dynamic import #2295

Merged
merged 2 commits into from
Jun 27, 2018

Conversation

guybedford
Copy link
Contributor

This solves the issue described by @eight04 in #2284 (comment).

If a the time of checking a dynamic import, its already in the same static graph as the parent, then we don't treat it as a dynamic import at that point.

Only if later on we discover that the dynamic import is imported uniquely from a colouring where it is not already in that colouring's static graph do we properly raise it to the status of entry point.

@lukastaegert lukastaegert added this to In progress in Release 1.0.0 via automation Jun 24, 2018
@lukastaegert lukastaegert added this to the 0.62.0 milestone Jun 24, 2018
@lukastaegert lukastaegert moved this from In progress to In Review in Release 1.0.0 Jun 24, 2018
Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works very nicely!

One minor note: It would be nice to have the dynamic import actually used in the test so that we can see the automatic inlining. You might for instance turn it around—export the dynamic import and make the synchronous import an "empty import". This would also showcase a simple way how to inline specific dynamic imports.

@guybedford
Copy link
Contributor Author

Sure I've switched around the test here, and in the process uncovered a dynamic import inlining bug which I've fixed as well :)

Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@lukastaegert lukastaegert merged commit c3228cd into master Jun 27, 2018
Release 1.0.0 automation moved this from In Review to Done Jun 27, 2018
@lukastaegert lukastaegert deleted the dynamic-inline-colouring branch June 27, 2018 04:11
calebeby pushed a commit to Pigmice2733/scouting-frontend that referenced this pull request Jun 30, 2018
This Pull Request updates dependency [rollup](https://github.com/rollup/rollup) from `v0.61.2` to `v0.62.0`



<details>
<summary>Release Notes</summary>

### [`v0.62.0`](https://github.com/rollup/rollup/blob/master/CHANGELOG.md#&#8203;0620)
[Compare Source](rollup/rollup@v0.61.2...v0.62.0)
*2018-06-27*
* Add option to automatically shim missing exports ([#&#8203;2118](`rollup/rollup#2118))
* Inline dynamic imports that are also imported statically and only used in a single chunk ([#&#8203;2295](`rollup/rollup#2295))
* Handle caching and invalidation of assets ([#&#8203;2267](`rollup/rollup#2267))
* Fix plugin related types ([#&#8203;2299](`rollup/rollup#2299))

---

</details>




---

This PR has been generated by [Renovate Bot](https://renovatebot.com).
stipsan pushed a commit to scroll-into-view/compute-scroll-into-view that referenced this pull request Jul 5, 2018
This Pull Request updates dependency [rollup](https://github.com/rollup/rollup) from `v0.61.2` to `v0.62.0`



<details>
<summary>Release Notes</summary>

### [`v0.62.0`](https://github.com/rollup/rollup/blob/master/CHANGELOG.md#&#8203;0620)
[Compare Source](rollup/rollup@v0.61.2...v0.62.0)
*2018-06-27*
* Add option to automatically shim missing exports ([#&#8203;2118](`rollup/rollup#2118))
* Inline dynamic imports that are also imported statically and only used in a single chunk ([#&#8203;2295](`rollup/rollup#2295))
* Handle caching and invalidation of assets ([#&#8203;2267](`rollup/rollup#2267))
* Fix plugin related types ([#&#8203;2299](`rollup/rollup#2299))

---

</details>




---

This PR has been generated by [Renovate Bot](https://renovatebot.com).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Release 1.0.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants