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

Create browser build for metaschema #427

Closed
georgolden opened this issue Jul 20, 2022 · 4 comments
Closed

Create browser build for metaschema #427

georgolden opened this issue Jul 20, 2022 · 4 comments

Comments

@georgolden
Copy link
Member

georgolden commented Jul 20, 2022

To-do

Only place, where we have metavm - lib/loader.js

  • exclude lib/loader.js from build files
  • npm run build for build creation
  • Add to package.json import for browsers
@URVL
Copy link

URVL commented Nov 17, 2023

@tshemsedinov metaschema do not work in the browser because of the metautil dependency, which in turn is tied to nodejs features.

@URVL
Copy link

URVL commented Nov 17, 2023

@tshemsedinov metaschema do not work in the browser because of the metautil dependency, which in turn is tied to nodejs features.

would likely solve the issue of a separate build file from metautil for the browser

A quick fix:

-> node specific code to comments (and comment require('path') )
https://github.com/metarhia/metautil/blob/f390bfa2b4d50250d0918b92274be397457066fb/lib/strings.js#L69

-> update Extensd Error to browser Variant (note that Error is used in ./lib/async.js)
https://github.com/metarhia/metautil/blob/f390bfa2b4d50250d0918b92274be397457066fb/lib/error.js#L3

-> create ./metautil.browser.js and add all requires from metautil.js and
exclude node specific require in metautil.browser.js
https://github.com/metarhia/metautil/blob/master/lib/fs.js
https://github.com/metarhia/metautil/blob/master/lib/crypto.js
https://github.com/metarhia/metautil/blob/master/lib/http.js
https://github.com/metarhia/metautil/blob/master/lib/network.js

-> update package.json file (add field)

"browser": "metautil.browser.js",

@tshemsedinov
Copy link
Member

@tshemsedinov
Copy link
Member

tshemsedinov commented Nov 17, 2023

@georgolden @URVL Done in #462
Published in [email protected]

tshemsedinov added a commit to metarhia/metautil that referenced this issue Nov 18, 2023
tshemsedinov added a commit to metarhia/metautil that referenced this issue Nov 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants