question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Autoloading Attribute

See original GitHub issue

Description

An attribute on classes preventing or enabling them to autoload

What does this proposal attempt to solve or improve?

Attributes will be less code and cleaner code rather than overriding a method and returning.

Which (other) solutions should be considered?

N/A

Examples

//This item will not autoload
[Autoload(false)]
public class CoolItem : ModItem { }

Notes

Could be paired with the #848 pull request

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Chicken-Bonescommented, Jun 6, 2020

I need to look into it more, but the current system doesn’t work well with Items that want to have custom constructors, because you have to leave a default one just to allow tML to know you don’t want it autoloaded

1reaction
Chicken-Bonescommented, May 31, 2020

Worth discussing, there’s room for improvement in autoloading, and having it work well with constructors

Read more comments on GitHub >

github_iconTop Results From Across the Web

Autoloading Classes - Manual
By registering autoloaders, PHP is given a last chance to load the class or ... Autoloading can then be triggered by accessing the...
Read more >
13.11. Generating Attribute Methods Using AUTOLOAD
Perl's AUTOLOAD mechanism intercepts all possible undefined method calls. So as not to permit arbitrary data names, we'll store the list of permitted...
Read more >
Generating Attribute Methods Using AUTOLOAD - Perl ...
The AUTOLOAD method will check to verify that the accessed field is in that hash. package Person; use strict; use Carp; use vars...
Read more >
Use autoloading and namespaces in PHP
In the PHP language, autoloading is a way to automatically include class files of a project in your code.
Read more >
ProvideAutoLoadAttribute Class
This attribute registers the package as an extender. The GUID passed in determines what is being extended. The attributes on a package do...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found