Skip to content

Do not name modules "module" #178

@kettanaito

Description

@kettanaito

What

We should not have a module/component named "module".

Why

module is a global variable inserted into code during the compilation. For instance, module is also responsible for HMR in webpack builds. We have just experienced this issue with @ronaldruzicka today morning:

import module from './components/module';
...
if (module.hot) {
  // Provide HMR logic
}

There are no hot updates accepted, since module is being overwritten with our custom component with the same name.

How

I would recommend to remove "module" example completely, since it doesn't add any value to the devstack (neither it shows some good practices, nor has an objective value, like being a useful snippet or reusable component).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions