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

Fix #30, Upgrade build #32

Merged
merged 36 commits into from
Apr 13, 2021
Merged

Fix #30, Upgrade build #32

merged 36 commits into from
Apr 13, 2021

Conversation

Dan503
Copy link
Owner

@Dan503 Dan503 commented Mar 30, 2021

Adds shadow-dom support by fixing #30

Also upgrading the build process to use Gulp 4

Daniel Tonon and others added 27 commits December 5, 2019 19:22
I upgraded by replacing all the gulp files with the gulp files from the latest version of Yeogurt then tweacked them to  fit my needs.
This makes it more compatible with the react polyfill
# Conflicts:
#	auto.js
#	core/accessibility/create_a11y_block.js
#	core/converters/convert_to_12hr_time.js
#	dist/time-input-polyfill.auto.min.js
#	dist/time-input-polyfill.auto.min.js.map
#	dist/time-input-polyfill.min.js
#	dist/time-input-polyfill.min.js.map
#	docs/index.html
#	docs/scripts/main.js
#	docs/scripts/main.js.map
#	gulp/sass.js
#	package-lock.json
#	package.json
There are JS files in this project that are read by IE directly so I can't use function trailing commas
Pass in label to support the shadow DOM
@Dan503
Copy link
Owner Author

Dan503 commented Mar 30, 2021

Need to figure out how to release this thing without breaking everyone's builds.

I think I need to run a build process on index.js to convert it into a single bundled index.cjs.js file.

The legacy approach explained in this article looks like the best way to move forward:

https://2ality.com/2019/10/hybrid-npm-packages.html#legacy-approach-for-putting-es-modules-on-npm

Gulp breaks if I set "type": "module" in package.json.

Note: need to also do the same thing for supportsTime.

Daniel Tonon added 2 commits March 30, 2021 23:12
It breaks Gulp, need to make it work without it.
@Dan503
Copy link
Owner Author

Dan503 commented Apr 12, 2021

Last thing I need to do before publishing is testing a beta release.

I've released a beta version, it can be installed using npm i time-input-polyfill@beta

Need to test a project using Common-JS and a project using ES Modules.

Need to test:

  • require('time-input-polyfill/auto')
  • import 'time-input-polyfill/auto'
  • const supportsTime = require('time-input-polyfill/supportsTime')
  • import supportsTime from 'time-input-polyfill/supportsTime'
  • const TimePolyfill = require('time-input-polyfill')
  • import TimePolyfill from 'time-input-polyfill'

@Dan503
Copy link
Owner Author

Dan503 commented Apr 13, 2021

Ok I've tested it in a small project now and the import statements all appear to be working as expected. I think I can publish it now.

@Dan503 Dan503 merged commit e9a88c5 into master Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants