Comments (10)
I suspect we would be better off adopting something like: https://github.com/electron/asar if we went down the virtual file system route. It isn't a bad idea at all, and like Electron apps, .asar
s could be built into a single binary distribution.
from deno_std.
Given an arbitrary set of modules, authored in TypeScript, using imports with include fully qualified URLs (inlcuding the extension) output a single .ts
file which can then be used with Deno (possibly a single JS file).
The use case would be something like, as a developer, I want to create a single file asset that I can potentially distribute which contains all of my dependencies for a Deno application, without subsequent fetches of modules. I can also be sure that I have fixed versions of the remote modules which I can have tested and ensured the correct behaviour.
It should output either to the stdout, so it can be redirected to a file (which is best as a first step) and then eventually output to a file via a flag.
It is unlikely we would be able to replace rollup with this as part of the build process, as we are dependent upon a lot of plugins and other features of rollup to transform some of the code which would not be required by a Deno bundler. We have a long path until Deno can build its own JavaScript runtime, and I am not sure it is worth the effort for a long time.
from deno_std.
Is there a reason to make this bundle to a TS file? Why not support tar or zip archives? This way, everything works the same way it would for unbundled files, and decisions about processing and combining can be left out of it. Each archive just becomes its own virtual file system root (or directory - think Linux mounting an image at a mount point), and all resolutions behave accordingly.
This could even extend to url imports using hash to denote paths within a remote archive (e.g. https://foo.com/archive.tar#/sub/dir or file://./archive.tar#/sub/dir)
PS - I think we should use the extension ".tzar" 😆
from deno_std.
I don't fully understand what you want. What is the main purpose of the bundler?
- bundle what?
- when used?
- who uses?
- place on where?
Are you simply planning to replace rollup
on deno core?
from deno_std.
This rollup plugin can resolve URL imports: https://github.com/thgh/rollup-plugin-url-import
from deno_std.
@thgh the module resolution isn't the issue, it needs to run under Deno.
from deno_std.
Proof of concept:
deno https://raw.githubusercontent.com/thgh/deno-rollup/master/cli.js input.js
from deno_std.
@thgh That example may not be able to bundle .ts
file. I got:
Uncaught Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
from deno_std.
After some struggling with typescript
and rollup-plugin-typescript
and this particular file, here is a version that supports typescript:
#examples
deno --allow-net https://unpkg.com/[email protected]/cli.js https://raw.githubusercontent.com/denoland/deno_std/master/prettier/main.ts -T > prettier.js
deno --allow-net https://unpkg.com/[email protected]/cli.js https://raw.githubusercontent.com/denoland/deno_std/master/http/file_server_test.ts -d dist
deno --allow-net https://unpkg.com/[email protected]/cli.js -o logger_test.js -i https://raw.githubusercontent.com/denoland/deno_std/master/log/logger_test.ts
I'm not 100% sure if my implementation of the deno module resolution #233 is an exact match.
from deno_std.
Moving this discussion back to the main repo, as some time as passed: denoland/deno#2357
from deno_std.
Related Issues (20)
- suggestion: deprecate `writableStrategy` and `readableStrategy` argument properties for `std/json` constructors HOT 4
- bug: deprecation notices aren't shown on `https://deno.land/std/testing/asserts.ts` HOT 8
- suggestion: re-consider the deprecation of some IO-related APIs HOT 6
- todo: complete documentation for `cli/parse_args.ts` HOT 1
- Doc of `async/retry.ts` is rendered badly
- https://deno.land/std/http/http_status.ts does't work (404 not found) HOT 1
- dotenv should read from the root .env file HOT 4
- todo: use `using` keyword HOT 2
- todo: give `assertNotEquals()` assertion signature
- bug(ini): `parse() uses Object.defineProperty when setting object property` test is flaky HOT 1
- test errors for createHttpClient() at deno_std/http/server_test.ts HOT 5
- suggestion: re-structure `std/log` to adhere to singe-export files HOT 6
- suggestion: remove `flattenArgs()` from `log/formatters.ts` public API
- bug(toml): `parse` duplicates the character next to reserved escape sequences
- bug(expect): The function signature of `toMatchObject` is incorrect HOT 1
- `parse` of `std/flags` is not marked deprecated in API doc HOT 1
- todo: cleanup deprecated `Deno.*` APIs HOT 1
- Deno std_assert lacks a method to validate if a native Error object has the same message attribute as another. HOT 3
- Bring back examples folder HOT 2
- Secure Curves in the Web Cryptography API - secp256k1, X25519, X448, Ed25519, Ed448 HOT 6
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 deno_std.