Comments (4)
I'm not sure if this is exactly what you're after, but I've got yjs working with babel and webpack, and thought I'd share the configuration in case that's useful, so it's here
https://github.com/lukebarlow/yjs-jigsaw-es6-imports
from yjs.
Yes, but probably they can be got rid of with some small tweaks to the yjs code. Here's the error messages that pop up without those lines, in case that's helpful.
WARNING in ./~/yjs/src/Notes.md
Module parse failed: /Projects/fork/yjs-jigsaw-es6-imports/node_modules/yjs/src/Notes.md Unexpected character '#' (2:0)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected character '#' (2:0)
at Parser.pp$4.raise (/Projects/fork/yjs-jigsaw-es6-imports/node_modules/acorn/dist/acorn.js:2221:15)
at Parser.pp$7.getTokenFromCode (/Projects/fork/yjs-jigsaw-es6-imports/node_modules/acorn/dist/acorn.js:2756:10)
at Parser.pp$7.readToken (/Projects/fork/yjs-jigsaw-es6-imports/node_modules/acorn/dist/acorn.js:2477:17)
at Parser.pp$7.nextToken (/Projects/fork/yjs-jigsaw-es6-imports/node_modules/acorn/dist/acorn.js:2468:15)
at Parser.parse (/Projects/fork/yjs-jigsaw-es6-imports/node_modules/acorn/dist/acorn.js:515:10)
at Object.parse (/Projects/fork/yjs-jigsaw-es6-imports/node_modules/acorn/dist/acorn.js:3098:39)
at Parser.parse (/Projects/fork/yjs-jigsaw-es6-imports/node_modules/webpack/lib/Parser.js:902:15)
at DependenciesBlock.<anonymous> (/Projects/fork/yjs-jigsaw-es6-imports/node_modules/webpack/lib/NormalModule.js:104:16)
at DependenciesBlock.onModuleBuild (/Projects/fork/yjs-jigsaw-es6-imports/node_modules/webpack-core/lib/NormalModuleMixin.js:310:10)
at nextLoader (/Projects/fork/yjs-jigsaw-es6-imports/node_modules/webpack-core/lib/NormalModuleMixin.js:275:25)
at /Projects/fork/yjs-jigsaw-es6-imports/node_modules/webpack-core/lib/NormalModuleMixin.js:259:5
at Storage.finished (/Projects/fork/yjs-jigsaw-es6-imports/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:38:16)
at /Projects/fork/yjs-jigsaw-es6-imports/node_modules/graceful-fs/graceful-fs.js:78:16
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:439:3)
@ ./~/yjs/src ^\.\/.*$
ERROR in ./~/yjs/src/SpecHelper.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../../y-indexeddb/src/IndexedDB.js in /Projects/fork/yjs-jigsaw-es6-imports/node_modules/yjs/src
@ ./~/yjs/src/SpecHelper.js 13:0-45
ERROR in ./~/yjs/src/SpecHelper.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../../y-leveldb/src/LevelDB.js in /Projects/fork/yjs-jigsaw-es6-imports/node_modules/yjs/src
@ ./~/yjs/src/SpecHelper.js 15:2-43
ERROR in ./~/yjs/src/SpecHelper.js
Module not found: Error: Cannot resolve module 'seedrandom' in /Projects/fork/yjs-jigsaw-es6-imports/node_modules/yjs/src
@ ./~/yjs/src/SpecHelper.js 30:18-39
from yjs.
In nodejs it is likely that the file extention .mjs
will be used to recognize es2015 modules. In the future, this will be preferred as the file-extention for es2015 modules. See here
Rollup.js is currently lobbying for the package-entry jsnext:main
for all libraries. I plan to use rollup for the build-process in the next version of Yjs. The package.json will look like this:
{ ..
"main": "y.js",
"jsnext:main": "y.mjs",
}
This, hopefully, also resolves the broccoli problems.
from yjs.
This will be really helpful to others using webpack, thanks! I haven't used Webpack yet. I'll give it a try next week. Is this really necessary?:
plugins: [
new webpack.IgnorePlugin(/SpecHelper/),
new webpack.IgnorePlugin(/.*\.md/),
]
from yjs.
Related Issues (20)
- [HELP!!!] How do I know the shared-data synced?
- Y.Type is always AbstractType after `applyUpdate` HOT 2
- Error("Length exceeded!") should not be a module variable HOT 1
- `decodeStateVector` returns clock => client mapping instead of the opposite HOT 2
- Yjs backend validation with yjs-server in Fastify app
- Inconsistant output when updating same key in quick-start example HOT 1
- Allow to overwrite the clientID generation function in a YDoc HOT 3
- Fix links to docs
- README should mention "updateV2" event
- Add the topic #local-first be added to yjs repository
- How do I use persistence in y-websocket, such as leveldb or mongodb?
- Move redux binding to yjs org?
- Diff two versions of Y.Array/Y.Map
- Is it possible to read uintarray update data? HOT 1
- Misordered updates result in temporarily missing Y.Map keys HOT 5
- Merge transactions in undo manager HOT 7
- Mistake in documentation? Property 'set' does not exist on type 'YArray<unknown>'
- Logo as SVG? HOT 4
- RangeError Invalid typed array length: 110 & TypeError: contentRefs[(info & binary.BITS5)] is not a function HOT 2
- Support for TypeScript NodeNext HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yjs.