Giter Club home page Giter Club logo

Comments (7)

andywer avatar andywer commented on June 10, 2024 2

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?

from webpack-blocks.

andywer avatar andywer commented on June 10, 2024 1

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 πŸ˜‰

from webpack-blocks.

andywer avatar andywer commented on June 10, 2024 1

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 πŸ‘‡

from webpack-blocks.

zcei avatar zcei commented on June 10, 2024 1

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.

from webpack-blocks.

andywer avatar andywer commented on June 10, 2024

Fair enough. Feel free to open a PR if itβ€˜s an urgent issue πŸ˜‰

from webpack-blocks.

zcei avatar zcei commented on June 10, 2024

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

from webpack-blocks.

zcei avatar zcei commented on June 10, 2024

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 πŸ‘‡

from webpack-blocks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.