Skip to content

Some JS page updates #31

@RedLucas

Description

@RedLucas

I'd be happy to contribute to these if you all agree with the following:

With Drupal 8.4, core JS uses the file.es6.js file naming convention... So we can write es6 now!

The Drupal eslint config and plugin flags 'use script' as unnecessary because it gets added during the compiling process.

Taking it one step further, (function($) { could then be used as ($) => {

Using $(document).on('ready') is unnecessary in favour of using Drupal.behaviors.{someRelevantMethodName} = { attach() {} };

Since behaviors get fired onready anyways, using some Drupal core JS.

And I would almost just remove or mark the line about bower_components as deprecated, since Bower is deprecated. You wouldn't want somebody to start a new project with it.

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