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

Feature Request: Introduce a "bundle" step in the file processing pipeline. #3633

Open
jginsburgn opened this issue Jan 25, 2021 · 0 comments · May be fixed by #3638
Open

Feature Request: Introduce a "bundle" step in the file processing pipeline. #3633

jginsburgn opened this issue Jan 25, 2021 · 0 comments · May be fixed by #3638

Comments

@jginsburgn
Copy link
Member

jginsburgn commented Jan 25, 2021

Tests and app code get through a pipeline in Karma:

  1. They are determined (wildcard resolution).
  2. They are loaded into memory (and cache).
  3. Watching is set up (if enabled).
  4. They undergo preprocessing.
  5. They are inserted in the respective context.html template expansion.
  6. They are served.

Preprocessing takes in a file and modifies it (i.e. input: 1 file; output: 1 file). However, this pipeline misses a step that offers a lot of potential: bundling. After preprocessing (between 3 and 4), bundling would get as input the preprocessed files and output other files (not necessarily in a 1:1 relationship).

Bundling could be used for:

  • Splitting large script files. This has been a need in our tests on Karma, as frequently big scripts mess up with the event loop and memory.
  • Packing/chunking scripts for lazy loading (https://webpack.js.org/guides/code-splitting/).
johnjbarton added a commit to johnjbarton/karma that referenced this issue Jan 27, 2021
The input config supplies 'patterns' which FileList expands into Files.
These files are preprocessed and then 'file-list-modified' is fired.
The event offers a pair of file lists, {included, served}.
The bundle layer maps this pair to a new pair where fewer files are included.
By default the bundler copies the inputs to outputs.

Fixes karma-runner#3633
@johnjbarton johnjbarton linked a pull request Jan 27, 2021 that will close this issue
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 a pull request may close this issue.

1 participant