Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could not use this as npm lib. #4

Open
jmfrancois opened this issue Apr 26, 2017 · 3 comments
Open

could not use this as npm lib. #4

jmfrancois opened this issue Apr 26, 2017 · 3 comments

Comments

@jmfrancois
Copy link

jmfrancois commented Apr 26, 2017

Enhancement

As a developer, when I install json-schema-form-core

Expected behaviour

I expect to be able to require the library.
I'm looking at refactor our react-talend-forms package using the uischema of schemaform.io.
At the moment this is a fork of react-jsonschema-form;

It seems json-schema-form-core is what I'm looking for and I would like to use it.
So for that I expect to be able to just import it and use it.

Actual behaviour

It fails with the following error:

ReferenceError: tv4 is not defined
    at Object.eval (webpack:///./~/json-schema-form-core/dist/json-schema-form-core.js?:2623:18)
    at __webpack_require__ (webpack:///./~/json-schema-form-core/dist/json-schema-form-core.js?:29:30)
    at Object.module.exports.ObjectPath.parse.i (webpack:///./~/json-schema-form-core/dist/json-schema-form-core.js?:2452:62)
    at __webpack_require__ (webpack:///./~/json-schema-form-core/dist/json-schema-form-core.js?:29:30)
    at Object.module.exports._typeof (webpack:///./~/json-schema-form-core/dist/json-schema-form-core.js?:491:72)
    at __webpack_require__ (webpack:///./~/json-schema-form-core/dist/json-schema-form-core.js?:29:30)
    at Object.eval (webpack:///./~/json-schema-form-core/dist/json-schema-form-core.js?:2629:18)
    at __webpack_require__ (webpack:///./~/json-schema-form-core/dist/json-schema-form-core.js?:29:30)
    at module.exports.Object.defineProperty.value (webpack:///./~/json-schema-form-core/dist/json-schema-form-core.js?:75:18)
    at Object.eval (webpack:///./~/json-schema-form-core/dist/json-schema-form-core.js?:78:10)

or just with node:

> var test = require('json-schema-form-core')
ReferenceError: tv4 is not defined
    at Object.<anonymous> (/Users/jmfrancois/github/talend/ui/packages/forms/node_modules/json-schema-form-core/dist/json-schema-form-core.js:2623:18)
    at __webpack_require__ (/Users/jmfrancois/github/talend/ui/packages/forms/node_modules/json-schema-form-core/dist/json-schema-form-core.js:29:30)
    at Object.module.exports.ObjectPath.parse.i (/Users/jmfrancois/github/talend/ui/packages/forms/node_modules/json-schema-form-core/dist/json-schema-form-core.js:2452:62)
    at __webpack_require__ (/Users/jmfrancois/github/talend/ui/packages/forms/node_modules/json-schema-form-core/dist/json-schema-form-core.js:29:30)
    at Object.module.exports._typeof (/Users/jmfrancois/github/talend/ui/packages/forms/node_modules/json-schema-form-core/dist/json-schema-form-core.js:491:72)
    at __webpack_require__ (/Users/jmfrancois/github/talend/ui/packages/forms/node_modules/json-schema-form-core/dist/json-schema-form-core.js:29:30)
    at Object.<anonymous> (/Users/jmfrancois/github/talend/ui/packages/forms/node_modules/json-schema-form-core/dist/json-schema-form-core.js:2629:18)
    at __webpack_require__ (/Users/jmfrancois/github/talend/ui/packages/forms/node_modules/json-schema-form-core/dist/json-schema-form-core.js:29:30)
    at module.exports.Object.defineProperty.value (/Users/jmfrancois/github/talend/ui/packages/forms/node_modules/json-schema-form-core/dist/json-schema-form-core.js:75:18)
    at Object.<anonymous> (/Users/jmfrancois/github/talend/ui/packages/forms/node_modules/json-schema-form-core/dist/json-schema-form-core.js:78:10)

In my opinion the issue comes from the build which should be more a babel transpilation instead of webpack build which target bundle.

Are you opened to PR to fix this ?

@Anthropic
Copy link
Member

@jmfrancois can you message me on gitter? Same username.

@jmfrancois
Copy link
Author

https://github.com/networknt/react-schema-form
is a react implementation of schemaform.io but it doesn't use this lib. so unexpected differences :/
would like to have / achieve something in common.
I'm connected on gitter

@Anthropic
Copy link
Member

As an update, I have almost finished a TypeScript conversion, which will output multiple compatible versions for use in other applications as I am migrating to a build process that copies RxJS' build steps and library structure to optimise webpack builds using the library.

I have also create www.github.com/jsonschema/assimilate to assist in removing the tv4 dependency and that library is structured in the same way as this library by following RxJS as a guide.

I should have a release soon, I just need to update all the tests and of course to document it all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants