-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: support dsd #45
Conversation
My suggestion for this PR is to handle each part separately. Small fixesPull the two small fixes (optional chaining and shadowroot check) into the random fixes PR I have open, and merge all that basically right away. Build tooling changeWith regards to the build tooling change, I don't mind updating the build script, but I have some fundamental issues with updating the source (with the IIFEs) to optimize the build output for the short period where the build tool is bugged. My preference is to either wait until We can work on pulling the styling out of |
I removed the iifes. I don't like the mangled output, it makes debugging harder and there's a performance penalty at load and run time, but i also don't care enough to make the case |
@ruphin is this good to merge now? |
Apologies, I was busy this weekend. I'll review today but I think we're good |
Looking at the build output there's two things that confuse me still. The first is that I don't understand where the One more thing that's weird is that it injects the directory structure of my machine into the output: Thinking more about the build output, the original reasoning behind the build step was that so you could load and run this thing from CDNs like unpkg. It doesn't make much sense to build into es2022, which just ends up reducing compatibility. In general, I'm not a huge fan of packages that don't ship source but instead ship some build output. I think the user of a package should decide how to build and what output target they want. I could see changing the NPM package completely and just shipping the source directly. We could still have a build that produces output in But let me first try to understand your reasoning behind changing the build to output es2022. You are the main consumer of this package, how do you consume it and what are your requirements in this regard? How do you prefer packages to be published in general? |
You asked me to undo the workaround for the esbuild bug which downgrades the output target
I couldn't reproduce. what's your OS? perhaps we could adopt changesets and release from CI/CD |
I think es2022 is fine https://caniuse.com/mdn-javascript_classes_private_class_fields |
Will try this again now that evanw/esbuild#3167 |
esbuild 0.18.4 solves the problem, the built output is now much closer to source |
Looks good to me. Not sure why it outputs |
This PR updates the syntax of the built files to es2022, which includes ecmascript private fields and methods. By doing so, although the package will lose support for older browsers, the bundle sizes will be reduced because helpers like
__privateGet
will not be added.In order to accomplish this, this PR implements a workaround for an open issue on esbuild with regards to ecma private fields.
evanw/esbuild#2800 (comment)
In addition, this PR adds support for Declarative Shadow DOM templates by checking for the presence of a shadow root before creating one.