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

spack: super-fast bundler #825

Merged
merged 139 commits into from
Jun 13, 2020
Merged

spack: super-fast bundler #825

merged 139 commits into from
Jun 13, 2020

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Jun 6, 2020

It's far from complete, but I'm opening the pr to use it as a pointer.

Impl notes

  • rollup.js does not touch requires and dynamic imports
  • webpack can transform both dynamic imports and requires

Tasks

Other APIs including plugin are postponed.

  • ES6 import

    • normal import
    • aliased import
    • namespaced import
      • de-globing (& tree shaking)
      • namespaced import with dynamic key
  • Dead code elimination (+ tree shaking)

  • Chunking

  • Correct execution order

    • import statements
    • dynamic imports
  • Dynamic imports

    • Loading
  • Optimize helpers (remove duplicate)

  • .swcrc integration

  • "esnext" in package.json

  • spack.config.js

  • Merging of SourceFile

We also need a way to provide config while testing.

  • neon integration

TODOs (postponed)

  • common js import (require)
    • Execution order
    • Loading
    • Optional dependency

Ideas

constant optimizations

We can move all pure constants to top level function.
If those are marked with correct hygiene id,
it will be resolved differently and can be removed by minifier.

Fixture tests

  # Stores input files  
  - /input
    # Entries (this includes entry.js)
    - /input/entry*
  # Stores reference outputs
  - /output
    # Output entries
    - /output/entry*
    # Shared modules.
    - /output/chunk*

Closes #681.
Closes #43.

@kdy1 kdy1 marked this pull request as draft June 6, 2020 06:57
@kdy1 kdy1 self-assigned this Jun 7, 2020
@kdy1 kdy1 added this to the v1.2.0 milestone Jun 13, 2020
@kdy1 kdy1 marked this pull request as ready for review June 13, 2020 14:09
@kdy1 kdy1 merged commit fcef201 into swc-project:master Jun 13, 2020
@kdy1 kdy1 deleted the spack branch June 13, 2020 14:09
@swc-project swc-project locked as resolved and limited conversation to collaborators Nov 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Implement a javascript bundler similar to Rollup Bundler
1 participant