Skip to content

Support static inline colouring for dynamic import - #2295

Merged
lukastaegert merged 2 commits into
masterfrom
dynamic-inline-colouring
Jun 27, 2018
Merged

Support static inline colouring for dynamic import#2295
lukastaegert merged 2 commits into
masterfrom
dynamic-inline-colouring

Conversation

@guybedford

Copy link
Copy Markdown
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.

@guybedford
guybedford force-pushed the dynamic-inline-colouring branch from e957024 to e7360a2 Compare June 21, 2018 21:28
@lukastaegert lukastaegert added this to the 0.62.0 milestone Jun 24, 2018
@lukastaegert
lukastaegert force-pushed the dynamic-inline-colouring branch from b508348 to e7360a2 Compare June 25, 2018 05:36

@lukastaegert lukastaegert left a comment

Copy link
Copy Markdown
Member

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
guybedford force-pushed the dynamic-inline-colouring branch from e7360a2 to e0bc164 Compare June 26, 2018 17:24
@guybedford

Copy link
Copy Markdown
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 :)

@guybedford
guybedford force-pushed the dynamic-inline-colouring branch from e0bc164 to 74a0b80 Compare June 26, 2018 17:59

@lukastaegert lukastaegert left a comment

Copy link
Copy Markdown
Member

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
@lukastaegert
lukastaegert deleted the dynamic-inline-colouring branch June 27, 2018 04:11
calebeby referenced this pull request in Pigmice2733/scouting-frontend 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](`https://github.com/rollup/rollup/pull/2118`))
* Inline dynamic imports that are also imported statically and only used in a single chunk ([#&#8203;2295](`https://github.com/rollup/rollup/pull/2295`))
* Handle caching and invalidation of assets ([#&#8203;2267](`https://github.com/rollup/rollup/pull/2267`))
* Fix plugin related types ([#&#8203;2299](`https://github.com/rollup/rollup/pull/2299`))

---

</details>




---

This PR has been generated by [Renovate Bot](https://renovatebot.com).
stipsan referenced this pull request in scroll-into-view/compute-scroll-into-view 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](`https://github.com/rollup/rollup/pull/2118`))
* Inline dynamic imports that are also imported statically and only used in a single chunk ([#&#8203;2295](`https://github.com/rollup/rollup/pull/2295`))
* Handle caching and invalidation of assets ([#&#8203;2267](`https://github.com/rollup/rollup/pull/2267`))
* Fix plugin related types ([#&#8203;2299](`https://github.com/rollup/rollup/pull/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

None yet

Development

Successfully merging this pull request may close these issues.

2 participants