GithubHelp home page GithubHelp logo

patrickjs / es7-reflect-metadata Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 2.0 363 KB

Webpack and Universal support for reflect-metadata refactored by @gdi2290

License: Apache License 2.0

JavaScript 24.92% CSS 1.81% HTML 49.28% TypeScript 23.99%

es7-reflect-metadata's Introduction

es7-reflect-metadata's People

Contributors

patrickjs avatar rbuckton avatar wbuchwalter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

es7-reflect-metadata's Issues

when getting metadata of a class, does it have to be an instance of a class or can it be the type

Hi - as title.

I have created a class decorator that defines if the class (which is a react screen) should show up in the main menu, and at what order etc.

I have the menu doing the reflection, and do not want to create instances of the screens to pass in. passing types fails..

Additionally, (and probably warrants its own separate thread), I dont like the pattern of explicity passing types/objects to my renderer component, and want that component instead to be able to scan for all classes that implement that metadata, but it doesnt seem possible without grouping all the possible classes into one file wrapped in a module directive.

crypto not found

I'm getting two errors in my browser console (Chrome latest). See end of message for call stacks.
My webpack build succedes, but the browser won't finish loading the page due to the errors. My package.json specifies:
"es7-reflect-metadata": "^1.5.5",

Uncaught TypeError: crypto.randomBytes is not a functiongenRandomBytes @ gen-randombytes.ts:5createUUID @ create-uuid.ts:5createUniqueKey @ create-unique-key.ts:11(anonymous function) @ weakmap.ts:5__webpack_require__ @ bootstrap ce8ea336ef6e370d804f:50(anonymous function) @ metadata.ts:1__webpack_require__ @ bootstrap ce8ea336ef6e370d804f:50(anonymous function) @ reflect-metadata.ts:22__webpack_require__ @ bootstrap ce8ea336ef6e370d804f:50(anonymous function) @ browser.ts:1__webpack_require__ @ bootstrap ce8ea336ef6e370d804f:50(anonymous function) @ polyfills.ts:18__webpack_require__ @ bootstrap ce8ea336ef6e370d804f:50(anonymous function) @ bootstrap ce8ea336ef6e370d804f:93(anonymous function) @ bootstrap ce8ea336ef6e370d804f:93 decorators.ts:242Uncaught reflect-metadata shim is required when using class decorators(anonymous function) @ decorators.ts:242__webpack_require__ @ bootstrap ce8ea336ef6e370d804f:50(anonymous function) @ decorators.ts:9__webpack_require__ @ bootstrap ce8ea336ef6e370d804f:50(anonymous function) @ di.ts:18__webpack_require__ @ bootstrap ce8ea336ef6e370d804f:50(anonymous function) @ di.ts:2__webpack_require__ @ bootstrap ce8ea336ef6e370d804f:50(anonymous function) @ metadata.ts:6__webpack_require__ @ bootstrap ce8ea336ef6e370d804f:50(anonymous function) @ core.ts:6__webpack_require__ @ bootstrap ce8ea336ef6e370d804f:50(anonymous function) @ main.ts:4__webpack_require__ @ bootstrap ce8ea336ef6e370d804f:50webpackJsonpCallback @ bootstrap ce8ea336ef6e370d804f:21(anonymous function) @ main.bundle.js:1

And

Uncaught reflect-metadata shim is required when using class decorators(anonymous function) @ decorators.ts:242__webpack_require__ @ bootstrap ce8ea336ef6e370d804f:50(anonymous function) @ decorators.ts:9__webpack_require__ @ bootstrap ce8ea336ef6e370d804f:50(anonymous function) @ di.ts:18__webpack_require__ @ bootstrap ce8ea336ef6e370d804f:50(anonymous function) @ di.ts:2__webpack_require__ @ bootstrap ce8ea336ef6e370d804f:50(anonymous function) @ metadata.ts:6__webpack_require__ @ bootstrap ce8ea336ef6e370d804f:50(anonymous function) @ core.ts:6__webpack_require__ @ bootstrap ce8ea336ef6e370d804f:50(anonymous function) @ main.ts:4__webpack_require__ @ bootstrap ce8ea336ef6e370d804f:50webpackJsonpCallback @ bootstrap ce8ea336ef6e370d804f:21(anonymous function) @ main.bundle.js:1

What am i doing wrong

Thanks to help the community.
I succesfully applied meta data using Reflect.defineMetadata... but when i go declarative way i get errors. I think i did not understand the tutorial well please help

import  "./reflect-metadata";
export class Address {
    @Reflect.metadata("Obsolete","true") <-- this throws error
    method() {
    }
}

What does `es7` mean?

I have a question. I couldn't understand what the name, es7-reflect-metadata, means.

Draft of ES7 (should be called as ES2016) has been snapshotted already. ReflectMetadata never be included by ES7.

https://twitter.com/bterlson/status/692424625813377026

I think this package is just a fork of reflect-metadata package for supporting UMD and Webpack. Why did you name this es7-reflect-metadata?

Thank you.

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.