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

Add tsd #246

Open
zaaack opened this issue Jan 6, 2018 · 7 comments
Open

Add tsd #246

zaaack opened this issue Jan 6, 2018 · 7 comments

Comments

@zaaack
Copy link

zaaack commented Jan 6, 2018

Please add typescript definitions.

@andywer
Copy link
Owner

andywer commented Jan 6, 2018

Fair enough. Feel free to open a PR if it‘s an urgent issue 😉

@andywer
Copy link
Owner

andywer commented Jan 30, 2018

We need to discuss terminology here, since most terms haven't ever been clearly defined.
Current state of affairs is:

Initially I was thinking that a block is a self-contained, configurable portion of a Webpack Configuration - so actually entryPoint is the block, not entryPoint(), which could be a BlockInstance or similar.

Then a block is everything that has the signature (...args: any[]): BlockInstance, where BlockInstance = (current) WebpackBlock

If someone has a better naming suggestion for BlockInstance, feel free to share it here 😉

@andywer
Copy link
Owner

andywer commented Jan 30, 2018

Another term that might be discussable is WebpackBlockUpdater (see PR #247).

Maybe it's rather a WebpackConfigUpdater: It's actually so generic that it's not webpack-blocks-specific. And this name might transport more information. Objections?

@zcei
Copy link
Collaborator

zcei commented Jan 31, 2018

WebpackConfigUpdater is way better indeed. As it's just (previousConfig: WebpackConfig): WebpackConfig it really just is an updater for any Webpack config

@andywer
Copy link
Owner

andywer commented Mar 27, 2018

Suggestion for terminology, based on @zcei's PR:

  • entryPoint, for instance, is the Block
  • entryPoint() could be called a BlockInstance
  • WebpackConfig should be self-describing
  • WebpackConfigUpdater describes a function (prevConfig: WebpackConfig) => WebpackConfig

Note that I called it Block, not WebpackBlock, but yet called it WebpackConfig (not Config).

Idea behind it: There is no other "block" concept here than the lib's webpack blocks, so there might not be a need to make the name long. "config" on the other hand is such a general term that it might be better to call it "webpack config" when we talk about it.

Feel free to disagree now 👇

@andywer andywer mentioned this issue Mar 27, 2018
21 tasks
@zcei
Copy link
Collaborator

zcei commented Mar 27, 2018

On a second thought we could also "invert" the meaning, with:

  • entryPoint being a BlockCreator
  • entryPoint() being the Block

But I'm not too sure about it. Currently going with your approach - if necessary it's a matter of a simple "Rename symbol" refactoring.

@zcei
Copy link
Collaborator

zcei commented Mar 30, 2018

I just pushed some changes to the PR (#247), where I went with my proposal from last post.

In fact we never specify entryPoint types, they all just inherently comply to the Block / BlockCreator interface, as they all return an instance.

So the term Block belongs to the instance (entryPoint()) for me, as it will way more often be used than the creator interface.

Everyone who'll be talking in issues about "a bug in the block" will talk about a specific configuration, so basically there's a bug in the instance of the created block.

As @andywer said:

Feel free to disagree now 👇

@vlad-zhukov vlad-zhukov mentioned this issue Apr 21, 2018
17 tasks
@vlad-zhukov vlad-zhukov added this to the 2.0.0 milestone Apr 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants