Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Refactor compiler #486

Merged
merged 27 commits into from
Sep 1, 2018
Merged

Refactor compiler #486

merged 27 commits into from
Sep 1, 2018

Conversation

rtsao
Copy link
Member

@rtsao rtsao commented Aug 27, 2018

Summary

  • Replaces vanilla babel-loader with simplified version which also caches static analysis metadata in lockstep with the transformed code. This eliminates the current brittleness with translations discovery (related to persistent cache invalidation) and removes the need for hacky workaround fixes in Fix i18n hydration on dev restart #442 and Fix i18n discovery on dev restart #434.
  • Replaces our forked file-loader with a vastly simpler version that doesn't rely on singletons or shared state.
  • Replaces chunk id loader with a version that doesn't rely on singletons.
  • Simplifies Babel configuration
  • Deletes a considerable amount of vestigial code (mostly relating to the original evergreen bundles implementation and replaced test functionality)
  • Adds proper dev mode configuration to react babel preset.

Webpack compilation/loader communication

The old pattern relied on shared state via singletons which was far from ideal. This has been replaced with usage of loader context (and plugins that provide/consume this context). Shared state (between compilations and loaders as well as between sibling compilations) is now instantiated, passed, and mutated in a much more explicit manner.


Resolves #7
Resolves #8
Resolves #9
Resolves #15
Resolves #47

Lays the groundwork for #393 #426 fusionjs/rfcs#7 fusionjs/rfcs#10

@rtsao rtsao added the WIP label Aug 27, 2018
@rtsao rtsao changed the title Compile refactor Refactor compiler Aug 27, 2018
@rtsao rtsao added the feature label Aug 27, 2018
@rtsao rtsao force-pushed the next branch 4 times, most recently from 9940009 to 2952e4a Compare August 28, 2018 16:43
@rtsao rtsao requested review from ganemone, lhorie and KevinGrandon and removed request for ganemone and lhorie August 30, 2018 23:32
KevinGrandon
KevinGrandon previously approved these changes Aug 31, 2018
Copy link
Contributor

@KevinGrandon KevinGrandon left a comment

Choose a reason for hiding this comment

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

Going to stamp this for now, but might be nice to run through some of this with you later today or next week.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
2 participants