Comments (5)
I'm tinkering with this over at patternfly/patternfly-elements#2655. I think this will need some chin-scratching in order to work with typescript via esbuildPlugin.
My current error is
JspmError: Module not found: file:///home/bennyp/Developer/patternfly/node_modules/@patternfly/elements/pf-button/pf-button.js
I believe this requires more hooks into JSPM generator, since I have not yet seen a way to tell generator to parse typescript files.
Either I'm holding it wrong (likely), or JSPM generator needs a patch or two in order to support the workflow
Additionally, I'm unaware of reliable tools to resolve local monorepo (workspaces) directories, so i'll have to hack one together on my own with glob
from web.
I like this idea in general, mainly because it should improve the debugging experience even further.
But the potential caveat is: how do we know in advance what to include in the importmap?
- shall we analyze the entire dependencies tree of all entry point modules before serving the html?
- shall we cache all node_modules importmap and use that instead?
- how do we make this performant as compared to current behavior?
I think dynamic importmaps are not implemented / under discussion now, so it's not really possible to one-by-one inject newly identified bare modules over Web Sockets or smth, but even if it was possible, that would be even more perf cost as compared to current behavior, so I'd rather not go there.
Happy to discuss the details.
from web.
There are some interesting community plugins which might help to explore this idea https://github.com/WICG/import-maps#community-polyfills-and-tooling
from web.
JSPM CLI (jspm link index.html -p nodemodules -o index.html
) does exactly what I mean (can use an HTML file as an entry point, generates only required import maps, then injecting the import map output back into the HTML file). The only inconvenience is that this command has to be run manually every time.
Can we use @jspm/generator
in @web/dev-server
?
This is the low-level core library for working with import map generation that's used under the hood in the JSPM CLI.
from web.
+1 on this feature, we ran into some weird edge cases using --node-resolve
. I think that Web Test Runner should opt purely into generating an import map, and use as little transpilation as possible, relying on web tech instead.
from web.
Related Issues (20)
- Could not resolve import '@/utils/string' HOT 1
- Organize monorepo better HOT 8
- [@web/test-runner-visual-regression] Node is detached from document
- [@web/test-runner-playwright] browserType.launch: Executable doesn't exist HOT 1
- [dev-server] Loading library with large number of files freezes Chrome HOT 1
- Issues Implementing @web-test-runner in Docker Environment
- Dooplay theme
- Storybook higher than 7.5.3 does not export globals in @storybook/preview/globals
- Running fails with "cannot find module"
- test-runner-core always emits ansi codes to clear progress bars, even if there aren't progress bars
- Error: ENOENT: no such file or directory, stat '/test-mocks/prism.js'
- [rollup-plugin-html] No clearly documented / easy way to ignore modules
- Use normal `chai` package over `@esm-bundle/chai`
- Web Test Runner terminates randomly without logs HOT 5
- Including/excluding files from coverage based on source path HOT 2
- Tree shaken content shows up as tested in code coverage
- [dev-server-rollup] TypeError: Cannot destructure property 'skipSelf' of 'options' as it is undefined.
- [dev-server] [CVE-2023-42282] Update "ip" package to >=2.0.0 HOT 1
- Error when executing test "Failed to fetch dynamically imported module" HOT 5
- Used Puppeteer version is deprecated HOT 1
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 web.