You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are going to be the main components of the v2 architecture
Resolvers
Resolvers will be responsible for resolving the path to a file based on relativity. They should be able to accept multiple module dirs and support live fs changes.
Loaders
Loaders will have the responsibility to process the raw contents of the files, even css or woff or something, and convert it into a js source, that automatically sets the contents to module.exports.
Loaders will also have the responsibility to tell pundle what others modules were required from it (only the ones where we can do it dynamic, like for js or coffee sources but NOT for less sources) as well as swap values in require to be usable in runtime
Transformers
Transformers will work in a way that they accept javascript and output javascript. Babel is an example use case of transformers.
Post-Transformers
Post-Transformers will work just like transformers, except after all transformers have been executed. UglifyJS is an example use case of transformers. Unlike transformers, these will not be executed on individual files but on the generated content.
Plugins
Everything else that does not modify the contents of the generated output will be a plugin. ESLint, NPM Installer and others could be counted as plugins.
Generators
Generators will be given the processed contents of each files and will be responsible for making output bundles. The default generator generates CommonJS style output.
Reporters
Reporters will be responsible for keeping the user aware of the status of the builds. For example, a reporter in pundle-dev could show the messages in browser, while the pundle CLI would show them in the terminal like this post
Other Notes to self
Make sure to split CLI into a separate package pundle-cli or something and make pundle an API only base package
Make sure to implement advance resolve config like aliases
Every component should have a this context that has a report() method, useful in cases like eslint
When this.resolve(path, ?from, ?cached) is called from a component, and the component is a resolver, make sure NOT to invoke that one again for that request until the existing request is fulfilled
TODO: Write more notes here
The text was updated successfully, but these errors were encountered:
Just writing these down so I don't forget
Main Components
These are going to be the main components of the v2 architecture
Resolvers
Resolvers will be responsible for resolving the path to a file based on relativity. They should be able to accept multiple module dirs and support live fs changes.
Loaders
Loaders will have the responsibility to process the raw contents of the files, even
css
orwoff
or something, and convert it into a js source, that automatically sets the contents tomodule.exports
.Loaders will also have the responsibility to tell pundle what others modules were required from it (only the ones where we can do it dynamic, like for js or coffee sources but NOT for less sources) as well as swap values in require to be usable in runtime
Transformers
Transformers will work in a way that they accept javascript and output javascript. Babel is an example use case of transformers.
Post-Transformers
Post-Transformers will work just like transformers, except after all transformers have been executed. UglifyJS is an example use case of transformers. Unlike transformers, these will not be executed on individual files but on the generated content.
Plugins
Everything else that does not modify the contents of the generated output will be a plugin. ESLint, NPM Installer and others could be counted as plugins.
Generators
Generators will be given the processed contents of each files and will be responsible for making output bundles. The default generator generates CommonJS style output.
Reporters
Reporters will be responsible for keeping the user aware of the status of the builds. For example, a reporter in pundle-dev could show the messages in browser, while the pundle CLI would show them in the terminal like this post
Other Notes to self
pundle-cli
or something and makepundle
an API only base packagealiases
this
context that has areport()
method, useful in cases like eslintthis.resolve(path, ?from, ?cached)
is called from a component, and the component is a resolver, make sure NOT to invoke that one again for that request until the existing request is fulfilledTODO: Write more notes here
The text was updated successfully, but these errors were encountered: